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.

6
votes
6answers
37k 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 ...
4
votes
4answers
40k views

How to send down arrow keys for a drop down?

selenium.getDriver().findElement(By.id("s2id_customFilter")).sendKeys(Keys.ARROW_DOWN); Am using the above code but it's not working."s2id_customFilter" is the id of the drop down.Am clicking on the ...
9
votes
7answers
64k views

Can I use Selenium to do Desktop Application testing?

Is it possible to test desktop applications using selenium? Suppose we have a simple application like gtalk. A desktop application, can we automate that application with selenium.
-1
votes
2answers
14k views

Robot framework. How to select option by text but value?

I want to select an option from list, but I won't use value for it. <tbody> <tr> <td colspan="3"><a href="admin.php?dpt=catalog&amp;sub=products_categories&...
1
vote
2answers
4k views

Unable to click on dropdown element using for loop [closed]

I wrote a for loop code that can access a dropdown list. I'm able to print the list but the code is unable to click on the specified option public void userCapturesAccountDetails() { WebDriver ...
15
votes
11answers
40k views

Using Selenium Webdriver with Windows Authentication

I'm attempting to create some selenium tests for a website that requires windows authentication. I got my first test up and running fairly easily, but it pauses as soon as the system prompts for ...
0
votes
1answer
2k views

Element not visible even id present for the element

I want to check one element, with help of that element id, prepared selenium web driver script, when will click on that ui element it will open another hided section on same window, but getting error "...
2
votes
1answer
3k views

Some Selenium tests fail on server but pass locally

i'd like to know if anyone faced the following problem with Selenium tests run: when scripts are running locally all tests pass, but when they are ran on server for the same site some of tests fail (...
4
votes
1answer
11k 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 ...
1
vote
1answer
77 views

Selenium scripts will run successfully on different versions of windows OS?

I have some selenium scripts for my project. I have developed and tested on windows 7 OS.But I would like to know whether these same scripts will run successfully on different versions of windows OS ...
8
votes
9answers
59k views

What Concepts of Java do i need to learn to use Selenium Webdriver?

I want to learn Selenium WebDriver automation using Java. I have done manual testing before and want to learn automation. I just know the basics of Core Java. Could you please suggest me the Core ...
3
votes
2answers
7k views

How to capture a series of screenshots in Web Driver using Java

I Just wanted to know that how can we take a series of screenshots / a video recording for a screen using Selenium 2/Web Driver with JAVA ? Please provide the answer or the link where I can get an ...
4
votes
2answers
869 views

Selenium / Java: how to handle test case execution on a flaky network connection?

What is the best strategy to handle test case execution when there is a possibility of losing network connectivity during execution? In my case, I have to run 300 test cases which usually take around ...
0
votes
2answers
1k views

Getting an error after execution as FAILED CONFIGURATION: @BeforeTest Login [closed]

java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/...
3
votes
1answer
503 views

How do I put a MySQL fixture in a PHPUnit driving a Selenium2?

I have a Symfony2 web project using PHPUnit for the unit tests. Recently I added functional tests with the package phpunit/phpunit-selenium. I have added tests to do a login, then to create an item ...
1
vote
2answers
853 views

Duplicate records identification in selenium [closed]

I was asked in an interview this question That two different scenario requires data from a common sheet. How to we identify that data already used , while passing it as input. In general how to ...
1
vote
4answers
3k views

Submit button not working in Selenium webdriver

When I launch ChromeDriver or IEDriver and click the submit button (manually and automatically), it does not send the inputs. It works outside of webdriver though, I can click the submit button and ...
6
votes
1answer
4k views

How to Debug Selenium WebDriver Actions?

I am using Selenium WebDriver and run into a issue. In the UI, elements are seen by the WebDriver but it can't perform any actions such as click, type, select etc. Elements are found by Selenium and ...
0
votes
1answer
742 views

Assertion error when comparing the text of an element

I am getting the following error while trying to verify an assertion. I tried adding wait, but it didn't help. Error message: java.lang.AssertionError: expected:<Risk Assessment Form: Completed&...
4
votes
1answer
926 views

Running Selenium webdriver scripts in android device (Samsung galaxy tab)-Portrait mode

I have been stuck in an issue while running selenium webdriver script in android device -Portrait mode. Script is running successfully in landscape mode but when we run the same script in android ...
1
vote
5answers
3k views

Testing Server/Workstation Hardware specs recommendations?

I wanted to reach out and get some opinions of Testing hardware. Should I use VMs or a stand-alone tower? If I use VMs, what would be some recommended hardware specs for the hosting server? If a ...
1
vote
4answers
65k views

How to use Xpath 'contains()' function to locate a Web element in Selenium Webdriver?

I am a beginner in learning Selenium WebDriver and XPath. I am trying to get the "<td>" Element of the Nested Table which Contains string '7-8-9.' Following is the HTML page code: <!DOCTYPE ...
4
votes
3answers
549 views

Is it a good idea to learn Selenium RC alongside Webdriver

I have recently started exploring Selenium. According to the experts future lies in Selenium Webdriver. But my question is being a predecessor should I also learn Selenium RC? Will it be worth ...
5
votes
4answers
35k views

WebDriver: navigate to new browser window

How do I open a new browser window in Selenium WebDriver? I'm using C# client drivers, but if you know with any language, I should be able to find the correct class/method in C#. On Stack Overflow, ...
15
votes
4answers
59k views

What is Selenium's default timeout for page loading?

I am using Selenium 2. I have loaded the page using Get command in WebDriver class which is in the package org.openqa.selenium. My question is that what is Selenium's default timeout for page loading?
0
votes
3answers
3k views

How to run failed test cases using TestNG?

I created jar when I run on command prompt I am able to see result, what I want is "I need to run failed test cases if there is any" public class DemoProjectClass { public static void main(...
0
votes
1answer
925 views

How to iterate a list of WebElements and store the values and to perform DB Comparision [closed]

From UI I have to read the below values (I have given example values) EmployeeID : 100 First name : abc Last name : XYZ Joining date : 22-Aug-2015 Gender : Male Phone Number : 10908333 I have ...
4
votes
2answers
4k views

Handling popup with many buttons using Selenium webdriver

I'm using Selenium web driver with Java language. When there are two buttons in a popup i.e. ok and cancel , it can be easily handled with web driver using the following code: Alert alert = driver....
4
votes
2answers
20k views

How to take ScreenShot & save it with different filenames by using Selenium & Java? [closed]

I have created screenShot() method to take the screenshot of the web page. When I used this method in my code first time it will capture the screen and it will save the image with image1 name. When I ...
2
votes
0answers
151 views

How do I access fields within Braintree's Hosted Fields' iframes using selenium

On my application payment gateway is Braintree, I need to automate it and face some difficulties when i am automating it, major problem is I cannot send credit cart details using x path, I research ...
25
votes
11answers
58k views

How can I reduce the execution speed in webdriver so that I can view properly what is happening on browser?

I want to reduce the speed for execution of script so that I can view the execution properly on browser. I want do this in webdriver.
1
vote
3answers
11k views

Locator has 3 matching nodes. How to get Selenium identify the required element?

I'm new to Selenium WebDriver. I'm trying to automate a search function on a particular page. There are a search input box and a search button (actually, it is a search icon) next to it. I'm able to ...
8
votes
9answers
46k views

How to verify two images using Selenium WebDriver? [duplicate]

Webdriver does not provide direct any function to image verification, but we can verify images by taking two screenshots of the whole web page using TakeScreenshot WebDriver function, one at script ...
2
votes
1answer
635 views

Efficent way of checking if Element is Not Present

I currently use TestNG's assertFalse to make sure a particular element is Not shown when not logged in on a site. eg assertFalse(isElementPresent(PageElements.PDFLinkText),"PDF link present when not ...
3
votes
4answers
174 views

selenium 2.0: Design pattern for projects which doesn't have so many pages

I have been POM design pattern with pagefactory from past ~ 4 years. In current project again I have implemented same pattern, but there are not so many pages infact majority of test cases work on 1 ...
6
votes
6answers
56k views

WebDriver API: 'Failed to send keys because cannot focus element' — better workaround than using Firefox instead of Chrome?

There's a bug in the chromedriver.exe Chrome driver for Selenium's WebDriver API. You can't use send_keys for certain types of inputs, like for the jQuery plugin "EZPZ Hint". It works okay on simple ...
3
votes
1answer
2k views

Does Selenium's LoadableComponent make sense in a SPA (Single Page Application)?

I'm writing a UI testing suite for a single page javascript application using Selenium 2 web driver. I'm still experimenting with how to fit the app inside a page object model. At the moment I am ...
3
votes
4answers
3k 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 ...
0
votes
1answer
838 views

Unable to call method in main class

I am trying to call a method in the main function using selenium. However, I am not able to do so. Getting null pointer error. The subclass drinks should be called in the main class coop_main. Could ...
6
votes
2answers
2k views

Extending or passing the driver in page objects?

I have 2 different ways of working with the driver in the page object model: Creating the driver in all the pages and passing it from one class to another. You have an example here. Extending the ...
3
votes
1answer
326 views

How to get the x, y axis location of the view itself in selenium [closed]

How to get the x, y-axis location of the view itself in selenium? I know I can get the position of a specific element. But I can't find a way to get the coordinate of the window's view itself. So I ...
11
votes
5answers
28k views

How to start a Selenium2 WebDriver window in background?

I have a series of Selenium2 test cases in C#/NUnit that are run sequentially. Each test case runs in a new instance of the WebDriver (and this is necessary) - which means that each time a new test ...
6
votes
1answer
2k views

Open [hidden] new window in webdriver without instantiating new driver in WebDriver

I've researched this to some extent already by searching StackOverflow and SQA, but cannot find the answer. Is it possible to open a new WebDriver browser window from the current FirefoxDriver (...
1
vote
2answers
368 views

Division not appended on click event in phantomjs [closed]

On clicking the link: <a href="#">xxx</a> the below div should be appended to the webpage <div class="desc cloned"> <div class="wrap"> ...
-2
votes
4answers
748 views

Unable to customize XPath containing span

I want to select all the products having rating 4.5 and add to the cart. However, I am not able to customize the XPath. I tried the below XPath: //div[@class='product-item__rating']/span This ...
7
votes
3answers
61k 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"))....
2
votes
1answer
6k 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="...
4
votes
1answer
12k views

How to send Keyboard Shortcuts to browser using Selenium and Nodejs

I am trying to create a test script in Node.JS using selenium webdriver and in case I need to send keyboard shortcuts to the driver. I tried finding the //body element and sending them but only ctrl+...
4
votes
4answers
6k views

Find first IMG element using XPATH

I am trying to find first fridge IMG element in a e-Commerce page but I could not find it alone, It's identifying all Images under First DIV.. Please share you thoughts I tried below XPATH, is there ...
3
votes
2answers
1k views

Updates in Selenium 3 over Selenium 2 [closed]

What are the new features/updates are available in Selenium 3 as compared with Selenium-2.0? What are the impacts of using Selenium 3.0? What are the recent errors which were found in Selenium 3.0? ...