Questions tagged [python]

Python is an interpreted, general-purpose high-level programming language whose design philosophy emphasizes code readability.

Filter by
Sorted by
Tagged with
0
votes
1answer
605 views

Unable to capture the alert in Selenium using Python

I am trying to test a web portal using Selenium and Python. The problem is, I am unable to get around an error, in other words, I am unable to catch the alert. Scenario: Search for a user, if the ...
0
votes
0answers
8 views

exception handling in python selenium error

for i in href2[420:423]: driver.get(i) time.sleep(3) #scroll down actions = ActionChains(driver) for _ in range(4): actions.send_keys(Keys.PAGE_DOWN).perform() time....
0
votes
1answer
43 views

How can I handle browser alert

I do not understand how to click allow button. import time from selenium import webdriver chrome_options = webdriver.ChromeOptions() chrome_options.add_argument("--disable-notifications") ...
0
votes
0answers
20 views

Test execution gets stopped after an assertion error using Pytest

For the data driven testing, if there are 10 data sets, and the assertion fails for 3rd data set, then the rest of the 7 data sets are not considered for execution and the program gets stopped at that ...
1
vote
1answer
2k views

Headless Chrome browser won't switch to next window (Selenium + Python)

So I have a test case: When clicking a button a new window is opened. To switch to that new window I use: window_after = self.driver.window_handles[1] self.driver.switch_to.window(window_after) When ...
-1
votes
1answer
52 views

Selenium - IndexError: list index out of range

 Customer Order Function <input type="button" name="" accesskey="D" value="D" onclick="go('/tips/SO1R1301.do')" class=&...
0
votes
1answer
399 views

How can I set the language of Safari and launch using Selenium?

I need to launch the Safari browser for automation with a specific language(Korean) for automation purpose. I am using selenium with python for automation. How can I do that ?
17
votes
4answers
43k views

How to clear localStorage using selenium and webdriver

I want to call localStorage.clear() before running a group of specific tests but the thing is I don't know how. I can see CLEAR_LOCAL_STORAGE variable mentioned here but still failing to understand ...
0
votes
1answer
17 views

How would I retrieve links of every page, and through those links, I want to retrieve links of the products

next_btn = driver.find_element_by_xpath("//a[@class='ge-49M']") for i in next_btn: driver.get(i) lnks = driver.find_elements_by_xpath("//a[@class='_2UzuFa']") for z in ...
0
votes
1answer
16 views

10th element in rating is not present so what should i do to print dash(-) in that place tto matchup the data frame

import pandas as pd import selenium from selenium import webdriver from selenium.common.exceptions import NoSuchElementException import pandas as pd import time driver = webdriver.Chrome(r"C:\...
0
votes
3answers
3k views

Issue using XPath

I'm having an issue. I'm using Selenium and PyCharm. Website: https://www.expedia.com/ I'm trying to click() on the "Search" button. I used these: driver.find_element(By.ID, "search-button-hp-...
0
votes
2answers
186 views

login for https url having https different url for browser popup in selenium python

I have url https://dc1-common.naops.exu.xxxx.se/cgi-bin/index.pl and after entering I got another url https://dc1-common.naops.exu.xxxx.se with Sign In Browser pop up which requires for Authentication ...
0
votes
1answer
21 views

Python Selinium Javascript button download file

Website: https://myir.ird.govt.nz/eservices/home/?link=RWTEXREG I'm attempting to download this file. It looks like the request is handled server side so there isn't any download link per se. I've ...
4
votes
1answer
5k views

Selenium: how to prevent a just-started Chrome window from receiving focus

Using Selenium + chromedriver on Linux, like so; chrome_options = Options() driver = webdriver.Chrome('/usr/bin/chromedriver',options=chrome_options) driver.get('https://www.somewebsite.com') Chrome ...
0
votes
2answers
3k views

How to get Embed link from Openload API after Remote upload? Selenium & Python

im trying to use Openloads API in python, i can do a remote upload like this: ol_url = driver.current_url resp = ol.remote_upload(ol_url) file_id = resp.get('id') Now i have a file uploaded in ...
1
vote
1answer
2k views

Selenium WebDriver document.getElementById instead of send_keys

I have the following code driver.find_element_by_id("Element_ID").send_keys(str(sheet.cell(row=r, column=2).value)) Values is taken from excel, but instead send_keys, I want to use document....
0
votes
1answer
251 views

AttributeError: module 'selenium.webdriver.common.keys' has no attribute 'RETURN'

When I run my script it gives me this error: Traceback (most recent call last): File "C:\Development\Python_Project\SDETpythonProject\SDET_Package\my_firstProject.py", line 18, in <...
0
votes
1answer
21 views

Android Function testing report generate using Appium + Python

I am currently working on a mobile application with appium with python. There are a lot of options for every file selection in that. Currently checking if processing all the types of files are ...
1
vote
1answer
74 views

Selenium is not finding button even though it has a Class Name and XPath

I am attempting to click a save button but Selenium (with Python) is having issues. I keep getting the error, "Message: no such element: Unable to locate element" Here is the HTML <input ...
1
vote
4answers
24k views

ROBOT FRAMEWORK: [Error] Parsing ___.robot failed: Data source does not exist

I just setup Robot Framework yesterday. I went to youtube to see some videos on how to set up and I found one that was just uploaded last month. I follow all the steps and I numbered it below. ...
1
vote
1answer
6k views

How do I enable ChromeDriver to use browser cache or local storage with selenium python

I was trying to automate a website and it's a PWA. I need the caching data for this site as it takes too long to load, once loaded it's pretty fast. But every time I run my scripts chrome starts a new ...
1
vote
0answers
26 views

Delineating unit tests and integration tests in Testing Library for React and unittest

This question is related to Testing Library for React and unittest for Python. I'd like like to have a single file that contains unit tests and integration tests for a component, and be able to target ...
1
vote
1answer
2k views

Is there a way in PyTest to pass command line arguments to conftest.py directly?

I know that there is a way to pass args in tests itself like it was shown here, but is there a way to pass in conftest.py directly? I want to configure some common stuff for all tests this way.
1
vote
2answers
41 views

Selenium (Python) is having issues finding and interacting with a button that has formmethod="get" in it

I am attempting to click a delete button but Selenium does not locate it even though a save button next to it is completely intractable. The only difference is the delete button has this in the html &...
0
votes
3answers
866 views

Getting error : NoSuchElementException - Unable to locate element with ID attribute

I am running this code: from selenium import webdriver from `selenium.webdriver.firefox.options` import Options Setup: options = Options() options.add_argument("--headless") def get_results(...
1
vote
2answers
91 views

Strange drop down automation problem - multiple select

I've tried for days to figure this one out. I have a selector that I can't figure out. It seems to be a regular select statement with multiple options but when clicking one option directly it ...
2
votes
1answer
94 views

Differentiating between two items with the same class name using selenium

As a learning project, I am trying to use selenium webdriver with python 3 to collect my shopping for the week from sainsburys website. At the moment, the script will loop through a bunch of URLs for ...
1
vote
1answer
661 views

Sometimes Appium clicks on some buttons with a very long delay (on some views)

While testing by appium (using python), it clicks on some buttons with a very long delay on some views in my android app. Method, which I am using: def click_element(self, element, time=wait_time): ...
0
votes
2answers
230 views

Finding sibling of found element using selenium

I've got a field with a date in it that's identified by a code that's shown in the div previous to it. <div class="fcode"> <div class="fcode_n">(123)</div> ...
0
votes
3answers
50 views

how to get span based on the <p> found

How do i find the element Jessica based on 3000 using xpath. I'm getting ...not a valid xpath error. Jessica Total Wealth ($): 3000 <div> <span><b>Jessica</b></...
0
votes
1answer
31 views

How to handle the exact position of runtime creating webelement in selenium python

I've been writing a couple of tests using selenium for my website. However, I've not found a way to test multiselect dropdown with checkboxes that is filled by V-autocomplete(vuetifyjs) component . As ...
1
vote
1answer
47 views

Cant access elements in authentication popup that says ```sign in with google```

Trying selenium for a webpage which only have google authentication. When the Join button is clicked, a popup window comes up which only have a button named sign uo with google. As i am new to ...
2
votes
3answers
45k views

Verifying if an image Is displayed on a webpage

I have read that there is no "sure shot" way of knowing that an image is loaded or displayed on a webpage using Selenium. I want to know the reason behind it, as to why this is completely not possible....
2
votes
1answer
2k views

Selenium Python queston: How to extract the dynamic id generated?

I have a link inside a table with a dynamically changing id, the xpath being: //*[@id="1544727471470-1-uiGrid-0007-cell"]/a/span/span To its left is a checkbox with xpath: //*[@id="1544727471470-1-...
1
vote
1answer
902 views

Selenium Python - Unable to find an element, get stale element exception when using element locator

Scenario: 1.Login to a website using script and navigate to the Home page. 2. On the home page, click a link and navigate to a new page. 3. Then navigate back to the home page using the top navigation ...
0
votes
2answers
652 views

SyntaxError: invalid syntax // SyntaxError: unexpected EOF while parsing

How do I detect text inside of this, this is HTML & this is XPath. I tried HTML <span class="messageText">Hello.</span> XPath //*[@id="liveAgentChatLogText"]/span[22]/span[2] ...
0
votes
1answer
139 views

Python Dryscrape - how to select child element

I'm working on a project with www.NJMLS.com. I'm trying to extract email of agent name "Edward An": import dryscrape as d d.start_xvfb() br = d.Session() br.visit('http://www.njmls.com/members/index....
1
vote
2answers
2k views

To work with two different drop downs which are dependent on each other

I have a scenario in which i am finding bit difficult to automate . The test scenario is : There are two drop down . 1.To select the state. 2.To select the respective cities. So i need to write a ...
0
votes
2answers
327 views

Can't switch control on elements of a chatbot using selenium in python

I am trying to send a message as input to chatbot to check the response but when I am trying to send a message to a chatbot, I need to click on the input box where one can enter a message. But it is ...
0
votes
1answer
4k views

How to save an webpage as a xml file using Python and Selenium?

I want to open an xml webpage and after opening the webpage, I want to save the xml content displayed in the webpage as file1.xml file. What I tried: from selenium import webdriver import os from ...
1
vote
3answers
7k views

Python Selenium Find Button

I have a Website were I want to click a button, but I can't find in the button in the HTML script, what I have to write in my Python script? Later I want to have something like driver....
2
votes
2answers
2k views

New opened window using selenium doesn't appear in the window handles

I need to open a separate window from a link in my main page and leave the main opened. I am using the following code to do so: self.find_element_by_locator(locator="css==a[href='#/vehicles']&...
1
vote
3answers
3k views

Python Selenium unable to login by clicking on Button inside a form

website:https://www.etoro.com/login <button automation-id="login-sts-btn-sign-in" ng-click="loginCtrl.login(loginForm)" class="e-btn-big wide dark pointer">Sign in</button> I am trying ...
0
votes
2answers
2k views

Assert multiple Id's using for loop in selenium and python

I want to assert all ids in the list with for loop, my code is not working: list = ["'block-views-news_of_the_day-block_1'", "'views_slideshow_singleframe_main_carousal_new_block-block_1-2'", ...
-1
votes
1answer
35 views

cannot click on link Python Selenium

I am trying to add a confirmation link on selenium but selenium is not able to click on that link its on yopmail with name janemartin90452 It doesn't click on the confirmation link Name "Activate ...
1
vote
3answers
56 views

Print with specific text selenium & python

I have a program with python & selenium. I will print the program like this : end-bubble bubble ok end-bubble bubble high My goals are like this: ok high My idea is to print without the end-...
8
votes
0answers
406 views

Error: Unable to find window while the window is already displayed in LDTP

I'm using LDTP to write a GUI test case script in python. I'm running the script in a virtual machine by nosetests. And I get a block with the error of unable to find window X, while window X is ...
0
votes
1answer
46 views

selenium select checkboxes between checkboxes : Python

This is the how my HTML looks like: <tr> <td class = 'text-bar'> id </td> <td> <input type="checkbox" size = "20" value= 'Yes' id =...
0
votes
0answers
31 views

How can I use a for loop in this code in python

I want to run my code 10 times in 10 new tabs. Kindly help me on how can I use a for loop and open in 10 different tabs. code; import time from selenium import webdriver from selenium.webdriver....
0
votes
1answer
764 views

To click on an element which contains class and title in selenium python

I want to click on an element which contains class and title in selenium python. A webpage contains certain folders with unique name. I want to click on a folder by specifying its name or title. Below ...

1
2 3 4 5
10