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
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 ...
21
votes
4answers
4k views

Tools for Python software testing

Similar to Tools for Server application testing, I'm looking for Python-related testing tools/software (as Python is my most frequently-used language).
15
votes
3answers
8k 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 ...
13
votes
4answers
25k views

How to clear localStorage using selenium and webdriver

I want to call localStorage.clear() before running a group of specific tests but the thing is I don't know how. I can see CLEAR_LOCAL_STORAGE variable mentioned here but still failing to understand ...
10
votes
3answers
1k 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 foo/commands....
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 ...
10
votes
2answers
6k 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 ...
9
votes
5answers
8k 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 ...
8
votes
6answers
71k 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: self.driver.find_element_by_id("...
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 ...
8
votes
0answers
309 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 ...
7
votes
3answers
63k views

How to send Basic Authentication headers in Selenium?

I'm using webdriver.Firefox and I'm trying to send the following custom header: self.headers = { 'Authorization': 'Basic %s' % b64encode(bytes(self.args.user + ':' + self.args.password, "utf-8"))....
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 ...
7
votes
1answer
6k views

E2E testing of Angular app with Python backend: Protractor/JavaScript vs webdriver/Python

We have extensive Python-based application, with many E2e tests (and of course unit tests), all in Python). We started e2e test in FitNesse (Selenium1, with Python fixtures) many years ago. Recently ...
6
votes
7answers
297 views

Detecting tests that will never fail

We have a rather big test codebase (~1500 test cases) for a Python/Django application. From time to time we stumble upon existing tests that will never fail: tests with missing assertions tests that ...
6
votes
16answers
45k views

Should I learn Python or Java to get into test automation? I am 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.
6
votes
2answers
2k views

Which has the better support for Selenium, Python or Ruby? [closed]

I need to use Selenium to do some automating testing. Which language has better support for Selenium? That is, once a new version of Selenium is released, And I can get the newest version binding on ...
6
votes
1answer
2k 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 ...
6
votes
4answers
9k 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 ...
6
votes
1answer
2k 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 = ...
6
votes
0answers
319 views

select_by_value causing odd issue with the DOM [closed]

I'm new to Python and Selenium testing so please forgive me if this isn't written right. I've been asked to look at the test that does a few actions on a form. The form has 2 text fields, a drop down, ...
5
votes
2answers
2k views

Pros and cons of python unit testing packages

I am starting on my first large scale python project and I want to put the right testing package in place not only to get the job done but also so when hiring people down the road it's easy to find ...
5
votes
6answers
37k 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" name="...
5
votes
5answers
18k 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 ...
5
votes
1answer
749 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 ...
5
votes
1answer
7k views

Try Assert Exceptions not failing test in python unittest or better way to loop through failures

Okay I am running Chromedriver test that gathers console logs and then tests an assertion against pythons unittest. class ConsoleLogsTest(unittest.TestCase): @classmethod def setUpClass(cls)...
5
votes
3answers
6k views

Python based test automation tools for desktop applications

I have some experience as a manual tester and at my current work our regression testing takes about 2 days. I am planning to start automating some of the test cases. I am looking at some of the free ...
5
votes
5answers
2k views

Page Object Design: Is there a Python equivalent to Ruby gems “site_prism” or “page_object”?

I'd like to know if there is a framework in Python which supports a clean way to define the Page Object Elements on a Page Object. The site_prism gem does it like so: class Home < SitePrism::Page ...
5
votes
1answer
1k views

How to retrieve httponly cookies with IE selenium driver?

By my research so far, IE selenium webdriver (for IE10 or 11) is not able to retrieve httponly cookies. So code like this can return a full set of cookies including those set to httponly if I am ...
5
votes
1answer
353 views

How should I design a testing framework for a trading system?

I work in finance and my firm would really like me to automate our execution platform's testing suite. Right now the tests communicate directly with the system; they are extremely brittle and tightly ...
4
votes
3answers
281 views

How do you set up selenium tests to run nightly, and where do you store the files?

I understand this question may look subjective, so I will do my best to make this more specific. I have created a suite of Selenium TestCases using Python. I want these tests to run each night, ...
4
votes
4answers
17k views

How to set browser locale with chromedriver (Python)

I am trying to set my browser locale by doing the following options = webdriver.ChromeOptions() options.add_argument('--lang=es') driver = webdriver.Chrome(executable_path=driver_location, ...
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("...
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 ...
4
votes
3answers
458 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, ...
4
votes
2answers
2k views

Appium vs Espresso for Android Automated Testing

For last few weeks, I was using appium(python) for android testing but yesterday we have decided to shift to Expresso(Java) for automated testing. There are couple of reasons why we are making this ...
4
votes
1answer
7k 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 ...
4
votes
2answers
1k 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 ...
4
votes
2answers
5k 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 = webdriver....
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 ...
4
votes
2answers
126 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 ...
4
votes
2answers
2k views

How do I structure my Python project based on the Page Object Model

I'm currently trying to implement a base for my automated tests based on the page object pattern with Python, Selenium and Behave. I've never really worked in a reasonably big QA project, especially ...
4
votes
1answer
3k 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 ...
4
votes
1answer
1k 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 ...
4
votes
4answers
29k 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="...
4
votes
2answers
2k views

python unittest trying to run setUpclass

I am on a website where you login, then search for course, click on course and then it lands on the Credit card page, since its just one course and is common and I am just trying to run DDT on CC ...
4
votes
2answers
9k views

Testing a Python REST API

We want to add formal testing an quality assurance to our application API. It is written in Python using Flask with Restless and outputs JSON. My question is what is the best way to test our API? It ...
4
votes
1answer
2k 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 ...
3
votes
3answers
690 views

Where do Fitnesse fits between unittests and API testing?

Our team writes unittests for our python projects. Besides that, we have a tool that allows us to run scripted API tests (we can make requests and evaluate the result, passing or failing the test). I ...
3
votes
4answers
5k views

Which language to choose for Appium - Python or Java?

We have an iOS application (written with Obj-C and now starting to incorporate Swift) that we want to write tests for using Appium. Our test team comprises of people who have little programming ...