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
3answers
499 views

My understanding are correct or not in page object pattern

In my previous project, I worked in selenium with java. In that project I following page object pattern. This is my sample code of selenium with java: # Create Page Objects public class HomePage { ...
2
votes
1answer
913 views

Expecting a popup upon closing the browser

I am expecting a pop-up upon closing the browser. For example, when you are shopping and you have items in cart and in the middle of the checkout process, you wanted to close the tab/browser, at that ...
7
votes
3answers
31k views

How to click a link / button implemented as a div or span element with WebDriver

in my testing I need to click on a 'link' or a 'button' (actually it just looks like and functions as a link or a button) that is implemented as a div (or span) element. With Selenium IDE, I tried ...
4
votes
3answers
14k views

Python or Java for Loading and Performance testing

I'm looking to choose the best tool to perform Load and Performance testing on my web based application. The content of the application is based on Jasper reports and I want to see the behavior of the ...
2
votes
1answer
105 views

Looping over the array of other function in current function

I need a help to know how can I can iterate a loop over a array which is in another function of the same class. I tried using the following similar code for automation in selenium and I get the ...
1
vote
0answers
352 views

Is there a way to enter automate entering credentials in the IWA and SAML popup using only python and selenium

I am trying to create an automation script for a website that supports both IWA and SAML authentication. In case of IWA, whenever I hit the URL using the selenium driver, I get a Authentication ...
1
vote
1answer
2k 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
1answer
4k views

Button not clickable with Selenium

I'm having a problem with a Cancel button which can be clicked manually, but fails when I try to get Selenium to click on it. The button is being identified, but when I assert if the button is ...
0
votes
2answers
602 views

No redirection after clicking on <div>

I am trying to automate clicking on a button of a webpage where the source code has the following structure: <div id="ctl02_" class="sel"> <div id="Lo" class="cont"> <...
0
votes
2answers
3k views

Selecting multiple options and deselecting options using Selenium with python

I am trying to open a webpage and select options before submitting the form. The issue I am having is being able to selecting more than one option in the select box. Eventually I want to be able to ...
2
votes
1answer
908 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
3answers
836 views

Robotframework & Selenium2Library & Python - User sign up test problem (emaill address +n generation)

I am beginner in writing automated tests with robotframework(Python and Selenium2Libraries) and I've faced to the issue related to user registration flow. Challenge is: The application under test ...
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
4answers
71 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 ...
0
votes
1answer
465 views

Selenium python test hung up on url in cronjob

My automated tests get hung up on the .get(url) command randomly. I run several test suites everyday against 60+ different urls (each suite) and a handful will fail to get the url after initializing ...
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
2answers
3k views

Validation of a Success or Error Message in Python, using Selenium

Hi I have created a script to validate for the success or error message after filling the form, but it is throwing an assertion error for everything. Please help me out in fixing this error, Here is ...
8
votes
0answers
310 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 block with the error of unable to find window X ,while window X is ...
1
vote
1answer
464 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
1answer
3k views

Iterate Clicking via nested loops? - Python and Selenium

Just a heads up, this is my first post on here so if I violate any of the posting rules please let me know! Currently, I am attempting to : Find WebElements(Hyperlinks) in a Dashboard Table to ...
8
votes
3answers
2k views

How install both Python32 and Python33 on OS X for testing with tox?

I'm adding Python 3.x support to my open-source project and want to add both Py32 and Py33 test environments to my tox.ini. I already have Py26 and Py27 tox environments that work fine and I just ...
1
vote
3answers
3k views

ElementNotVisibleException when selecting dropdown option

I can't make Select() method working in selenium. I have this code: <select class="print-select menuo selectBox" name="data[gimimo-m]" style="display: none;"> <option class="dis-option" ...
0
votes
1answer
11k views

Understanding how to handle auto-complete using Selenium and Python

While testing for a certain web application, I was faced with an issue of handling auto-complete scenarios. An example of this kind could be found here MagicBricks I have few questions related to how ...
3
votes
2answers
135 views

A testing tool that determines whether a section of HTML matches a certain style?

This may be a long shot, but suppose I have a requirement that a given section of a web page be bolded. That could be done with <b> or <strong> tags, or even a heading tag assuming that ...
1
vote
2answers
109 views

A logical “or” inside a Selenium test case

Assuming I would like test for a default Apache server response at one point, and I would like to make it platform agnostic. For CentOS I have: def test_web_interface(self): self.driver.get(...
1
vote
2answers
894 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 ...
2
votes
1answer
56 views

Why do I see lower latencies when using stb-tester than with a camera and a TV?

I'm using stb-tester to measure the latency of my set-top box UI. The test script looks like: def test_measure_latency(): stbt.press("KEY_MENU") start = time.time() m = wait_for_match("...
1
vote
1answer
120 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
74 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 ...
2
votes
3answers
673 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-...
0
votes
2answers
1k views

Building test cases to check text strings in multiple languages in Webdriver / Python

My group usually doesn't handle web testing, but for this project some of it falls on me and I'm working out automation as I go. The site isn't public, or I'd just provide it for reference. Using ...
2
votes
1answer
385 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....
67
votes
5answers
145k 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
2answers
243 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 ...
2
votes
2answers
8k views

Getting correct locator for an angular page element

I am trying to get the Xpath of a label text in a web page that I am trying to automate. The application is angular based, so there are a lot of angular related stuff on the page. However, I am ...
2
votes
1answer
25k 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....
1
vote
1answer
258 views

selecting from drop down list using selenium3.0.2 and python3.5.1

This is my first question in OS and I would describe it in details with my best effort. Selenium3.0.2 firefox 45.6.0 geckodriver 0.13.0 python 3.5.1 (with Anaconda 2.4.1 (64bit)) What I want to ...
4
votes
3answers
459 views

How to perform static code analysis?

I am working as QA.I want to test the static code analysis of my project. How to get start this ? Can you suggest a good tool to perform static code analysis ? My project is running in php, python, ...
2
votes
5answers
7k views

Select a certain item by clicking a link beside that item

I have a popup with list of names. I need to choose "mahmoud" for instance by clicking the "select" link beside the label "mahmoud". How to click that select? I am using selenium webdriver with python....
10
votes
1answer
33k views

Set attribute of an element using webdriver + python

I am trying to automate uploading an image. The uploader is a Flash object and using AutoIt is not an option. So I am trying to work my way around this with just webdriver. The idea is to 'set' the ...
0
votes
1answer
536 views

CSS/XPATH selector management using python's dictionary

I have a lot of functional tests in Python. As expected , they use a wide variety of css/xpath selectors . I think I read somewhere that a practice is to have a dictionary where each selector would ...
2
votes
2answers
735 views

Do I need the PageObjects design pattern or not?

Right now I have a Selenium WebDriver framework that looks like this (vastly simplified): \app_func.py -- app_func has the web app's "actions", such as "save a new search" \app_data.py -- app_data ...
3
votes
1answer
4k views

Cannot upload a file using requests module in python

After two days of continuous trial, I thought it's better to ask you folks here. I want to upload a file on my desktop to a remote server. For this I am making use of python and its module requests. I ...
2
votes
1answer
4k views

Iterating through a table : Avoiding stale element exceptions (Webdriver - Python)

Here is an interesting problem (or at least i think so) As an Admin I have a table with N entries (51 to give a number). Each entry in a row is a recruiter name with a link to 'Login' as that person. ...
3
votes
4answers
22k views

Click submenu which is dynamicly visible in Selenium WebDriver

In my scenario, I need to click the submenu that's only visible when its parent menu is in 'mouse over' status: MainMenu (button) SubMenu of MainMenu (span) SubMenu of SubMenu of MainMenu (span) ...
4
votes
2answers
1k views

Logging with Selenium Server?

Right now I have several Python Selenium scripts in which I am manually writing results to a text file. Is there a more standardized / centralized way I can log my results without much difficulty? I ...
3
votes
1answer
2k views

Selenium Python testing: would like to write test results to a file

I'm writing a suite of web tests in Python using Selenium. Ultimately, I want to generate a file with the results, which will then be sent out in an email. I'm using a main Python script to kick off ...
2
votes
1answer
87 views

Unskipping skipped tests once bugs are fixed?

I'm wondering how others in the industry deal with this. Right now I do this in my tests that have known bugs and aren't worth taking the time to run: from nose.plugins.skip import SkipTest def ...
1
vote
2answers
11k views

Selecting xpath using a variable in selenium 2

I am doing a selenium automation where I want to pass the variable into the XPath and select the element. The xpath which I am trying looks like: browser.find_element_by_xpath("//span[contains(.,'...
4
votes
1answer
14k 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("...