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.

3
votes
9answers
70k 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 ...
0
votes
2answers
48 views

Store values from table for use in later tests

Below is my HTML code. I need to be able to save the names in the table rows (Saurav P, Ranjit M) to use in later tests. <table cellspacing="0" cellpadding="0" summary="Case managers who sign ...
0
votes
3answers
59 views

How to identify the web-element for a Text Box using Selenium

I am attempting to locate the empty textbox by the input id 'Department_input' <input id="Department_input" type="text" aria-required="true" size="40" class="field_input ui-widget-content" ...
-1
votes
4answers
4k views

Button won't click even though I can see it's taking me to the button when doing automation

My code which takes me to the button and highlights it (I'm running java scripts within Eclipse) driver.findElement(By.xpath("//button[contains(text(),'Save')]")).click(); My HTML code <button ...
4
votes
2answers
12k views

How and where to store dynamic result/data using webdriver java

I want to know "How and where to store dynamic (Search results) result/data", I am getting the results and not sure what to do next. Also, after saving these results I want to use this in another ...
7
votes
4answers
4k views

Selenium2 assert questions

I've recently started converting my automation suites from WatiN to Selenium2. In both cases, I've been using C#. Although these may seem like simple questions, I've been searching for answers for ...
1
vote
2answers
42 views
1
vote
3answers
303 views

How to accept Alert message in Selenium Java

I tried driver.switchTo().alert().accept(); but still i am unable to accept the alert message. please let me know the code to accept below message. enclosed screenshot of message and XML
1
vote
0answers
27 views
-1
votes
2answers
41 views

Either its possible to get and show a value from front end in selenium Java. If so, then how I can do this

I am testing a website and I need to perform some action on the basis of Price. It is showing price in Remaining Budget. I want to check the remaining budget and then on the basis of it want to ...
2
votes
2answers
62 views

if/else condition is not working as expected

WebElement radio= driver.findElement(By.xpath("//[@id=\"mydiv\"]/form/div[1]/div[3]/label")); if (radio.isSelected()){ Thread.sleep(2000); driver.findElement(By.xpath("//*[@id=\"mydiv\"]/form/...
2
votes
2answers
20k views

How to use Run Keyword IF" in Robot Framework

I want to run Keyword if Element is visible. E.g I want to check that if a button is visible on the page then run particular Keyword. Below is my code. Create button is Keyword and want to run if ...
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....
0
votes
2answers
292 views

How to parameterize locator in Selenium

I am new to selenium, And In my scenario I need to select a product for list of products in the page. And Product name to select is a test data. Now my query is,Can I create Object in Class level ( ...
2
votes
2answers
628 views

Getting 'org.openqa.selenium.NoSuchElementException' - how to fix?

I'm getting this error: Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to locate element Why am I getting this WebDriver exception and how can I fix it?
4
votes
1answer
2k views

Dependent methods in the same class run out of order only when included in a “testng suite”; running class independently respects the dependency

I have a class with dependent methods using the TestNG annotation dependsOnMethods The test runs fine 100% of the time if I simply run it as a TestNG Test from the package. When I include the test ...
5
votes
3answers
550 views

PHPUnit Selenium-2 Test Case BadMethodCallException

I have installed selenium-server-standalone-2.33.0.jar, phpUnit, selenium extension for phpUnit. This test runs ok: $this->url('/'); $this->assertEquals('my title',$this->title()); But ...
3
votes
2answers
426 views

Is it possible to automate tests on an embedded WebKit browser on Mac OS X?

Is it possible to automate the tests on a WebKit/WebView browser that is embedded in a Mac OS X desktop application, preferably using Selenium or some Mac-based tool like AppleScript or ...
3
votes
1answer
851 views

Unable to run Appium Version 1.3.6-(Ophiuchus) on Yosemite for Testing Android App on real device

These are my settings: My SDK path: -/usr/local/adt-bundle-mac-x86_64-20140702/sdk My APK path -/usr/local/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/Setmore.apk Given Package name, Launch ...
3
votes
1answer
195 views

Getting and logging the selenium version used in a groovy project

I'm using Selenium in my Groovy application as a Maven dependency. Now I'm looking for a way to log the used Selenium Version to the console. I tried this: BuildInfo info = new BuildInfo(); def ...
0
votes
3answers
75 views

Unable to find element with css selector == input[name='username']

WebElement username = driver.findElement(By.cssSelector("input[name='username']")); The statement mentioned above was working before but right now concerned element can't be captured and error ...
4
votes
1answer
3k views

Handling different input fields using Robot Framework

I am writing an automation test script using Robot Framework & Selenium2Library for testing our web application (I am writing test cases in .txt format) I am having a problem on handling two ...
2
votes
1answer
1k views

Unable to open the specified URL on a real device while running Selenium tests using ios-driver

I am trying to automate mobile web testing using ios-driver on an iPhone 6 plus (real device). The Safari browser opens but the specified URL (google.com in this case) is not opened (i.e. only "about:...
0
votes
1answer
41 views

Fetch paid Amount value from iframe

if(ScenarioName.equals("MoveinwithVantivCard")) { driver.findElement(By.id("btnsave")).click(); // driver.switchTo().frame("paymentIFrame"); driver.switchTo().frame(driver.findElement(By....
2
votes
0answers
2k views

Jenkins Build Is Hanging

We are using jenkins for the continuous integration. I have already created a jenkins job for running all my robot framework automation test scripts & Everything was absolutely working fine. But ...
-1
votes
2answers
62 views

How to interact with web elements with the same ID's?

I have three drop-downs with same ID's and want to click each of them, one by one, but it will click the same element three times. The remaining two elements are failing, but that test case is passed. ...
2
votes
2answers
97 views

What is the best way to automate a system, where the XPath is not static?

I have to automate a system, which changes its ID's from time to time, and the XPath is not static. What is the best way to automate this kind of system?
1
vote
2answers
28k views

How to select li element in selenium

I want to select "India (+91)" from dropdown Can anyone help me with this?
4
votes
2answers
365 views

How can I handle alert using if else condition in selenium?

else is perfectly executed but if block is not executed - can anyone help me? WebDriverWait wait = new WebDriverWait(Maf_Base.getDriver(), 10 /*timeout in seconds*/); if(wait.until(...
2
votes
4answers
3k views

Assert in TestNG (Actual int value, Expected int value)

Is there anyway to assert that, actual int value = expected int value not equal to 0 Something like, Assert.assertEquals(length, 0);
1
vote
2answers
4k views

Selenium element not selectable for a kendo ui element

I am having an issue with an element which works with a mouse click and there are some items from which one has to be selected but its unselectable is set to on. Whenever I try to select the elements ...
1
vote
0answers
19 views

How to print the webservice(jqurey) hit on the console for search functionality

Open a website, press F12 go to network option and enable preserve log now type the work you want to search eg:dogs we can see the service "http://search.test.com/search........." here i want the ...
1
vote
2answers
6k views

How to get count of 'li' elements list with selenium webdriver?

I have a list of li elements wrapped in sub-menu class of HTML, before clicking on any of the li element I wanted to cross check all li elements are present with getText() and length but not sure how ...
10
votes
7answers
57k views

Is it possible to stop page loading on the browser using selenium web-driver?

I searched online, but couldn't find anything about how to stop page loading over a browser using selenium web-driver. Any idea for the same?
0
votes
4answers
8k views

IE 11 gives Unable to find element with CSS selector or XPath or XPath expression cannot be evaluated or does notresult in a WebElement

I am getting below error messages : IE 11 gives intermittently error like Unable to find the element with CSS selector or XPath or XPath expression cannot be evaluated or does not result in a ...
0
votes
1answer
29 views

Finding an element by tagname's value

In our app that we are using, there are widgets on the page, lots and lots of widgets. There is a HTML tag called widgetkey in it, with an 'id' value associated with it. Here is the exact HTML: <...
2
votes
1answer
108 views

Selenium exception is reported twice in logs

I am using Cucumber Page Object model to execute my tests. Here is my POM file:- <dependencies> <dependency> <groupId>info.cukes</groupId> <artifactId&...
3
votes
2answers
1k views

Unable to open Safari app on iPhone simulator while running Selenium test using ios-driver

I am trying to automate mobile web testing using ios-driver. The safari browser does not open even though the simulator launches. The configuration as shown on terminal by running the command java -...
0
votes
2answers
3k views

How to run data driven testing using testNG in selenium

I am using testNG framework and tried to import data from excel sheet in my local. If I run the code as simple java application then its running but with testNG its not public class NewTest { ...
1
vote
1answer
319 views

unable to click modal popup using selenium

I Have an application developed using Electron+Chromium when browser launched without any URL there will be a popup. This is a modal popup and using selenium I'm unable to handle this popup. HTML ...
1
vote
2answers
472 views

Selenium: Getting error with webElement or Webdriver “Drive” Variable

New to automation. Help is greatly needed Anybody could help me with following code Why i am getting NullPointerException? Error: Null pointer access: The variable driver can only be null at this ...
13
votes
9answers
51k views

How to handle “Time out receiving message from the renderer” in chrome driver?

I am new to selenium, I'm facing "Time out receiving message from the renderer" in chrome browser while running test with selenium 2.41 and chrome 2.9x. I have tried many tests to reproduce the issue, ...
0
votes
2answers
4k views

How to select few text lines using Robot Framework?

I am writing an automation test script using Robot Framework & Selenium2Library for testing our web application ( in .txt format ). One of my test cases involves to select few lines of text from ...
0
votes
1answer
472 views

how to run same testcase in 2 different URL in selenium JAVA [closed]

How do I run the same test case in 2 different URL which has same functionality
7
votes
2answers
4k views

How to get max character count for input fields with selenium webdriver

How to get the maximum allowed character in any text box eg.user name, email address, in selenium webdriver ?
8
votes
10answers
76k views

Selenium test case fails due to page load time

I run nearly 30-40 test cases twice a day. And everytime some test case fails due to page load time. Infact i have explicitly mentioned Thread.sleep("2000"); wherever i feel it takes more time to load....
2
votes
2answers
79 views

How can we automate the fields if there are multiple data components are present on UI and we need find inside elements

I am new to selenium. following are some info. Can someone guide me to create xpath and this is the approach we are using to maintain the UI elements unique, so for this code, will selenium help to ...
-2
votes
1answer
40 views

Double decimal value

public static String TaxAmount(String totprice,String tax) { String strD2=tax; double totalprice= Double.parseDouble(strD2); String strDl = totprice.trim(); if(strDl....
3
votes
5answers
4k views

Unable to select text from dropdown - Gmail.com Month Dropdown

Im also facing the same error. Unable to select Birthday, Gender & Location in gmail signup page. I'm using Selenium Webdriver. Please find the below code for birthday. new Select (driver....
8
votes
3answers
10k views

How to wait until the count of a web element changes in webdriver?

I'm new to selenium. I am facing an issue. The number of web elements in a page increases on a button click(triggered by ajax call). So while getting the size of the element after button click gives ...