Stack Exchange Network

Stack Exchange network consists of 175 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.

3
votes
2answers
771 views

What to test when “testing” a PDF download?

What should I test if I have created a scenario with Python (bottle + mako) and web front-end to download a PDF file for registered users? I can use selenium to start Firefox, login and trigger the ...
3
votes
2answers
1k 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 ...
3
votes
2answers
653 views

Getting warning from unit test

I get a warning from this test but I don't know how to handle it. The warning is /usr/lib/python3.5/unittest/case.py:600: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/...
3
votes
4answers
559 views

Robot framework installation

I want to learn robot framework with java and python, but not sure how to use this?. I searched over the net but did not get steps to instal robot framework. I installed only selenium2library file in ...
3
votes
2answers
1k views

How to get start with selenium with python automation

Previously, I had worked in selenium with java automation. I had learnt page object design pattern , core java , selenium webdriver concepts. then do automate the each page has each class file and ...
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 ...
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) ...
3
votes
2answers
132 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 ...
3
votes
1answer
3k 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
1answer
1k 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 ...
3
votes
1answer
327 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 ...
3
votes
2answers
885 views

Functional/Black Box tests automation library on Python

Summary: I have to test embedded software which runs on qemu virtual machine or on real device and can write its output to stdout. So I can check the state of software only by parsing stdout. To ...
3
votes
1answer
3k views

Python-Selenium: Title is returning empty on website when using Firefox

I am having this weird issue where when I use: title = driver.title print('Title is: ' + title) the title returns blank or empty, it returns blank only on Firefox and with our internal website. When ...
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 ...
3
votes
2answers
3k 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"...
3
votes
1answer
122 views

Approaches for testing huge data files in text format

My current assignment requires me to test data in a large number of text files ~ 200, usually ranging between 1GB to 20GB. The data is in same schema with coordinates. As of now the approach is to ...
3
votes
1answer
1k views

How to connect to Java Applet using Python [closed]

I am looking for a solution. I am trying to automate user interaction on a web application which is having embedded java applet in it. Based on what I've found on the internet I know there are ...
2
votes
6answers
414 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 ...
2
votes
5answers
3k views

Selenium Webdriver get() shows intermittent TimeoutExceptions - how do I proceed?

I'm using Selenium Webdriver for testing a Django/Python based web application. I use both, the phantomjs and firefox drivers. We use django's LiveServerTest test case, which basically starts up a ...
2
votes
1answer
214 views

Test Automation for a website with over 8000 webpages

I have joined a team recently where I have been asked to implement automation testing for a SiteCore based website with over 8000 webpages. The exact functionality that was expected of me was to ...
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 ...
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
3answers
488 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
2answers
12k views

Find an element with two class's attributes on Selenium

I have a board where days of the week are the column and people's name are the rows, So I can use two parameters to find the cell of an employee for a certain day: data-user-id='30646 and data-shift-...
2
votes
2answers
3k views

Automation halts when browser popup appears in chrome for robot framework

I am using latest version of chrome 53.0.2785.57 beta-m (64-bit). When I execute my test script, at a point of time when deleting a line item chrome default confirmation popup appears and test fails ...
2
votes
2answers
29k views

Verifying if an image Is displayed on a webpage

I have read that there is no "sure shot" way of knowing that an image is loaded or displayed on a webpage using Selenium. I want to know the reason behind it, as to why this is completely not possible....
2
votes
1answer
9k views

How to get data-href instead of href with selenium in python?

I have currently a python code that should grab a link from google. However, google uses a somewhat different method to linking. how could I grab the data-href instead of just href. this is the ...
2
votes
1answer
104 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 ...
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....
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. ...
2
votes
2answers
48 views

How do you test an application that uses current time?

In an interview, they asked me to write a program to get current (live) time of given states in a list. I have written the code for it and was asked to tell how I would test the program to check if ...
2
votes
1answer
66 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-...
2
votes
2answers
890 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 ...
2
votes
3answers
799 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 ...
2
votes
1answer
53 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("...
2
votes
1answer
889 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 ...
2
votes
1answer
524 views

Can/should ChromeDriver be installed on the same PATH (usr/bin) as Python, easy_install, etc.?

The Selenium WebDriver for Python video I'm watching instructs me to copy ChromeDriver to /usr/local/bin. When I view my $PATH, I can see /usr/local/bin, but if I cd to /usr/local/bin it says the ...
2
votes
1answer
24k 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....
2
votes
2answers
2k views

Problem with Selenium send_keys function and JavaScript event triggered by data change

I am using Python to write a Selenium test script and I have not been able to use it to enter data for a text area. Entering data into this area appears to trigger a JavaScript function that caches ...
2
votes
2answers
3k views

ImportError: No module named 'httplib'

I have recently updated selenium Webdriver to 2.38.1 and I am writing scripts using python. When I run the test case I have I get the following error *Traceback (most recent call last): File "C:/...
2
votes
2answers
15k 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. ...
2
votes
1answer
85 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 ...
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
195 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 ...
2
votes
1answer
550 views

Running python selenium test as suite

I have a simple test suite defined as below from unittest import TestLoader, TestSuite, TextTestRunner from TestScripts.LogOn import test_1 from TestScripts.FirstLog import test_2 if __name__ == "...
2
votes
1answer
376 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
883 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
5k 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
2k 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
667 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-...