Questions tagged [selenium-webdriver]
Used for questions about using Selenium WebDriver, a browser automation framework frequently used to automate testing in a browser.
329
questions
26
votes
6
answers
119k
views
How to handle dynamic changing ID's In XPath?
How to Handle Dynamic Changing IDs In XPath?
for example :
//div[@id='post-body-3647323225296998740']/div[1]/form[1]/input[1]
In this xpath id "3647323225296998740" is changing every time when ...
13
votes
4
answers
5k
views
How to analyse 'Element not Found' exceptions when working with Selenium
When you are writing Selenium/WebDriver automation scripts you will probably run into the exception NoSuchElementException. You think your selector is working, but somehow the element cannot be found.
...
46
votes
10
answers
218k
views
How can I work with file uploads during a Webdriver test?
This is a canonical question, intended to provide a comprehensive answer to many related questions
During the course of a Webdriver test, I want to upload files. However, this opens a native file ...
33
votes
7
answers
22k
views
What makes a good selenium locator?
When automating UI tests with Selenium, it is often not absolutely clear what method and what locator to use to locate an element. Some locators are less reliable, less readable than others. And, ...
32
votes
13
answers
167k
views
How to fill CAPTCHA using Test automation?
How can I automate "Enter CAPTCHA" using Selenium WebDriver?
20
votes
5
answers
10k
views
How does one get started with web test automation using Selenium?
So I've been testing web based analytical software now for the past 4 years or so with mostly manual techniques. But for 2015, I've set myself the goal of getting setup and start writing automated ...
82
votes
14
answers
444k
views
How to download a file using Selenium's WebDriver?
Basically I want to at least check that a download-able file exists / download link works and preferably get stuff like the file size too.
Here's an example:
link = self.browser....
29
votes
6
answers
153k
views
How do I work with dropdowns in Selenium Webdriver?
This is a canonical question, intended to provide a comprehensive answer to many related questions.
I understand the basics of working with Selenium Webdriver; I can navigate to pages, click buttons, ...
17
votes
7
answers
13k
views
How can I structure Selenium tests in a way that minimizes the maintenance work?
What is the best way to build/structure the tests in a way that will minimize the work needed to keep the tests up to date as the product changes and improves?
6
votes
1
answer
23k
views
Unable to scroll down to bottom of div with data loading dynamically
<div id="findingTblBody" class="tablebody" infinite-scroll-distance="2"
infinite-scroll="loadMoreData()" style="width: 819px;">
I want to scroll to the bottom of div mentioned above.
I am ...
5
votes
4
answers
4k
views
How to generate good locators for elements in Web pages?
This site contains many questions that are about finding the right locator expression (XPath, CSS, etc) for an object in WebPage or about troubleshooting problems related in invalid or dynamic ...
23
votes
13
answers
35k
views
What is a good website to hack around using Selenium?
I want to learn Selenium, but I don't know what to code. Sure, I can throw Google some queries, I can fill out some forms, press buttons, find divs and links, etc. But I think this stuff is pretty ...
21
votes
4
answers
64k
views
How to Implement Page Object and Page Factory Pattern in Selenium Webdriver?
I am a beginner in learning selenium Webdriver. I am not able to understand how page object and factory models works and how it can be beneficial?
Kindly help me explain it with detailed explanation....
13
votes
3
answers
15k
views
Is it a bad practice to use implicit wait in Selenium Webdriver? Should one use only explicit wait?
I was reading up on implicit and explicit waits and found the following two statements:
Implicit wait is not considered a good practice because different browsers have different loading times and ...
9
votes
5
answers
9k
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 web driver. It was a long journey, and I am still a pretty noob, but I finally understand how to use it lol....
59
votes
18
answers
10k
views
What are some tools for testing Mobile web apps?
I'm thinking along the lines of a Firebug for the iPhone/iPad/Android/BB that can truly give more insight on the markup/scripts.
Even when testing on the simulator/device, it's hard to truly simulate ...
48
votes
18
answers
55k
views
Compare screenshots of rendered web pages
In my team, we use Selenium for automation of functional testing. We also do a lot of manual regression testing to make sure the appearance of the rendered web pages is ok. I would like to develop a ...
0
votes
5
answers
11k
views
How do I get particular textNode value of a DOM with Selenium
Hello I am trying to find Load # detail from this site.
Also You can refer screenshot too.
I have tried with xpath: //div[@class='equipment_item']//text()[preceding-sibling::strong[text()='Load #:']][...
19
votes
5
answers
28k
views
Is there a captureNetworkTraffic implementation in Selenium 2 via webdriver?
If yes, how is it called, or where can I find more info about it? (I'm not talking about using WebDriverBackend.)
If not, what alternatives are there?
10
votes
11
answers
34k
views
Is mail testing with selenium possible?
We have merely just had a kick off meeting for a new project that I am required to automate ASAP. The project is essentially a "mailbox project", if you will, and I have no idea as to where to start ...
29
votes
7
answers
137k
views
Selenium: reuse existing browser session, instead of opening new windows?
This has been asked a million times on the web, but there's no clear cut answer. I tried "-browserSessionReuse" today without any luck; my tests keep spawning new browser windows.
X:\QA\Automation\...
18
votes
3
answers
10k
views
Controlling database state in Selenium UI Testing
We have a big test suite with around 300+ tests. Nowadays we are manually restoring database and creating few Data Objects and hard coding some data to feed into the tests. However, there are a lot of ...
11
votes
5
answers
113k
views
How can I switch to new window using webdriver?
I have clicked an image in a slide show and it generates a new window. Once the window opens I need to bring focus on new window and do some stuff. I have attached my code below, but it is not ...
9
votes
5
answers
19k
views
How to connect Selenium to an existing browser that was opened manually in java or create semi automated tests?
I want to achieve some use cases in which:
I want to perform some tasks that require manual intervention before kicking in automation execution. For instance, I need to manually launch the browser, ...
7
votes
7
answers
39k
views
Take screen shots using selenium webdriver
How to take screen shot on both test cases "Positive and Negative" results?
NOTE: Currently, I am working in selenium webdriver (junit) and I did not have an idea about how to code for adding methods ...
6
votes
2
answers
4k
views
Speeding up end-to-end tests
When we execute the same set of end-to-end browser-automated tests on BrowserStack, we notice a dramatic slowdown - tests are much slower than if executed locally and there are occasional failures ...
6
votes
3
answers
28k
views
How to select an element whose id is dynamic and keeps changing
There is a type and search drodown which will appear after user type in the value.
I need to click on the dropdown which contains the name of the drop down field.
The problem here is that there is ...
2
votes
3
answers
237
views
How to validate that an object (whose locator we don't know since it is not present) is not present in a page
Let's say I want to verify that an upload button is not present in a page. I cannot use any locator here since I don't know the object locator value. So how do I assert in my test that it is never ...
2
votes
3
answers
21k
views
How to open new tab in browser in selenium 3.0?
I have tried multiple actions but it is not working.
It always close the first tab and then it open link in the same page.
// Driver is launched
package WebBrowserCommands;
import org.openqa....
2
votes
2
answers
254
views
How can I get this 'Version: 0.1.0 - 94" value from the <div> tag in selenium webdriver?
How can I get this Version: 0.1.0 - 94 value from the <div> tag in selenium webdriver? and here is my code:
<div _ngcontent-qbk-c3="" style="text-align: center;">Version: 0.1.0 - 94</...
82
votes
6
answers
241k
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 ...
51
votes
12
answers
3k
views
Building "slow to break" regression tests
I need to build a lot of regression tests for our product at work and I plan on using Selenium. I am concerned about building tests that will become quickly outdated and broken based on the fast pace ...
35
votes
6
answers
340k
views
A way to match on text using CSS locators
So I use xpath locators and slowly converting to CSS.
I haven't found a way to do an exact match based on text.
For example converting //a[text()='Log Out'].
I know you can do css=a:contains('Log ...
17
votes
11
answers
30k
views
Load Testing, Selenium Vs JMeter Vs other tools
I have been using Selenium/Webdriver for functional testing in a grid setup.
We are in the process of transitioning to a Solr based search service. I already have Solrmeter for load testing the ...
14
votes
9
answers
61k
views
Handling browser level authentication using Selenium
I am automating an application which contains browser level authentication.
When I open the application, the browser performs basic authentication, i.e. it prompts for a username and password. How ...
14
votes
6
answers
25k
views
Which locator do you use with Selenium: CSS or XPath?
I have heard that, when using Selenium, the CSS Locator has better performance than the XPath Locator.
Which Locator do you use in your tests?
Have you seen a great performance improvement when ...
10
votes
8
answers
6k
views
Visual Regression Testing
For testing the visual appearance of a website the use of tools like selenium (functional surface test) is not sufficient because it doesn´t check the visual appearance and/or the CSS-Code directly. ...
7
votes
10
answers
17k
views
How can Manual QA's without a programming background learn Automated Testing?
I currently work at an ad agency as a Manual QA. I originally came in to act on the business side but kind of 'fell in to' the job.
I do not have a programming background but I am very interested in ...
7
votes
2
answers
5k
views
QTP vs Selenium [closed]
I have largely worked with Selenium for front end automation. Looks like there is great market for QTP in this arena, especially when you could afford commercial tools.
Have you worked with both ...
4
votes
1
answer
9k
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
4
answers
26k
views
I face a problem while opening Firefox with Selenium script
I face a problem while running Selenium scripts. I try to open Firefox using the following command:
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public ...
3
votes
1
answer
22k
views
Selenium Webdriver: No such element exception even though element gets available after waiting for some time
I've been keep on getting NoSuchElementException whenever I try to get an web element. I know that the web element becomes present after some time. So, I've explicitly waited for 5-10 seconds until ...
3
votes
3
answers
2k
views
Chaining WebElement actions
When interacting with different elements and applying multiple actions it may be quite convenient in some situations if we could do:
WebElement myInput = driver.findElement(By.id("my-input-id"));
...
2
votes
1
answer
12k
views
How to locate element inside <form> <table> element </table> </form>?
I want to locate element TableHeader which is inside a form table, it has the following page structure:
<form>
<table id="topNavigation" cellspacing="0" cellpadding="0" border="0" width="...
1
vote
1
answer
109
views
Getting nosuchElement Exception for a web element even though I tried all possible solutions
I am using Selenium with Cucumber to automate one web application, But I am stuck at one element which is not working out with the XPaths and link text
I also applied the implicit and Explicit wait, ...
1
vote
1
answer
3k
views
If/else with test on checkbox in SELENIUM IDE
I want to do an if/else test in SELENIUM IDE. If the checkbox is checked the test should run the IF-condition, whereas otherwise it should go into the ELSE. I tried several commands for the TARGET of ...
1
vote
1
answer
5k
views
Find Broken Images Using Selenium IDE [closed]
I need to test images on a webpage.
How should I deal with the following situation:
To check whether all images are loaded.
To check if broken images are loaded.
To that the description in Alt="" if ...
1
vote
2
answers
197
views
What are the top browsers to test on?
I have made a web platform for the cab booking service. And I want to ensure the user interface and functionality of my web application is working across different browsers.
But there are many ...
0
votes
1
answer
1k
views
How to debug NullPointerException in selenium-java
Console
FAILED CONFIGURATION: @BeforeMethod setUp
java.lang.NullPointerException
at com.ecinteractive.base.TestBase.initialization(TestBase.java:50)
at com.ecinteractive.testcases....
0
votes
1
answer
164
views
Can't find a specific element generated in DevExpress
I am attempting to find an element using this code:
try
{
new WebDriverWait(wdriver, TimeSpan.FromSeconds(10)).Until(ExpectedConditions.ElementExists(By.Id("messageGrid_TL")));
...