Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [python]

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

0
votes
0answers
14 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
0answers
9 views

Appium 1.10.0 + iOS : Unable to accept permission alert

Team, I am facing issues to accept the permission on iOS using Appium. I have tried below options: capabilities.SetCapability("autoAcceptAlerts", true); driver.switch_to_alert() driver.findElement(...
0
votes
1answer
46 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
vote
1answer
27 views

Interacting witrh elements in the new link using Selenium(Python)

I am writing a python script for interacting with the spotify webplayer. Initially I have to login by entering the credentials.After I click the log in button,I get directed to the webplayer page. ...
0
votes
0answers
28 views

Running Selenium and Headless Chrome on AWS Lambda using Python

I need to do a Proof of Concept of whether I can run Headless Chrome on AWS or not and I tried to implement the solution from the below link: Running Selenium and Headless Chrome on AWS Lambda ...
1
vote
0answers
31 views

Appium 1.10.0 + Android : Unable to accept permission alert

Team, I am facing issues to accept the permission on Android using Appium. I have tried below options: capabilities.SetCapability("autoAcceptAlerts", true); driver.switch_to_alert() driver....
0
votes
1answer
28 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.cfm?...
0
votes
2answers
52 views

How to handle multiple authentications in Selenium

Lets say for example that I have page A that prompts for HTTP Basic Auth. If correct login credentials are provided, user is redirected to another B site that has another HTTP Auth. How would you ...
1
vote
1answer
24 views

How to download in headless mode with selenium?

I have a test running to download files from a website, the files download okay without the headless argument chrome_options.add_argument('--headless') but as soon as I add this line nothing downloads,...
0
votes
1answer
18 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
vote
0answers
26 views

Attach Existing browser session in SeleniumLibrary RobotFramework

I have an LDAP alert box that pops up as soon as the browser is opened. I am Using Robotframework with the seleniumlibrary for my automation scripts.The issue is that the execution of the script ...
1
vote
1answer
58 views

find_elements_by_xpath issue!

I'm trying to complete the basic python Selenium demo (https://selenium-python.readthedocs.io/getting-started.html) but I'm attempting to do that same procedure on https://www.ncbi.nlm.nih.gov/. ...
1
vote
0answers
31 views

Testing of console tools

From my previous experience, I am used to write tests for either unit testing or integration/deployment testing. Now I am facing the challenge to write automated tests for a console tool using a ...
0
votes
1answer
29 views

xPath (SCRAPY) Python using two attributes together

For example : <html > <body> <a class="abcd" title="he is Gandhi"> he was good </a> <a class="bcde" > he was very good </a> <a class="abcde" title ...
1
vote
2answers
40 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
2answers
37 views

Recommended project structure for Pywinauto project

I'm used to Selenium and the page object pattern. I'm now moving to an automation project for a Windows app, so I'm discovering Pywinauto. I've be looking for good practices and was expecting ...
1
vote
1answer
57 views

Python Selenium - How to get the “Close” text to click on this button error -Unable to locate element

This is the HTML <button type="button" class="d-block p-3 mx-auto btn btn-danger btn-lg xh-highlight"> <i class="fa fa-close mr-1"> </i> Close </button> And I'm trying with: ...
2
votes
1answer
33 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
56 views

How can I prompt for input using Selenium/Webdriver and use the result?

i know this has been asked before but the last time it has been answered was about a year and a half ago main point is i want to from selenium import webdriver from selenium.webdriver.common.keys ...
2
votes
2answers
106 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
vote
1answer
84 views

Python Selenium: Unable to locate element

I'd like to download the primary parcel layer from this website. First step is to click the "Add/Remove Item" button, but I am having trouble locating it. For this button, the Inspect Element window ...
0
votes
1answer
39 views

How to change the pip version in pycharm

In pycharm the pip version is showing as 10.1 but when i check the pip version in my CMD it is showing as 9.0.1. I am not able to understand why it is happening. If any one know the reason can you ...
1
vote
2answers
50 views

How to call rest API using python selenium?

I have a scenario where I need to call a rest API in my python selenium script but I am not sure how to do it. If anyone as idea on it can you please help me out . The API used is to delete the ...
0
votes
2answers
49 views

Selenium: Why find_element_by_partial_link_text finds the first match only?

What I want to do: I want to click all the links where partial text = "105611A5C7B9_Logs_" Example: First Link Text = 105611A5C7B9_Logs_11-15-18-06-04PM.tgz Second Link Text = ...
1
vote
1answer
89 views

How do you automate an OTP using python selenium?

I have a scenario where I need to perform a login, but the problem is its based on OPT (I mean once I enter a phone number to that number I receive an OTP That OTP is the password)
0
votes
1answer
38 views

How does starred expression works when using with find_element() method

def enter_text_textbox(self, locator, text): ele = self.driver.find_element(*locator) try: logging.info("# Entering text in Textbox.") ele.clear() ele.send_keys(text) ...
0
votes
0answers
34 views

Is local storage not persisted when using remote WebDriver?

Initial setup setUpClass creates a remote webdriver instance (because I don't want the overhead of creating a browser session per test) using Chrome, goes to the login page, enters credentials and ...
1
vote
2answers
79 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
vote
1answer
131 views

Is there a way to check the font style , colour , size etc using selenium python

I wanted to know how to write test scripts to test font style, color, size etc using python selenium if anyone of you knows can you please share me the appropriate links. ('i mean study material links'...
0
votes
1answer
135 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
293 views

python selenium - waiting for item to load (stale element reference error)

I am executing a script which clicks through a number of pages to retrieve data. After each click the new page obviously has to load and the time to load varies greatly (mostly 2-3 seconds, sometimes >...
1
vote
1answer
91 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 ...
3
votes
1answer
681 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
127 views

Python expected an intended block error if/else [closed]

Hello im getting in this script an indentationError time.sleep(3) driver.find_element_by_id("mainMenuRoutes").click() time.sleep(1) time.sleep(2) if driver.find_element_by_xpath('//*[@class="m-btn ...
0
votes
3answers
543 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....
0
votes
2answers
84 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
277 views

Selenium XPath Invalid Syntax [duplicate]

element = wait.until(EC.presence_of_element_located((By.XPATH, '//*[@id="liveAgentChatLogText"]//*[contains(string(.), "THE_TEXT_STRING_I_AM_LOOKING_FOR")]') driver.find_element_by_xpath('//*[@id="...
0
votes
1answer
77 views

Running test suite from both terminal using pytest and unittest runner but show only unittest runner results and execute once

i am trying to execute my following test suite: import unittest from Login_Page import LoginPageAndLogout def test_suite(): # get all tests from classes login_test = unittest.TestLoader()....
3
votes
2answers
941 views

Fetch all the links on a page that are within the same class

Quick Links <span class="buttonContainer"><input type="image" class="helpButton" src="/images/buttons/btn_help.gif" alt="View help." title="View help."><input type="image"...
0
votes
1answer
265 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
votes
1answer
50 views

Pop up handling in Selenium using try and except block gives a broad exception warning

try: if browser.find_element_by_xpath('//[@id="s"]/a').is_displayed(): browser.find_element_by_xpath('//*[@id="s"]/a').click() browser.switch_to.default_content() ...
0
votes
1answer
4k views

ElementNotVisibleException: Message: element not visible Selenium in Python

I'm trying to click an options from a website dropdown menu but I am not able to click. I am using "xpath" locators for the element and I upgraded my chrome to the latest version for chromedriver. ...
0
votes
1answer
103 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 ...
2
votes
1answer
54 views

Selecting usernames from a list using selenium

This is the code I have used so far: username = browser.find_element_by_id("field67041336") email = browser.find_element_by_id("field67041337") mobile = browser.find_element_by_id("field67041338") ...
2
votes
1answer
159 views

How to properly mock dependencies

My code is organized as several independent classes. Each dependency is injected by a setter, so in the end I create instances of classes B and C, set their parameters and inject them to class A. Now ...
0
votes
1answer
38 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
1answer
177 views

How to make while loop for example 5 automatic registration account

How to make while loop for example 5 automatic registration account this is my code and I want to make an automatic python script for 5 registration account from selenium import webdriver driver = ...
0
votes
0answers
47 views

selenium element.text() different on two different computers

What would make element.text() give different outputs on two different computers? I wrote a scraper with python and used pyinstaller to make it into a .exe file. I am using the same file on each ...
0
votes
1answer
3k views

How do I use find_elements_by_xpath to only get some elements in python selenium?

How should I use driver.find_elements_by_xpath() to get all the data-row elements that I boxed in the picture. I do not need the other tr tags. In my current code I just check all the tr tags and ...
0
votes
1answer
576 views

Does implicitIwait affect set_page_load_timeout python, selenium, chrome driver

I have a scraper where I have: driver.set_page_load_timeout(30) and driver.implicitly_wait(10) Does implicit wait affect the driver.get() call? I was wondering if my 10 second implicit wait ...