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 [selenium2]

Use for questions about Selenium 2. Selenium 2 is the second major release of Selenium, an open source framework for testing web applications. A major difference between Selenium 1 and Selenium 2 is the latter's use of WebDriver.

18
votes
6answers
98k views

Running WebDriver without opening actual browser window

I've heard rumors that Selenium WebDriver can run without opening a real browser window, meaning it runs in the background. I am using the C# Client Drivers, FirefoxDriver within the automated tests, ...
55
votes
18answers
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 ...
1
vote
5answers
16k views

Counting the number of browser windows opened by Selenium

Is there a way to get a list of opened browser windows using Selenium? I want to use this to count the number of open browsers within a test.
3
votes
8answers
981 views

What is Software Test Automation Framework?

I am a beginner Software tester. I have started to learn test automation of web apps using selenium webdriver in java. Till now I can just automate simple login functionality. I want to know all about ...
7
votes
1answer
29k views

Fieldlevel validation in Selenium Webdriver (Java)

how to test validations for "FIRSTNAME" textfield. Below are the details and code. URL: http://www.vrlbus.in/vrl2013/register_customer.aspx Special chars: #!#!#$@#!$@!$@#$%#%^#$^^&%&$%* (...
1
vote
1answer
555 views

Selenium and PHP

As I read on the net, Selenium tests should be written in the language of the App if this is possible. Our intranet-application is written in PHP. I was able to get Selenium working with PHPUnit but ...
6
votes
3answers
41k views

"Element is no longer attached to the DOM” StaleElementReferenceException when selecting HTML table row

I am using Selenium 2/WebDriver for automation. I have a table and am trying to select a row in it. When the test runs, I can see the row become highlighted as if it is clicked, but then immediately I ...
12
votes
3answers
12k views

Automated tests pass every time when run individually, but when they are clumped into a test suite it's a toss up if the tests will pass

I have around 200 test classes for my web application at the moment. I use Selenium2/Webdriver and the tests are written in java, with TestNG used as my framework. When I run each test by itself, ...
3
votes
9answers
69k views

How to get entered text from textbox when value is empty in selenium using java?

Just I am trying to get entered text from the text field when value is empty. Below is my HTML: <input type="text" style="width: 203px" value="" maxlength="32" name="firstName"/> I tried ...
1
vote
2answers
7k views

JUnit ParallelComputer Runs All Test Classes As One

I'm building automation testing for web application by using JUnit 4.9 and Selenium Webdriver. It's time consuming. So I'm trying to experiment with ParallelComputer. I'm wondering how can I get ...
1
vote
0answers
11k views

Using Allure framework with Selenium webdriver tests for better reporting.

I am using Selenium webdriver for automation. I have around 200 scripts ready and now i need a good reporting tool to generate reports. I recently heard about Allure framework, which is an open source ...
4
votes
1answer
1k views

Selenium RC: Xpath of the link is changed when I refresh the page

Selenium RC: Xpath of the link is changed when I refresh the page, and when I run the code it shows "Exception in thread "main" com.thoughtworks.selenium.SeleniumException: ERROR: Element //*[@id='yui-...
2
votes
3answers
2k views

How to run selenium-cucumber eclipse project through command prompt

I need to run selenium-cucumber (Junit) project from command prompt. I tried using the statement in command prompt: java -cp E:\Workspace2\AP\Jars\*;E:\Workspace2\AP\src\stepDefinition\ cucumber.api....
-1
votes
2answers
3k views

How to write XPath under tag: strong<> <br> after every <strong>

I am trying to find xpath of text 262567 of given below HTML code : <div class="lessthanhalf" > <h4> Listing</h4> <strong style="background: rgb(204, 136, 136); border: 2px ...
7
votes
5answers
10k views

How do you block Google Analytics from Selenium automated visits?

Basically, we have a javascript integration on client's webpages. We don't have much (or any) control of the deployed environment, hence the only way to test our integration is truly working is using ...
2
votes
2answers
6k views

How to press CONTROL key & Select multiple values from Excel

What I am trying to do is select multiple options from this example site while holding CTRL http://www.htmlcodetutorial.com/forms/_SELECT_MULTIPLE.html The multiple selection values would come from ...
4
votes
1answer
2k views

How do I validate dynamically changing data using Selenium

I have to use Selenium to test an application with a live time stamp. My code is: String validationmessage=driver.findElement(By.xpath("//div[@id='part_log_details']/p[1]")).getText(); System.out....
3
votes
4answers
18k views

IE always opens with random local host and message: “This is the initial start page for the WebDriver server”

I have my WebDriver tests running parallel in IE, Chrome and firefox. When I run test in IE browser it node gets registered with the hub, and the browser opens and it gets redirected to some random ...
2
votes
1answer
112 views

Page factory performance

Does page factory affect on performance for test execution when we have a lot of elements with @FindBy? We use Java as a programming language.
1
vote
3answers
991 views

Multiple @tests but did not execute the priority 2 and priority 3

Can someone let me know why it stops execute after the first @test(priority=1)? It ran the @beforeclass, then @test(priority 1) then @aftermethod. So it skipped @test(prority=2) and @test(priority=3) ...
19
votes
4answers
53k 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 ...
-1
votes
3answers
7k views

How to find the element that displays and hides with in 2 seconds in selenium webdriver?

I am automating a site in which there is a section to create forums. Every time I create a forum it displays message as forums created and hides after 1 section. I have to check the displayed message, ...
18
votes
5answers
105k views

Webdriver Check if Checkbox is Set and Set it if Not

I am learning Webdriver with JUnit by going through Alan Richardson's Selenium Simplified book and taking translating the exercises/tests from Selenium RC to Webdriver. So far, this has proven to be ...
3
votes
1answer
2k views

What is the procedure to start Safari browser?

I'm new & started working on selenium from last month. I was successfully running script on FF & chrome. but when I started to run same script on Win safari It gives browser initilization ...
6
votes
1answer
5k views

How should I organize a TestNG suite for Selenium 2 WebDriver tests that use page objects?

I'm trying to organize a functional test suite for the UI in a CRUD web application using TestNG-style Selenium 2/WebDriver tests. I've isolated page-interaction logic into distinct page objects, and ...
59
votes
14answers
259k 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....
1
vote
1answer
788 views

How do I use Selenium to drag and drop drawing elements into a canvas?

I have an element with an id which I need to select, then drag and drop into a drawing canvas. How do I do this? The element is outside the canvas and I need to draw it inside the canvas. function ...
2
votes
2answers
1k views

Need help to get drop down in a list (phpunit+selenium2)

I am new in Phpunit and selenium2. Need help to get all the values of drop-down in a list. <select id="month" class="_5dba" title="Month" name="birthday_month" aria-label="Month"> <option ...
-1
votes
5answers
4k views

Unable to click on checkbox using Selenium & Java

please send me the full code I tried Some XPath and CSS: XPath: //div[@id='autofill']/div/label //div[4]/div/label CSS: div.col-md-1.checkbox.checkbox-primary > label* but using above ...
3
votes
4answers
9k views

How to handle browser closing popup

In one of my scenario I am filling the form but not submitting due to my requirement. Now I am closing the browser but while closing browser it is browser an alert by saying "Are you sure .... ". How ...
5
votes
1answer
413 views

Selenium Grid2 - IOException thrown while closing Closeable.

I am executing my Selenium tests against a Grid server, hosted on a different machine. My grid invocation is (bat file): cd c:\ start java -jar c:\selenium-server-standalone-2.46.0.jar -role hub -...
18
votes
5answers
24k 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?
2
votes
0answers
536 views

How to set browser window size using Phantom JS + Java

I am working on PhantomJS with Java for one of my project. I am looking for some help in working with PhantomJS in following scenario. Scenario : Step-1 : Mouse hover on tab/link then 2 sub-links ...
-1
votes
2answers
2k 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 #:']]...
16
votes
4answers
136k views

Selenium: How to identify the button WebElement

In my web page I'm having following two buttons: <button onclick="addToSelected('newApplicationForm');">Add Strategy</button> <button onclick="submitAddNewApplication('...
0
votes
2answers
258 views

How to handle dynamic submenu items diaplaying based on different user roles in selenium?

I have the following menu structure: Main Menu1 > Sub menu1, submenu2 Main Menu2 > sub menu 1 etc. And sub menus change based on different user. I need to have common method to handle this. ...
1
vote
1answer
14k views

How to use a regular expression to identify xpath of element with autogenerating id

I need to access this element: <input id ="combo-1105-inputWrap"> The 4 digits in the xpath are autogenerated per browser session. I need to find that particular xpath and key in the data. ...
5
votes
4answers
2k views

How to get multiple login instances working in Internet Explorer?

Am working on a banking application. Our requirement is to execute tests in parallel in one system. A) Below is how our application responds to selenium parallel execution :- Does not allow ...
2
votes
3answers
11k views

How to find the CSS style attribute of a particular HTML element using Robot Framework?

I am writing an automation test script using Robot Framework & Selenium2Library for testing our web application. One of my test cases involves checking the CSS style attribute of an HTML tag. Is ...
0
votes
3answers
1k views

Automation testing of mainframe application using Selenium

is it feasible to test mainframe, which is a desktop based application with selenium? If yes, then how?
3
votes
2answers
17k views

How to call a method from one class to another class when both are TestNG classes

I have 2 TestNG classes which are: ProductCanvas package objectRepo; import java.util.List; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium....
3
votes
4answers
5k views

Order in which options are returned by getOptions() in Dropdown box(Select Class) in Selenium WebDriver?

When we get options of a dropdown in Selenium Webdriver the following way Select dropdown = new Select(driver.findElement(By.id(dropDownId))); List<WebElement> options = dropdown.getOptions();...
23
votes
6answers
135k 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, ...
8
votes
3answers
7k 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 ...
0
votes
7answers
35k views

How to close pop up window in Selenium webdriver?

Below is my Selenium Webdriver script. When I run this script my website is opened but the popup window is also opened. How do I close this popup window so the script can continue? Take a look on ...
6
votes
2answers
8k views

How can i automate using selenium to check if an element is present in viewport

My scenario is to make sure that my search bar is not sticky. For this I am scrolling to middle of the page. Now I need to check that my search bar is not visible in my viewport. isDisplayed method is ...
1
vote
3answers
34k views

How to handle sub child windows(more than 3) using Selenium Web Driver with Java

I am using Selenium Webdriver with Java, and I need help handling sub child windows. I have to handle four child windows. Main window- Child window- Grand child - (to reach 5 child windows) I am ...
0
votes
1answer
6k views

Uploading a file to a web site: how to handle Windows dialog to choose a file

Just reviewed questions that may already have the answer, but failed to find anything relevant. So the site I am testing has a file upload dialog. When you click Select File -> Browse, a Windows File ...
5
votes
1answer
3k views

Error in Maven project build-“Could not initialize class org.apache.maven.index.ArtifactInfo”

Hi All when I am trying to build or clean the Maven project I got below error can any help me ? Errors occurred during the build. Errors running builder 'Maven Project Builder' on project 'POM-...
1
vote
1answer
1k views

How to get List of similar elements using javascriptexecutor using selenium webdriver

I want to get list of similar element into arraylist using javascriptexecutor. However able to store only single element using javascriptexecutor. Here is my code: JavascriptExecutor js = (...