The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
-1
votes
1answer
14 views

Getting key and respective value in ng-repeat using Selenium and Python

Being new to Selenium, I have been trying to figure how to extract the value corresponding to the key under the ng-repeat, in my case, the key is 'status'. The partial page is as follow: <div ng-...
-1
votes
1answer
16 views

selecting date using selenium and python

I am automating the MakeMyTrip application for selecting a respective departure date. suppose I want to select 20 January 2020 how do I select driver.find_element_by_id("departure").click() ...
0
votes
1answer
19 views

how to fetch the list of values from radio button?

I am working on selenium and python. I am unable to select the radio button. I want to add the values in a list. and iterate and click on the specific radio button. def test_search_in_python_org(...
-1
votes
2answers
25 views

How to select from address using selenium and python?

I am automating make my trip app for practicing. I am working on selenium and python I am unable to enter from the address and select the autocomplete list. here is the code import unittest from ...
0
votes
0answers
16 views

Selecting from Dduble drop-down menu with slenium python

I am new to python and I am trying to select from a "cascading" drop-down menu. first, you select the state in the website, and then it gives you a list of municipalities to choose from. Each state ...
-1
votes
1answer
26 views

Python Selenium - How to give 100 comma separated list values to selenium send keys?

sheet1 = client.open_by_url("https://docs.googlesheet")-- using google sheet here sh = sheet1.worksheet("Sheet1") dera = gd.get_as_dataframe(sh1,evaluate_formulas = True,skiprows = 0,has_header = ...
0
votes
0answers
64 views

Problem with parallel testing (POM, python, selenium, pytest)

I have a dir named PageObjects, there is a file Login.py. It stocks all the locators of elements plus functions that I call in test cases. It looks like this: class Login: # Locators of all ...
-1
votes
1answer
36 views

How to convert string returning from get text() to tuple? [closed]

My tests are comparing two values to make sure value getting from locator should not be less or equal to expected value. Expected value returning from element.getText method is (0.00, 0.00) and ...
3
votes
2answers
71 views

How to add assertion for blank value?

Scenario: On clicking reset button value should disappear and the field that holds the value should reset to blank. Approach: My approach is to get text or innerHtml from id =mapPropertyHighlighted ...
0
votes
1answer
24 views

How to select a value from dropdown developed using div tag using Selenium and Python?

Like in selenium java we are using ACTION class method or SELECT method to select value from drop down. Is there any method in Python?
1
vote
1answer
58 views

Problem with dropdown (Selenium + Python)

URL = https://www.sephora.com/search?keyword=shaving At the bottom of the page, I'm trying to change from "View 60" to "View All". The problem is that test case passed successfully, but the browser ...
0
votes
0answers
33 views

How do I deal with a Gmail CAPTCHA during automation? [duplicate]

My test suite involves me logging into a website with 4 specified social logins: - MS Live - Facebook - LinkedIn - Google Now the problem is that many of these social logins sometimes give me a ...
-1
votes
2answers
29 views

How can I create a function of login test case in selenium web driver- python & how I can call it in other test case?

How I can create a function of the login test case in selenium web driver- python and how I can call it in other test cases? basically I want to call my login test case in other test cases.
0
votes
1answer
52 views

Selenium not allowing to choose from dynamic drop down list values

I'm using Firefox and Selenium with Python 3.7. What I'm try to do is: from the Yahoo Finance page search for IBM in the search box and go to that page and select "chart." This brings up the chart ...
0
votes
0answers
35 views

Selenium - Question about how to traverse and select/copy specific texts

In this example, I would like to find all span class of "server-error". I think I am able to do that and store in an array. But here is where it gets tricky for me... Is there a way of appending the ...
1
vote
0answers
35 views

Issue with switching to the new window in Selenium + Python (chromedriver)

I'm having an issue when I try to switch the new opened window. Every time I execute a test case, my chromedriver opens with a window named "data:,". My code: def test_case(self): reg = Register(...
0
votes
1answer
54 views

How to Allow notification permission for desktop-notifications in Chrome Browser using python scripting

Hi i have been trying to automate a page using Selenium Python. And in one of the page it requires the user to grant permission for mic & cam. I have written the code for the same using the ...
1
vote
1answer
48 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....
4
votes
2answers
165 views

Using Python Selenium Not able to perform click operation

I am automating for the following page on CHROME Browser https://study.yupl.us/studies/5d5a64aa8b5bb92fb776753b?auth=false Here I'm able to identify the unique element from the console for the XPATH ...
-1
votes
1answer
33 views

Turning off captcha in selenium [duplicate]

i want to get rid of filling a query form on daily basis and want to automate it. But it is having captcha and i want to turn off captcha so that i can automate form using selenium webdriver using ...
-1
votes
1answer
14 views

The navigator does not take the url that I indicate to him using Selenium on Python

everyone. First, excuse me for my bad English. I will try to go a specific URL but just the browser its open. This is my code 1 file: from selenium import webdriver class Objects: def __init__(...
1
vote
1answer
98 views

I need my selenium webdriver to wait a bit more, but don't want to add an explicit wait

I'm trying to send keys to an input box that is displayed within a dialog. The problem is that sometimes I get only the last few letters of my text, because the send_keys is sending them too fast. I'...
1
vote
0answers
32 views

Issue with parallel testing in pytest

So I have two test cases in a map. From command prompt I type "pytest -n 2" then hit Enter. Instead of opening two browsers and execute them in parallel, pytest is opening 4 browsers, but only two of ...
0
votes
1answer
29 views

See Test Steps in Python when using selenium

I'm converting some manual tests to Python and using Selenium to test them. Currently the manual steps are written like to: Requirement 1 - Can add new person, if none exists Step 1 - Search for ...
0
votes
2answers
83 views

Robotframework installation - keyword not found error

I have set up robotframework on my machine and I have installed all necessary plugin and using Pycharm as IDE. But I am getting keyword not found error and also SeleniumLibrary library which I have ...
-1
votes
1answer
44 views

Problem with checking if prices are between two values (Selenium + Python)

URL = http://practice.automationtesting.in/shop/ I need to check if the prices of the books are between two values. I tried to find all the prices: prices = driver.find_elements_by_xpath("//*[@class='...
1
vote
1answer
45 views

Can't select price range (Selenium + Python)

I have a small test case: Open the browser Enter the URL “http://practice.automationtesting.in/shop/” Adjust the filter by price between 150 to 450. I tried to use ActionChains, but no result. ...
1
vote
1answer
168 views

Check if password field displays masked characters (Selenium + Python)

I'm new to automation testing, so I have a question regarding the code that I used to execute a simple test case: "Check if password is masked". 1. Open the browser; 2. Enter the URL “http://practice....
0
votes
1answer
72 views

How correct I executed the test case?

I'm new to Automation Testing. So I have a simple test case - "Login with incorrect username and password". Steps: Open the browser Enter the URL “http://practice.automationtesting.in/” Click on "...
0
votes
3answers
122 views

How should I fail a test when an if condition becomes false

I want a test to fail when the if condition below becomes false. last_url = self.browser.current_url if 'https://***/news/' in last_url: print("test passed") else: #Test should fail if it ...
0
votes
1answer
38 views

How to write test that have same code in the beginning?

I am writing test automation for the application that have following features Login Create News Create Event In Create News and Create Event I have to repeat login code. Is there a way to use login ...
0
votes
1answer
46 views

how to use assert in selenium python to check my page load time is less than 5 sec?

start2 = datetime.datetime.now() button8 = driver.find_element_by_xpath("//span[contains(text(),'Last Month')]").click() timeout = time.time() + 60 * 2 while len(driver.find_elements_by_css_selector(...
1
vote
2answers
36 views

Can not choose button with the same name (Windows)

The problem I have two buttons with the same name in Windows program. So I do: "self.driver.find_element_by_name("button name").click()" - it selects the first one, but I need the second one. I ...
-1
votes
1answer
75 views

In Selenium using Python facing error unable to locate element

from selenium import webdriver from selenium.webdriver.common.keys import Keys # create a new Firefox session driver = webdriver.Firefox() driver.implicitly_wait(30) driver.maximize_window() # ...
0
votes
0answers
37 views

Open a clickable link on a web page and take the screenshot at the same time

I'm new to chrome headless and I have a problem. I want to randomly select two links from a web page on the page being viewed and open them at the same time. Indeed my goal is to be able to have the ...
-1
votes
1answer
32 views

Testing Question in Selenium Python

How to get required item hrefs in a flipkart page? This is my code: from selenium import webdriver driver = webdriver.Firefox(executable_path ="/home/yegaiah/Desktop/geckodriver") website_URL ="...
0
votes
3answers
78 views

How to identify the web-element for a Text Box using Selenium

I am attempting to locate the empty textbox by the input id 'Department_input' <input id="Department_input" type="text" aria-required="true" size="40" class="field_input ui-widget-content" ...
0
votes
1answer
206 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
1answer
144 views

Need help sending text to field

Using Python and Selenium, how can I send text to an element that is 'hidden?' When trying to do it, I am getting errors that the element is obstructed by another element. The field I am trying to ...
1
vote
2answers
50 views

Are there any good links and references for learning how to create an Appium Python Framework?

Are there any good links and references for learning how to create an Appium Python Framework? There seem to be a lot of Java information out there, but Python seem to have a lot less available ...
0
votes
1answer
73 views

How can I improve this python pytest excel data handling code? Does pytest have something like TestNG dataprovider?

Does Python Pytest have anything similiar to Java TestNG DataProvider where you can pass in a set of data for the tests? I created something to take the data from my excel list using openpyxl and it ...
1
vote
1answer
231 views

Selenium can't click href

I want to click on a href(all of the delete ones), but can't <a href="#delete"><img height="16px" width="16px" src="/images/icons/trash_16.gif"></a> I've tired (both delete and #...
0
votes
3answers
245 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-...
1
vote
1answer
219 views

Selenium | Locate elements via custom attribute

I'm new to test automation with Selenium (Python) and just wondering if it makes sense to locate elements on webpages via a custom attribute? In some places the IDs of the elements are generated and ...
0
votes
1answer
36 views

Adding Chrome extension in Selenium / Python / Ubuntu

I am having problems in adding extensions in Chrome before Selenium tests, using Python. On the code side, it's pretty simple: options = Options() options.add_extension(/path/to/extension) webdriver....
1
vote
2answers
52 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 ...
0
votes
0answers
12 views

Jython or Groovy script: Check if a cookie has already been closed

Currently I have the following problem. I use a test framework (QfS) which offers the possibility to execute scripts via Groovy or Jython. Description: I've automated the history that I can close ...
0
votes
0answers
276 views

could not be scrolled into view - loop over options of menu

I have a page in which you click on date first, then region and finally province and get a link to download a file. I am trying to create a loop that goes throuth all the dates, regions and provinces, ...
0
votes
0answers
49 views

Why can Selenium not find an element in a page via XPATH when I can by pasting it and all other XPATHS work?

I would share the link here but I'm under NDA and requires login. The site does use "ant" and some other dynamic things but that doesn't cause any other issues. I've roughly 50 xpaths used for various ...
-1
votes
1answer
69 views

Mac + PyCharm + Python 2.7: ImportError: No module named appium

I just changed PyCharm application from Professional to community and in my v first run I am getting below error. Prior this all tests was working correctly as expected: ImportError while importing ...