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
7
votes
2answers
5k views

Send keys to no element in particular

The way I know of sending keys using the WebDriver Python bindings is as follows: element.send_keys(value) How can I send a key (specifically the Escape key) to no element in particular, just to the ...
0
votes
2answers
71 views

How to open two separate tabs in same google chrome window using webdriver and python? [duplicate]

I need to test interacting with two tabs in Chrome. I've written a test in Python using Webdriver where I open Chrome with one tab. I need to open a second tab (similarly to using Ctrl+t) so I can ...
-4
votes
1answer
46 views

Can Python be used in automation [closed]

I currently do a lot of manual testing of a webpage performing a lot of regression on Telerik. I was wondering if Python can be used as an alternative. I don't mind doing the courses but would be ...
0
votes
0answers
23 views

Failing to update a date using python and selenium

I am trying to change a date one day forward on a calendar date picker using python and selenium. <td colspan="2" class="textBlack">&nbsp;Due:&nbsp; ...
0
votes
2answers
29 views

Search by xpath and text where text is a string contained within a list

I'm struggling to find a way to search a page by xpath that contains text that I've defined within a list using selenium. If I replace Role_List[y] by "WK" etc., it works fine and I can repeat it 4 ...
3
votes
3answers
80 views

Google Chrome browser and driver versioning

I have a CI pipeline that runs my E2E tests, which the agent is prepared by: Install Google Chrome by brew (latest) Chromedriver is installed by chromedriver_binary python package (fixed version) ...
8
votes
0answers
362 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
281 views

Cannot locate element during the second iteration in the loop selenium python

The goal is to add each product to the cart one by one. I have an error on the second iteration. selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable ...
1
vote
0answers
34 views

Could I improve my code by opening multiple tabs?

I'm trying to scrape information from an array of links using selenium. Each of them take ~2 seconds to scrape, and it adds up to quite a while. Is it possible / worth trying to open the links in ...
0
votes
1answer
57 views

No Such Element (Selenium) [duplicate]

I have checked far and wide for a fix for this. But to no avail. Nothing seems to work. I am trying to locate a Username and Password box to enter in the information. But it comes up with the error ...
4
votes
1answer
17k views

How to retrieve INT value from TEXT box using Selenium/Webdriver Python binding?

I have this code: tcost = driver.find_element_by_id("MainContent_txtTotalCost").text total = int(tcost) driver.find_element_by_id("MainContent_txtVisa").send_keys(total/2) driver.find_element_by_id("...
3
votes
1answer
106 views

python code for asking microphone permission in Chrome and other Browser?

I am developing an application where I need microphone access. So, anyone can tell me the python code for asking microphone permission in Chrome or any other Browser.
1
vote
1answer
205 views

When i send string with send_keys() its taking substring in chrome driver (selenium python)

Hi all i'am facing problem with selenium (i'am using python) for chrome driver, when i send some string with .sendkeys( ) some time its taking first two characters and some time its taking first ...
3
votes
1answer
4k views

Can't drag and drop from source to target using selenium and python

I am trying to drag and drop using Python and Selenium. I have two containers with rows which indicate file names and by drag and drop, I want to transfer one file from the first container to the ...
0
votes
2answers
52 views

“chrome.window.onRemoved.addListener()” does not executes when webdriver.quit() is executed in Selenium with Python

I want to perform logic on chrome.window.onRemoved.addListener(), it works exactly in chrome browser development environment and in selenium when performed with browser UI of selenium test, but when I ...
12
votes
7answers
86k views

Quicker way to assert that an element does not exist

The goal of my test is to assert that a popup does not appear after certain actions. Previously to test if the popup exist, i have used exception handling. try: self.driver.find_element_by_id("...
3
votes
2answers
155 views

Struggling with Selenium in python 'is not clickable at point (x, y)' exceptions during testing

There is a website I'm testing on that puts up a gray loading div when the site is processing. The problem is that the div is there immediately at the website load and the only way you can tell it's ...
3
votes
1answer
62 views

Make an if/then statement utilizing a non present element

I'm using Python and I came across one problem. I'm trying to make a bot using selenium, and it's coming along nicely but I'm trying to use a non-present element to activate a function and I just can'...
0
votes
1answer
546 views

Multi-factor authentication - Selenium automation

My company uses Multi-factor authentication to restrict access to some sites. Is it possible to copy user profile from firefox and use it in my new window?
1
vote
1answer
32 views

How to jump between two different elements located same level?

In the google chrome inspector console enter the xpath: $x("/html/body/div/div/footer/md-toolbar/div/div[2]/img[2]/../../../../../../..//*[@id='input_15']") the console returns the element, ...
-1
votes
2answers
179 views

How to add elements in list from a dropdown using Selenium/Python

I want to add all the city names in a list, so that I can compare then in assert is not in unit test.
1
vote
0answers
72 views

Sort rows in a dragable table by order selenium python

I have a html Link to html http://threedonthemap.s3-website.ap-south-1.amazonaws.com/ <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name=...
1
vote
5answers
3k views

How to log out in facebook using python selenium?

I want to know how to log out in facebook using python selenium. here's my code: from selenium import webdriver from selenium.webdriver.common.keys import Keys import time #from selenium folder ...
1
vote
1answer
3k 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?
0
votes
2answers
940 views

Python stops after opening webdriver

from selenium import webdriver driver = webdriver.Chrome("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe") driver.get("https://www.google.com/") Hello, I am new to selenium and i have ...
0
votes
1answer
51 views

Trying to use xpath in order to select a text on desktop web browser [duplicate]

This is the error I am getting below: selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="select-input-...
1
vote
1answer
144 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(...
6
votes
4answers
46k views

How to make a selection from a dropdown using Selenium/Python

I've been trying to make a selection from a drop down but cannot seem to figure out how. Here's what I'm trying to get: <div id="quote-status" class="panel panel-default"> <div class="...
0
votes
0answers
38 views

How do I click buttons on App which is installed on machine but not a Windows application. It opens a chrome instance (not default Chrome browser)

How do I navigate and click buttons on an already open Chrome instance/window. So the scenario is, that an application named "ApplicationNAME" is installed on my Windows machine, but its not a Windows ...
0
votes
1answer
172 views

How to read Text in a Tradingview Alert with Python and Selenium

After a very useful help here to login on trading view, i cannot figure out how to access to the text of this following alert and close it selecting OK here is the html code corresponding to that pop ...
0
votes
1answer
151 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 ...
-1
votes
2answers
295 views

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

In Selenium Java we are using ACTION class method or SELECT method to select value from drop down. Is there a similar method in Python?
-1
votes
1answer
192 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
vote
1answer
1k 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
85 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
90 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
101 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
35 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
42 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
24 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 ...
4
votes
2answers
9k 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 ...
3
votes
2answers
10k 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 ...
-1
votes
1answer
48 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 ...
2
votes
3answers
37k 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....
3
votes
2answers
95 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 ...
27
votes
10answers
238k 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
107 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.
1
vote
1answer
62 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
45 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 ...
0
votes
0answers
38 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 2
3
4 5
9