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
vote
1answer
95 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'...
0
votes
1answer
69 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 "...
-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
0answers
53 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 ...
0
votes
1answer
18 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
23 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
25 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 = ...
4
votes
2answers
154 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 ...
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 ...
3
votes
2answers
3k views

How do you press two keys at the same time with Python Selenium?

Trying to do accessibility automation and want to use shift+tab to go back an element. But can't seem to get anything to work. Tried what the doc imply should work based off their "Example, pressing ...
0
votes
1answer
53 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
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 ...
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
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....
0
votes
3answers
377 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(...
2
votes
3answers
32k 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....
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 ...
3
votes
2answers
70 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 ...
24
votes
10answers
195k views

How do I close the browser window at the end of a Selenium test?

I have googled for the answer, but the .stop() so frequently mentioned doesn't work for me. The Chrome window the test was running in remains open. def test_getResults(self): sel = selenium('...
-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
344 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
51 views

Python Selenium code is not able to double click on a webelement when multiple tests are run together but works when tests are run individually

Posting the code snippet for abc in self.driver.find_elements_by_xpath( "//div[@class='ag-body-viewport']//div[starts-with(@class,'ag-row')]"): ...
0
votes
1answer
22 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 ...
2
votes
2answers
28k views

how to proceed after clicking a link to new page in selenium in python

I am clicking a link which takes me to new page, but I don't know how to proceed after that. When I try to find an element by id in the next page it gives me error: selenium.common.exceptions....
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
vote
3answers
1k views

Python selenium grid parallel execution

How do I run parallel selenium scraper in grid? I wanted to crawl 10 urls , and if I start two Firefox nodes, how do I request the nodes to crawl 5 urls in parallel? I have gone through google, but ...
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
2answers
374 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 ...
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(...
68
votes
6answers
151k views

What is the correct way to select an <option> using Selenium's Python WebDriver

I would like to select an <option> child of a <select> using the Python WebDriver. I have a reference to the option WebElement I wish to select and have tried select() and click() methods ...
1
vote
1answer
408 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
242 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] ...
1
vote
2answers
367 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 ...
-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__(...
0
votes
2answers
66 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 ...
2
votes
2answers
347 views

Automated GUI Testing HTML embedded Desktop Application

I have the exact same problem as in this post Automated GUI Testing of MFC/Dynamic HTML embedded Desktop Application This were an old post but maybe there are new solutions available. I have written ...
0
votes
1answer
2k 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 ...
0
votes
1answer
72 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
3answers
2k 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....
3
votes
1answer
128 views

Approaches for testing huge data files in text format

My current assignment requires me to test data in a large number of text files ~ 200, usually ranging between 1GB to 20GB. The data is in same schema with coordinates. As of now the approach is to ...
3
votes
5answers
6k views

Which language to choose for Appium - Python or Java?

We have an iOS application (written with Obj-C and now starting to incorporate Swift) that we want to write tests for using Appium. Our test team comprises of people who have little programming ...
0
votes
1answer
28 views

How can my mac be setup to run both appium/selenium with java and python without conflict?

How can my mac be setup to run both Appium/Selenium with java and python without conflict? Are there steps I should take and things I should avoid? What things should I look out for? My mac is setup ...
0
votes
1answer
1k views

Call Python class in JMeter

How can I call python class in JMeter to test the performance of the python code as we do in java by importing jar file and write a script in BeanShell?
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
49 views

Unit testing for chains of generators in Python

I want to write unit tests for methods that take a generator as input and produce a generator. I am building on this answer. For this question let's take the method: def candidates_for_deletion(self,...
0
votes
2answers
3k views

Can't find any element using CSS selector with Selenium on Python

I'm running a script on vodafone.co.uk but I can't find any element using the CSS Selector. browser.get("http://freesim.vodafone.co.uk/") browser.find_element_by_css_selector("#frmNew > div:nth-...
0
votes
1answer
277 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 ...