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

New browser window every new iteration

I need to open every new iteration, new browser windows. For example: class GoogleTest(unittest.TestCase): @classmethod def setUpClass(cls): cls.browser = browser_incognito....
2
votes
1answer
969 views

Obtaining a Dropdown list items and their dynamic ID using Python 3.x and Selenium

i have a simple problem i am trying to automate the testing of a website that has a lot of dropdown lists that are populated dynamically. I wish to be able to obtain all of the ID's (They populate ...
2
votes
1answer
6k views

Find an element in Python with Selenium which appears by hovering it

I'm trying to write a script to test an option of a website, this option enables users to edit their own message and so it's represented by a pencil icon which has the xpath: "//*@id='content']/div[...
2
votes
2answers
3k views

How to access a web page INPUT element using selenium python

Below is my website content <input type="text" title="Query for bugs (&quot;Go box&quot;) [Alt-K]" name="Go" id="GoText" size="23" onkeypress="GoBoxKeypress(event)" onblur="...
2
votes
3answers
687 views

webdriver.support.select - Select doesn't interact with the element

I have the following select: <div class="col-xs-12 col-md-6"> <label class="ph_label pointer city"> <span class="l citylbl">City</span> <select class="cities custom-...
2
votes
1answer
9k views

How to use Python/Webdriver to go through multiple URLs and take screenshots using loops? [closed]

I want to use Python/Webdriver to run through many client websites (and subpages within those websites) and take screenshots of each page. Currently, I have this working, but all clients are in their ...
2
votes
1answer
2k views

How do I create a loop within my selenium python script to select every option within a dropdown menu

Im new to python, or coding for that matter... Currently I have a python script to select one option within the dropdown menu, but I would like my script to repeat each time and select the next option....
2
votes
1answer
2k views

How to assert values on a page opened by a link on another page?

A link on page 1 opens a new page "receipt page". It contains only text values. I need to assert or verify values on the receipt page to ensure that this is the correct receipt. After executing the ...
2
votes
1answer
35 views

Unable to locate button in Selenium using Python

I have this HTML code: <button> class="btn btn-lg btn-primary btn-block" type="submit">Autentificare</button> input type="hidden" name="next" value="/"/ Using below locator I'm not ...
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 ...
2
votes
1answer
309 views

feature file in behave(BDD) throws an error

I have create a feature file and step definition file, to execute by test cases using behave (BDD ), but i am facing one error, when i execute the feature file, Please find below to check by code :- ...
2
votes
0answers
712 views

New opened window using selenium doesn't appear in the window handles

I need to open a separate window from a link in my main page and leave the main opened. I am using the following code to do so: self.find_element_by_locator(locator="css==a[href='#/vehicles']")....
2
votes
3answers
214 views

Install chromedriver via package instead of executable

Currently I am working on a selenium webdriver project using python. My tests run only in chrome (when the executable file is present in the project). Is there an updated alternative to install the ...
2
votes
2answers
8k views

Mocking HTTP reponses in Selenium Web Driver using Python

I am currently experimenting with the Python version of Selenium Web Driver. Using the driver has been straight forward so far but I have been struggling recently with the issue of mocking HTTP ...
2
votes
0answers
481 views

Tagging python tests for selective execution [closed]

What I am trying to do is : create a tagging system for around 400 tests so I can run them selectively. For example, some tags may be UI_elements, production, staging etc. When a developer makes a ...
2
votes
1answer
2k views

How to start all tests with a clear session after browser crash,

Im using WebDriver and Python to automate a website. I have a suite of tests and sometimes running into the following problem. Test no.1 = Login to home page, navigate to Account page, perform some ...
1
vote
3answers
221 views

What makes Python a good tool in daily testing?

I have seen people commenting that Python is a very handy language in everyday's testing. I wonder what makes it such a good tool, or what testing tasks are easier to achieve with Python than with ...
1
vote
2answers
13k views

Wait until in Select element using selenium

In my test, I need to wait for text until it will be loaded. I have a list of countries and cities. After I choice country I must wait until cities will be loaded. How I can wait without time.sleep()...
1
vote
4answers
78 views

Question about find_by_elements

When you use find_by_elementsit returns a list of all the elements which correspond to an selector, xpath, class, id , etc... However I wanted to know if it's possible to extract an element of this ...
1
vote
4answers
3k views

What to do if Relative Xpath is keep on changing [duplicate]

Below are my xpaths and keep on chining, Element path <div class="dijitInline utilizationTitle">5.00%</div> Here need to capture values (5.00%).... Element Xpath //*[@id="...
1
vote
1answer
3k views

CSS Selector using ':contains' fails with `invalid element state: Failed to execute 'querySelector' on 'Document: is not a valid selector'`

I'm new to Selenium. I'm using it with Python. I'm trying to use a CSS Selector with :contains but failed so far. On Chrome, the selector is rejected with 'a:contains("mail")' is not a valid selector ...
1
vote
2answers
817 views

Selenium Webdriver Mobile with Python - AndroidWebdriver4Python installation question

I found this Android webdriver API on github. I already have the Selenium Python client and have written many plain web-based test scripts with it. I have tried asking the git owner, but he has not ...
1
vote
1answer
162 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....
1
vote
2answers
177 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
2answers
567 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 ...
1
vote
1answer
3k views

How do I remove unnecessary console message pop up using selenium with Python?

When I used Chromedriver with selenium in python, I get a lot of console messages that are not useful to me and that don't affect my scraper. How do I not output these? I do not have this issue when I ...
1
vote
3answers
15k views

How to find the last element in a list of the same images on a website using python and selenium?

How do i find the last element in dynamic list with images that all have the same id is there a function that i can use like driver.find_element_by_id('editwebsite').last() in python, I want to ...
1
vote
1answer
124 views

Which conditions have to cover in White box testing?

During white box testing which conditions have to be tested? Consider a post request with integer data. In the function, I will convert that post data (string type) to an integer type. I am using ...
1
vote
1answer
497 views

Unresolved attribute reference 'is_selected'

Bit of a newbie so apologies if I'm missing something obvious. Im trying to loop through some checkboxes to ascertain if they are selected or not and I am getting an unresolved attribute reference ...
1
vote
2answers
52 views

Better approach to a complex test and report file downloads using python

I've created a very complex script using Python3 and YAML (I keep all the configurations in YAML) that in effect tests all potential file downloads for my environment. Sort of end to end test. Due to ...
1
vote
1answer
17k views

how can i switch to the new instance of browser in python selenium webdriver [duplicate]

I am using selenium webdriver with python. I am not able to find a way in python by which I can switch the webdriver to a new browser. My web application have multiple links and buttons Clicking on ...
1
vote
1answer
1k views

Setting up Page Objects with python and seem to be getting every error possible

Project structure: WebTeam __init__.py BasePage.py UIMap.py Pages: __init__.py Common.py ContactPage.py test: __init__.py CompetitorsTest.py CreateAnonData.py ...
1
vote
3answers
6k views

Selecting an item of a drop-down menu with Splinter lib (Python)

I am looking for a way to select an item in a drop-down menu in python with Splinter (very similar to selenium I guess) : <li class="option1" rel="1158"> Option 1</li> <li class="...
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'...
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
47 views

Problems with login

I have this code: Enter Username or Email elem = driver.find_element_by_id("id_username") elem.send_keys(user) Enter Password elem = driver.find_element_by_id("id_password") elem.send_keys(pwd) ...
1
vote
1answer
346 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: ...
1
vote
1answer
39 views

How do I put validations or assertions in choosing the particular file format?

I am using Robot Framework with Python and Selenium. I need to verify that files have the correct format: specifically that they are image files (e.g.: .jpg, .jpeg, etc). How do I use validations or ...
1
vote
1answer
3k views

How can I access the http headers using python and selenium?

I have a complex javascript-intensive application I wish for which I wish to use python and selenium for automated testing. However, at the same time I need to have access to the http headers for ...
1
vote
2answers
725 views

How should I handle tests failing prior to a logout and causing other tests to fail?

I have tests which require user to login For such tests I register new user Such tests also have user_logout function (right before assert) The problem: If tests fails somewhere prior to calling ...
1
vote
1answer
560 views

Selenium Webdriver | Python (Tumblr) : Cannot access element ID after posting

I'm trying to create a test case for Tumblr (currently in the process of learning automation) and I'm stuck on trying to access the drafts page. So here's what's happening - after I post an image as ...
1
vote
2answers
3k views

Python Selenium, Drop Down

I can't get Python to select "Buy" from the drop down menu: <a href="" role="button" aria-pressed="false" class="td-wb-dropdown__item-content" data-ng-click="tdWbDropdownItemController.select()" ...
1
vote
1answer
2k views

Selenium Python Action Move to doesn't work on hover element

Hi I need to click hover element in Selenium Python. I tried to use action chains and then move to element but it didn't work for me. My Selenium code Snippet: element1= self.driver....
1
vote
1answer
522 views

Can you create a Page Object Model framework inside of TestComplete?

I have some experience with using Selenium and Python to set up testing frameworks for web applications using the Page Object pattern. However, my current employer wishes to keep all of our tests ...
1
vote
2answers
14k views

ROBOT FRAMEWORK: [Error] Parsing ___.robot failed: Data source does not exist

I just setup Robot Framework yesterday. I went to youtube to see some videos on how to set up and I found one that was just uploaded last month. I follow all the steps and I numbered it below. ...
1
vote
1answer
80 views

How should I organise my test-pack to allow me to share an stb-tester ONE between multiple projects?

I'm using the stb-tester ONE to test my set-top box. The Python test-cases are stored in a git repo on the device. I'm about to start a new project and I'm wondering how I can segregate the test ...
1
vote
1answer
130 views

How can I get test-results from an stb-tester ONE in CSV format

I'm implementing an automated testing system the stb-tester ONE. I've been able to run tests automatically using the REST API and now I'm implementing the Test Reporting module. I want to be able to ...
1
vote
1answer
729 views

Selenium - Why driver.quit doesn't work in the following case?

I'm writting some scripts on Selenium combined with Saucelab. However I have an issue. I do a test condition to know if I have an element or not on my page, if there is not this element I want to stop ...
1
vote
2answers
977 views

Selenium send_keys on chromium confused by forward slashes

I am using selenium webdriver under python on a Debian jessie machine. The browser I am currently testing is Chrome (version 55) with chromedriver (version 2.27). If I send the string 1/2/3 to a ...
1
vote
2answers
266 views

What is the best way of separating tests from keywords using RobotFramework?

Our team wants to migrate the tests from QTP. We have the automation flows for UI, API and some database tests. After a long research, I found robotframework would be a nice tool.However as I started ...