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

learn more… | top users | synonyms

15
votes
5answers
24k 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 ...
13
votes
3answers
1k views

Tools for Python software testing

Similar to Tools for Java software testing, I'm looking for Python-related testing tools/software (as Python is my most frequently-used language).
9
votes
2answers
2k views

What are some tools for fuzz testing?

Fuzz Testing as defined by Wikipedia is: a software testing technique, often automated or semi-automated, that involves providing invalid, unexpected, or random data to the inputs of a computer ...
6
votes
1answer
3k views

Is there any full Python webdriver API documentation?

I'm starting out using Selenium 2/Webdriver, been using Selenium IDE for a few weeks, to automate some tests and decided to go with Python. I've been writing some simple tests using some basic ...
6
votes
1answer
1k views

Unable to run standalone test script in Selenium with Python

So, I have the latest Selenium 2.0 Python bindings installed via pip (Python 2.7.2, Windows 7). I wrote a small script to see if I could get it working: from selenium import webdriver driver = ...
5
votes
5answers
1k views

manual tester wanting to get into automation

So its been a year since I have been studying python, and just recently I started picking up webdriver. It was a long journey, and I am still pretty noob, but I finally understand how to use it lol. I ...
5
votes
1answer
507 views

How do I write a script to be executed by Hudson to automatically restart test environment machines?

I am working in a test environment where we need more than 10 machines, including VMs. The AUT is a Distributed Network type and uses Cassandra nosql DB. We are required to restart each of the ...
4
votes
1answer
326 views

How to 'Mock' SVN

I am testing an app that does some subversion interactions, such as comitting, adding, stat, etc. What's a good way to get me started in terms of mocking the subversion client and working directory ...
4
votes
2answers
586 views

Python coverage and external executables

I have a project that has almost complete unit test coverage. There's only one statement that isn't covered and I can't work out a good way to do so. Say the project is called foo, I have ...
4
votes
4answers
4k 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: ...
4
votes
2answers
372 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 ...
4
votes
4answers
2k views

Running Selenium tests as a scheduled task

I'm trying to run a Selenium WebDriver script written in Python on a Windows 7 64-bit box as a scheduled task. The test works pretty well when run as a batch file from the command prompt, but when ...
4
votes
1answer
577 views

Getting nose test runner to execute a test against multiple browsers / configurations?

Surely someone else has run into this problem. I'm trying to figure out how to loop through Firefox, Chrome, and IE in conjunction with nose. Right now I have: "setup.cfg" file that specifies ...
4
votes
1answer
512 views

Selenium (RC) hangs when started from Python test

Fairly new to Selenium (but loving it). I'm running a single test in Python on Selenium RC. I've been running it multiple times a day for about 3 weeks. Now when I try to run it, it executes all the ...
3
votes
1answer
510 views

How to handle a native OS (Ubuntu) file upload window in selenium webdriver with python?

This is my first time here but I have already posted this question on SO. I keep getting solutions for Windows + Java and not for Linux or python for that matter. I am using selenium and python to ...
3
votes
1answer
655 views

How can I test a table of options with python unittest and nosetests?

I have a list of twelve properties and want to test various combinations. The actual test function is the same, just different parameters. I find myself writing a bunch of functions that look like ...
3
votes
2answers
312 views

Load / Performance testing tools or approach for backend

I work on a team which is basically all backend. Functional and unit testing is achieved by python or perl scripts or sometimes bash scripts. But if we need to load or performance test our ...
3
votes
2answers
112 views

Approaches to Testing a Scientific Library

I'm quite interested in the Scipy/Numpy project which is basically a Python scientific computation/numerical methods library. I'm also interested in testing. What are some good approaches for testing ...
3
votes
1answer
346 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 ...
3
votes
1answer
2k views

WebDriver function failing intermittently in Internet Explorer near clear() method

Does anyone know why this WebDriver function would be failing intermittently in Internet Explorer? Seems to always fail right around the textbox.clear() line. It works perfectly in Firefox, but fails ...
2
votes
4answers
4k views

How to select or check multiple checkboxes in Selenium?

I've got this HTML code <input type="checkbox" value="abc" name="arr[]><br> <input type="checkbox" value="abc1" name="arr[]><br> <input type="checkbox" value="abc2" ...
2
votes
4answers
3k 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 ...
2
votes
2answers
4k views

How to specify a Firefox profile name when using webdriver + python

I'm using python 2.7.1 and selenium 2.20.0. I have a seperate firefox profile called "selenium" which I want to use when running the webdriver. I managed to do it by specifying the complete path to ...
2
votes
2answers
387 views

Andriod Selenium testing by Python - connecting problem

I'm trying to get the Selenium Android client to run in my emulator: Install SDK Run emulator Install android-server-2.0rc1.apk in the emulator and devices Forward the port by adb forward tcp:8080 ...
2
votes
3answers
7k 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 ...
2
votes
0answers
57 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 ...
2
votes
2answers
715 views

How can I dynamically create an xpath string in Python for a webdriver xpath selector?

I am writing a Selenium Webdriver test using python2.7 to use xpath to select a link node set. For each link I need to change the href attribute using driver.execute_script to execute javascript. ...
1
vote
6answers
223 views

Language preferences in the QA community

I work on a test management tool that includes a REST API. We are looking to add code examples for consumption of the API as well as client libraries. Initially we were looking to target Python for ...
1
vote
2answers
162 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
131 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
2answers
465 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 ...
1
vote
1answer
136 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 ...
1
vote
2answers
3k views

How can I access a site protected with basic HTTP authentication using Python, Selenium2, and Chrome Webdriver

I'm using the Python bindings for Selenium2 with the Chrome webdriver. I need to access a site that is protected with basic HTTP authentication. from selenium import webdriver driver = ...
1
vote
1answer
1k 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. ...
1
vote
1answer
338 views

How to use databases within the python unittest framework?

I have a bunch of unittests written in python in which messages (text) of any kind is used. Instead of 'hardcoding' the text examples used for the tests I would like to use a database of some kind ...
1
vote
1answer
114 views

More official way to leave browser window open upon failure?

My coworker Chris came up with this, and it works, but I wonder if there's a more "official" way to do this using unittest.TestCase in Python. def tearDown(self): """ clean up by closing the ...
1
vote
1answer
50 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
1answer
2k 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 ...
1
vote
1answer
332 views

How can I convince Squish to recognise the menu bar on Mac OS X?

I'm currently recording some python test scripts for a Mac OS X application using Squish for Qt, version 4.0.2. The menu bar of the AUT works fine if interacted with manually, but for some reason ...
0
votes
2answers
119 views

Migrating website content, need to test using Selenium/Python

We are working on a large project which involves LOTS of content being migrated to a new version of a website. I would like to be able to test the content on a page from the old site, with the same ...
0
votes
9answers
351 views

Should I learn python or java to get into test automation? New to programming

Should I learn python or java to get into test automation? I'm new to programming. Please share your thoughts or links to any useful information.
0
votes
1answer
93 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 ...
0
votes
1answer
2k views

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

Hi guys. 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) ...
0
votes
5answers
329 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 ...
0
votes
2answers
52 views

Force selenium to use the portable firefox application

I have installed firefox 14 and has firefox portable version 25.0.1 on the machine, where I run tests for a web site. Due to a limitation in the site I'm testing, I cannot run my tests on firefox 14 ...
0
votes
1answer
30 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 ...
0
votes
1answer
97 views

Upload image via ajax form with selenium and Python

I'm trying to get familiar with selenium. I decided to try to work with facebook, and fulfill my profile with selenium, But they use too much Ajax. It's not very complicated to fulfill my hometown ...
0
votes
1answer
334 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 ...
0
votes
2answers
44 views

Unable to find element in selenium

I'm using the following code: if i[1] == "id_text": inst = driver.find_element_by_id(i[2]) #inst.click() for option in inst.find_elements_by_tag_name('option'): if option.text == ...
0
votes
1answer
47 views

Question about 'self.assertIn' & 'driver.title'

I researched this as much as I could on my own but came to no clear conclusion to my question. I've been teaching myself automation testing via Python + Selenium, I'm as new or n00b as it gets so bare ...