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
1k views

How to run Robotframework test cases in a particular order from different suites?

We have at least ten test suites each having at least 10 test cases. I would like to know if there is a way to run selected tests from each of the suites in an order I would like? For example with ...
1
vote
1answer
69 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
36k 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
1answer
96 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 ...
0
votes
1answer
108 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 ?
0
votes
1answer
71 views

Python Dryscrape - how to select child element

I'm working on a project with www.NJMLS.com. I'm try 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....
0
votes
0answers
24 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
41 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
3answers
428 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
20 views

detect new element in html using selenium, python

is it possible to detect in selenium, that new dynamic element added in html msg_box = driver.find_element_by_class_name('_3u328') msg_box.send_keys('---') button = driver....
0
votes
1answer
41 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
1answer
453 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 ...
0
votes
2answers
47 views

Unable to filter the child elements, using selenium in python

I want to locate all the child element using tag name 'li', and then filter them using id. How to do this. Lets say i have 4 child elements with tag name 'li' and each of them have class. I want to ...
0
votes
1answer
70 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
vote
1answer
69 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
2k views

How to get src link using Selenium?

The task is simple: to extract the link of an audio of pronunciation for a word from a Yahoo Dictionary Webpage: e.g. Yahoo's Dictionary@ "real" Using "Chropath", I can locate the Xpath of the ...
-1
votes
2answers
68 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?
0
votes
1answer
48 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 ...
-1
votes
1answer
20 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
145 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
77 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
24 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
77 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
23 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
27 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
18 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
859 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
4k 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
161 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
39 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
126 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 ...
0
votes
3answers
394 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
53 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
76 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 ...
25
votes
10answers
201k 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
33 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
364 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
80 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')]"): ...
1
vote
1answer
59 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
29k 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
37 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
36 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
494 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
36 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(...
69
votes
6answers
155k 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
438 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
263 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] ...