java 1 « selenium « Java Testing Q&A

Home
Java Testing Q&A
1.Development
2.FindBugs
3.HTMLUnit
4.hudson
5.junit
6.performance
7.plugin
8.profile
9.selenium
10.Tools
11.unit test
Java Testing Q&A » selenium » java 1 

1. Canoo WebFunctionalTest / Selenium, features comparison    stackoverflow.com

For features comparison of Web Canoo Web Functional Test and Selenium software, it would be good have an assessment, in terms of integration to Java platform applications, speed, how quick ...

2. Running Selenium from a Java process    stackoverflow.com

How would you run the Selenium process (thread) from a Java process so I don't have to start Selenium by hand?

3. autogenerate HTTP screen scraping Java code    stackoverflow.com

I need to screen scrape some data from a website, because it isn't available via their web service. When I've needed to do this previously, I've written the Java code myself ...

4. how to impersonate a windows domain user for automated web testing?    stackoverflow.com

we are about to build several UI test with selenium-rc and the java client the app itself is a classic asp web application that uses integrated security to retrieve the user's permissions ...

5. Is there a builder based java api for selenium?    stackoverflow.com

Does anyone know of a builder-based alternative/supplement to the "classical" com.thoughtworks.selenium.Selenium interface ? It just seems like it'd be a much better approach for this api...

6. Selenium Automated Testing and java textboxes    stackoverflow.com

Hey Ive tried looking for how to solve this for a couple hours and I keep coming up blank. Im using Selenium IDE to try and make a few simple Automated tests ...

7. selenium RC basic test doesn't work with iexplore, but works with FF, and more    stackoverflow.com

The classic google test here from selenium website, it works in FF on vista. On IE7, apparently doesn't find the window object. Selnm gets farther in the test (On IE) when ...

8. fire both blur and focus tightly coupled?    stackoverflow.com

Any idea how I can fire the blur even just after the focus event, such that it doesn't occur "loosly coupled" (the actions are send one-by-one to the selenium server). Let me ...

9. How do I change the default request timeout for Selenium 2?    stackoverflow.com

I am currently using Selenium 2.0a2 in Java to access the Internet using an HtmlUnitDriver instance. The problem I am facing is that, when I attempt to access slow websites, the ...

10. How to check if an element is visible with WebDriver    stackoverflow.com

with WebDriver from Selenium 2.0a2 I am having trouble checking if an element is visible. WebDriver.findElement returns a WebElement, which unfortunately doesn't offer an isVisible method. I can go around this by ...

11. Passing the DISPLAY argument into a GNU screen command to run Selenium    stackoverflow.com

I am running a multiserver Selenium testing environment using headless VPSs. I have nearly everything automated except for a specific need to declare the DISPLAY=:1 argument when starting Selenium within ...

12. TestNG - Factories and Dataproviders    stackoverflow.com

Background Story

I'm working at a software firm developing a test automation framework to replace our old spaghetti tangled system. Since our system requires a login for almost everything we do, I decided ...

13. race condition in Selenium waitForPageToLoad?    stackoverflow.com

We're using Selenium for smoke-testing a Java Spring MVC based website. We invoke it using JUnit and the Java Selenium client. Much of the time, our tests work fine, ...

14. Need to compare 2 html documents using Java & selenium    stackoverflow.com

I have to check the differences between 2 html documents One is an old doc another is the updated document I need selenium to get the source of the 2 documents and ...

15. isTextPresent fails all the time in Selenium test. Not sure if I am doing anything wrong    stackoverflow.com

I have this little piece of code that just checks for a particular text at a location on the page and if that text is found, it will check for something ...

16. Java: Modify System properties via runtime    stackoverflow.com

I have an existing jar file which I run. It is the Selenium RC server. I want to be able to change the JVM httpProxy.host/port/etc system values. On the one hand ...

17. Selenium-Grid: How to use `user-extensions.js`    stackoverflow.com

We're converting our Selenium tests to use Selenium-Grid. I'm trying to find a way to launch selenium-grid's hub and/or remote so that it can use the user-extensions.js that we created before. I've ...

18. running multiple test case in Selenium at the same time    stackoverflow.com

I created 2 test suites with Selenium IDE and I would like to run those test suites at the same time. Just like firing threads at the same time. ...

19. Solve ExtJs dynamic Id generation problem when using Selenium Tool    stackoverflow.com

I am new-bie when it comes to testing and right now I am trying to test a web application and its UI is developed using EXTJS. The problem I am facing ...

20. Does TestNG guarantee @BeforeSuite methods are executed before @BeforeTest methods?    stackoverflow.com

BACKGROUND: My goal is to code a TestNG-Selenium system that runs self-contained (no strings to maven or ant plugins; just java). It must allow for test cases to accept parameters including the browser ...

21. How do I run firebug within selenium 2?    stackoverflow.com

What's the best way to activate firebug in firefox when running Selenium 2 ? Edit: Ok, I realize "best" is open to interpretation, but the profile-based solution really used to be a ...

22. java.lang.ClassNotFoundException: WebDriver API    stackoverflow.com

I downloaded the selenium-java-2.0a5.zip http://code.google.com/p/selenium/downloads/list and ran the following code:

package org.openqa.selenium.example;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;

public class Example  {
    public static void main(String[] args) {
   ...

23. how to run selenium test case written in java in bromine    stackoverflow.com

I tried to run test cases written in java but by default selenium server is opens the www.google.in and after that it says"element not found" because my site is rediff.com. how ...

24. Best way to time something in Selenium    stackoverflow.com

I'm writing some Selenium tests in Java, and I'm mostly trying to use verifications instead of assertions because the things I'm checking aren't very dependent so I don't want to abort ...

25. Selenium RC Java - isElementPresent not working    stackoverflow.com

I have the following problem... For a while now i noticed a bug in isElementPresent function in selenium RC 2.0a5. It works only half of the time or so. I have ...

26. Selenium RC+java    stackoverflow.com

how to handle ActiveX using Selenium RC an Java??

27. Hide warning messages in java    stackoverflow.com

It is possible to hide the warning messages in java?

28. Selenium RC memory leak    stackoverflow.com

Im trying to run Selenium RC with Nagios3. Everything works ok up to 3h... then selenium engine takes sometimes even 1.4G RAM and stop responding. I'm starting selenium by: java -server -Xss64k ...

29. selenium.attachFile(String fieldLocator, String fileLocator) method    stackoverflow.com

String fileLocator here is actually a file URL. I define a file URL to 'file:///D:/images/pic1.jpg' but selenium for some reason i don't get tries to load it from c:\Temp (where the ...

30. Why does selenium.keyPressNative() cause the SeleniumServer instance to bubble to the surface?    stackoverflow.com

First, some info that might be useful: I'm running Selenium RC 1.03 on Mac OS X 10.6.4. I'm starting the SeleniumServer using the following shell script:

cd ~/Selenium/selenium-server-1.0.3/
java -jar selenium-server.jar
and calling it from inside ...

31. Webdriver showModalDialog    stackoverflow.com

We are using webdriver for our functional tests. But our application uses the showModalDialog JS function a lot to open a popup. When we try to test this functionality with webdriver ...

32. Selenium Web driver and selenium RC    stackoverflow.com

Is there a simple way i can convert my existing selenium RC scripts into the Webdriver format?

33. Java export missing from Selenium IDE 1.0.9    stackoverflow.com

I am new to Selenium. I am using Firefox and trying to export the test case out to a Java file, but the option for Java is missing from the ...

34. how-to use addCustomRequestHeader properly    stackoverflow.com

I'm trying to add headers into my HTTP request for a particular test case. That's very important since I'm trying to test an application meant to be used in mobile phones. ...

35. selenium java issue    stackoverflow.com

Hi I was unable to figure out an issue. The method testTest1() was not executing. it should open yahoo.com .

package example1;

import org.testng.annotations.*;

import com.thoughtworks.selenium.*;

import java.util.regex.Pattern;


public class SimpleTest extends SeleneseTestCase {

   ...

36. onmouseover() doesn't work when using to openning a swf in Selenium Test    stackoverflow.com

In Selenium test, we want to use onmouseover for an text to open a swf with container. It asserts true in Junit at Selenium Test but it didn't actually work. Normally if we ...

37. selenium java ant run    stackoverflow.com

I know run_in_parallel and run_in_sequence when using Ruby - Selenium How can we run selenium tests using JAVA in parallel or sequence using ant run command ?

38. Selenium 2 WebDriver to use Custom Profile    stackoverflow.com

I'm trying to automate the interaction with a website that generates documents with MIME type application/vnd.wap.xhtml+xml. I am using Selenium 2, the WebDriver and the FirefoxProfile. Because Firefox does not handle the ...

39. Selenium starting issue    stackoverflow.com

I'm getting issue in starting selenium. Actually my thread class has selenium.start() in run() method. So when I'm using below lines of code,

//some another class

ScrapeThread nidleThread = new ScrapeThread("nidleThread");

Thread scraper = ...

40. Problem in starting selenium    stackoverflow.com

I'm getting issue in starting selenium. Actually my thread class has selenium.start() in run() method. So when I'm using below lines of code,

//some another class
class someclass{

    ScrapeThread nidleThread ...

41. Ant task for selenium script    stackoverflow.com

I have one test script I am using Java, JUnit, Slenium RC .......... I want run this script using ant command ....... please tell me how to write a ant task for ...

42. why selenium.isConfirmationPresent() returns true after using chooseCancelOnNextConfirmation    stackoverflow.com

I am having a code like the following selenium.chooseCancelOnNextConfirmation(); selenium.click("deleteRequest");// confirm dialog will be displayed on clicking the button System.out.println("is confirmation present "+selenium.isConfirmationPresent()); Eventhough i am using selenium.chooseCancelOnNextConfirmation(), please let me know why selenium.isConfirmationPresent() returns ...

43. How to locate a parent element which contains another element    stackoverflow.com

For example: I have the following structure:

<td>  
  <a>  
  <input id="MyID1">  
</td>

<td>  
  <a>  
  <input id="MyID2">  
</td>  

<td> ...

44. how to write test case in java    stackoverflow.com

hi I created one class ABC.java, and there is one constructor ABC() as follows:

 public class ABC {

        private static String ...

45. How to close a tab and open a new tab using Selenium RC    stackoverflow.com

I'm working on selenium RC java. In my test case, I have to close a tab and then open a new tab in the same test case. Can anyone please tell ...

46. How to capture a remote website using Java Selenium    stackoverflow.com

can anyone tell me how I can capture a webpage using Java Selenium? With an example....

47. selenium WebDriver StaleElementReferenceException    stackoverflow.com

i get this error when running my tests: org.openqa.selenium.StaleElementReferenceException: Element is no longer attached to the DOM any idea on how to solve the above exception? this happen in my grid which has a ref ...

48. How to select any random value from a dropdown?    stackoverflow.com

I am working on selenium using Java. In my application I want to select any random value from the dropdown. Please tell how is it possible?

49. Use Selenium RC directly or Selenium with Robot framework     stackoverflow.com

I have to admit that I fell in love with Selenium for its record-and-play feature as well as the testcase generation functionality for those recorded actions from the IDE. But ...

50. SeleneseTestCase is deprecated - how to call verify* methods?    stackoverflow.com

When I use the code generated by the JUnit 4 formatter in the Selenium IDE, I get warnings that the class SeleneseTestCase is deprecated - makes sense since it's supposed to ...

51. java web scrapper    stackoverflow.com

What is the best library for java web scrapper? I know following choices: 1. Selenium 2. HTMLUnit 3. Lobo browser I need to select one option to build scrapper for one scalable project. ...

52. Selenium IDE - no Java option available in the options    stackoverflow.com

In the past I have seen that there was an option to export testcases to Java in Selenium IDE. But when I installed Selenium IDE now, I do not see any ...

53. Is it worth to use Selenium com.thoughtworks.selenium.Wait class for waiting?    stackoverflow.com

Selenium has class com.thoughtworks.selenium.Wait for convinience. I use it in next way:

public void waitForElement(final String locator){
    Wait a = new Wait(){
     ...

54. How to implement Test Suite for Java Selenium tests    stackoverflow.com

I would like to call my Selenium tests, written in Java (@Test annotated) from one class. Is there option make it class as kind of Test Suite,perhaps annotated appropriately? thanks.

55. How to continue execution when Assertion is failed    stackoverflow.com

I am using Selenium RC, TestNG, java with eclipse. I have the following code snippet:

assertTrue(selenium.isTextPresent("Please enter Email ID"));
assertTrue(selenium.isTextPresent("Please enter Password"));
First assertion was failed and execution was stopped. But I want to ...

56. Java, Selenium and getXpathCount    stackoverflow.com

I am using Java to modify Selenium RC test cases.

package com.example.tests;

import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.util.regex.Pattern;

public class TestCase extends SeleneseTestCase {        

   ...

57. Integration with Robot framework's keyword management for Selenium Object Pattern Design    stackoverflow.com

I have been shopping for tools for UI automation quite a while. And, the reason being so cautious is to prevent from shooting myself in the foot. The link ...

58. Selenium 2: Detect content type of link destinations    stackoverflow.com

I am using the Selenium 2 Java API to interact with web pages. My question is: How can i detect the content type of link destinations? Basically, this is the background: Before ...

59. A good working example of Selenium2 and webdriver    stackoverflow.com

I've been using selenium 1, but now want to migrate to selenium2/webdriver. To be honest, I find a little bit difficult to start with selenium2/webdriver. In essence I don't know how ...

60. Structuring Selenium RC within a two-war project?    stackoverflow.com

I have a project which needs to deploy multiple wars on a tomcat instance. My first thought for structuring selenium is to create a downstream jenkins build that runs selenium tests ...

61. NullPointerException during using verifyTrue(boolean)    stackoverflow.com

I am using Selenium with Java, TestNG. My java code is as follows: public static SeleneseTestCase seleneseTestCase; (class level variable)

@Test(groups = {"All Blank"})
    public void a() throws Exception {
 ...

62. How to set Proxy Configuration in java code    stackoverflow.com

I'm trying to program in Java a class to start my Selenium Server in case it is down for some reason. I found very good help here: http://www.testingexcellence.com/how-to-start-selenium-server-with-java-code/ I see ...

63. Compare two strings in selenium    stackoverflow.com

I need to take value from row from page my code is

String bname1 = selenium.getText("//table[@id='bank']/tbody/tr[3]/td[2]");
assertEquals(bname1,"HDFC");
if(bname1=="HDFC") {
    System.out.println("Bank name is:"+bname1);
} else {
    System.out.println("Bank name not found");
}
System.out.println(bname1);
Result: Bank name ...

64. Null pointer exception in selenium RC Using java    stackoverflow.com

I wrote two Methods File name Login.java:

public int multiply(int x, int y) {
    return x * y;
}

public void news(){
    selenium.open("http://10.0.0.33:8080/Olio/");       ...

65. Difference between webdriver.get() and webdriver.navigate()    stackoverflow.com

What is the difference between get() and navigate() methods? Does any of this or maybe another method waits for page content to load? What do I really need is somehing likeselenium`s 1.0 WaitForPageToLoad ...

66. My approach to webderiver    stackoverflow.com

I started using webdriver not long ago. My approach is as follows:

public class PageObjectRepresentationClass {
    protected WebDriver driver;  
    public PageObjectRepresentationClass(WebDriver driver){
   ...

67. Selenium testing and emma code coverage    stackoverflow.com

Is there a way to get the code coverage when running selenium testing? The problem here is selenium is invoking the UI directly instead of the real source which UI component ...

68. Webdriver + HtmlUnitDriver + Java + Drop down    stackoverflow.com

I'm new to this forum and i'm kinda new to Selenium and everything around it. I'm a little familiar with Java, but i'm certainly not a pro I know that there a ...

69. not equal in selenium using java    stackoverflow.com

How can i use not equal in selenium using java eg if(num!=""){ .... } Now am getting errors,pls help me

70. How to select radio button when two or three radio buttons are there, using selenium    stackoverflow.com

I am looking for selenium code using java on how to select a particular radio button when multiple radio buttons are there in a form. For one radio button it is Ok ...

71. notnull checking in selenium    stackoverflow.com

String uid = selenium.getTable("bc."+i+"."+0);

System.out.println(uid);

int bcid = Integer.parseInt(uid);

if(uid != "' '"){   

    selenium.type("bcname", s.getCell(0, i).getContents()); 

    }else{

     System.out.println("Not edited");  ...

72. What is wrong with the below selenuim 2/webdriver test?    stackoverflow.com

I have trouble automating a simple JSF login page that takes 4 inputs (client code, system code, user and password) and takes to the administration page. The below test is behaving ...

73. driver.wait() throws IllegalMonitorStateException    stackoverflow.com

All the variations of wait(...) are throwing the below exception from the following code. What am I doing wrong?

java.lang.IllegalMonitorStateException
    at java.lang.Object.wait(Native Method)
    at java.lang.Object.wait(Object.java:485)
  ...

74. selenium2 - java    stackoverflow.com

when i'm using selenium rc i used waitForPageToLoad method but in WebDriver i'm unable to find method for wait. is there any way to achieve this? i know webDriver allows wait ...

75. isElementPresent in selenium 2.0    stackoverflow.com

Hello all I am using webdriver so if I want to use selenium;s rc function isElementPresent I have to emulate selenium rc so I do something like this:

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriverBackedSelenium;
import org.openqa.selenium.WebElement;
import ...

76. Workaround to "selectFiles" function call on Flash object    stackoverflow.com

I'm more of a server-side and javascript programmer. I have never done much with Flash. I have a robust html form based on flash based swfuploader and I need to test ...

77. Selenium 2: Open link in new tab and close tabs    stackoverflow.com

I want to be able to open a link in a new tab in Selenium 2. Also i want to close the tab when i am finished interacting with the page. ...

78. How can Selenium RC process dynamic rows?    stackoverflow.com

I have a table similar to the following: Part #           Price      Status
...

79. Selenium 2.0 : Element is not currently visible    stackoverflow.com

I am using Selenium 2.0b3 Java API with FirefoxDriver. When I fill a form, checkboxes are added to the page depending the forms inputs. I to simulate a click on those ...

80. Selenium 2: something wrong with code “driver.findElement(By.name("username")).sendKeys("");”    stackoverflow.com

I use the code

driver.findElement(By.name("username")).sendKeys("name");
driver.findElement(By.name("password")).sendKeys("12345");
to login to a website. Sometimes it will work, sometimes it won't, the error given is
Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to ...

81. Newbie question regarding Selenium    stackoverflow.com

I just started learning Selenium, and would like to try a simple example. However, I get the following exception when I run the code:

Exception in thread "main" java.lang.NoClassDefFoundError: com/gargoylesoftware/htmlunit/WebWindowListener
Does anyone know how ...

82. Automating search functionality using Selenium - Java    stackoverflow.com

I need to automate search functionality as below: Search string = (X* OR "Y") AND Z On entering this search system should assert the result. My problems are:
1) How to make precedence among ...

83. Trouble Installing Selenium RC Java Client Driver    stackoverflow.com

Hey guys, newb question here. I'm trying to set up Selenium RC with Eclipse, but when I download the .zip from the SeleniumHQ website it comes with several files included. Which ...

84. How to deal with inheritance in PageObjects pattern of WebDriver?    stackoverflow.com

Could please anybody suggest a way to deal with Inheritance regarding Page Objects pattern ? For instance, page objects need to share properties and methods.

public class LoginPage extends SuperPage
public class SuperPage extends ...

85. How does @CacheLookup work in WebDriver?    stackoverflow.com

I'm not sure that I understand the caching principle :

@CacheLookup
@FindBy(how = How.ID, using = namespace + signifLvl)
private WebElement sigLvl;
If we use this Annotation way, ElementLocator is being used and the ...

86. Selenium, Java, waitForCondition    stackoverflow.com

I want to check the following (on ie8): After clicking on a link, popup window is launched, then I want to check if flash content inside has loaded. For some reason waitForPopUp does ...

87. AssertionError Null selenium Test    stackoverflow.com

Hello I am with the following test with selenium, but I'm having to run it an error:

public class TestExemplo extends SeleneseTestNgHelper {
    @Test public void testUntitled() throws Exception ...

88. How to use WebDriver / Selenium 2 LoadComponents in PageObjects pattern?    stackoverflow.com

I have a hard time to get used to the WebDriver PageObject pattern. Please share your experience and ways of using PageObjects pattern and loadableComponents. As PageObject represents usually a component or ...

89. Selenium.getText() problem    stackoverflow.com

Hope someone can help me here? Having an issue getting text that's located inside a tag but After another tag...

<li><b>**Duration Held:**</b> 5 Years </li>
I need to return the "5 Years" part ...

90. Selenium, minimizing repetitious code    stackoverflow.com

The selenium tests I'm gonna be doing are basically based on three main steps, with different parameters. These parameters are passed in from a text file to the test. this allows ...

91. Resilient design of application that have a module that crashes randomly    stackoverflow.com

Question: How to design an java application around calls that hang randomly? Situation: I have a java application which is in fact a series of selenium 2 tests using a Java API. ...

92. Using Chrome Driver with Selenium 2    stackoverflow.com

I'm trying to use Chrome Drive to execute some of my tests, which are working perfectly with Firefox, but I'm not being able to execute them, I'm already verified the requirements, ...

93. Selenium captureNetworkTraffic pass value to string    stackoverflow.com

I was wondering how to use Selenium.captureNetworkTraffic to capture HTTP requests then parse out a value to pass in a query string. Upon launching the application under test generates a UniqueID. ...

94. WebDriver open new tab    stackoverflow.com

I have trawled the web and the WebDriver API. I don't see a way to open new tabs using WebDriver/Selenium2.0 . Can someone please confirm if I am right? Thanks, Chris. P.S: The current ...

95. Selenium Test Suite: Failover test execution    stackoverflow.com

I have a test suite written up in Java using Selenium-RC and TestNG, per -

public class testSuite extends SelenestTestCase {

@BeforeTest 
... 
@Test
...
@Test
...
@AfterTest
...
To improve robustness, I need to implement a set ...

96. Selenium set speed execution test    stackoverflow.com

We use Selenium IDE to record the test. In the recorder we can change the speed execution and our tests pass. We should set the speed to SLOW. I use ANT for ...

97. WebDriver: get HTTP Response Code    stackoverflow.com

I write Tests with Selenium2/WebDriver and want to test if HTTP Request returns an HTTP 403 Forbidden. Is it possible to get the http response status code with web driver?

98. Selenium is not filling in password attribute on form    stackoverflow.com

I have a very simple script for selenium to try and debug an issue I'm having. All I do is fill in the username, then fill in the password, then check ...

99. Selenium 2 and OperaDriver: java.net.BindException    stackoverflow.com

I downloaded the OperaDriver from https://github.com/operasoftware/operadriver/ and tried to run the simple/Example.java But I always get an exception "java.net.BindException: Address already in use"? I don't understand how this BindException can occur? ...

100. WebDriver: check if an element exists?    stackoverflow.com

How to check if an element exist with web driver? Is using a try catch really the only possible way?

boolean present;
try {
   driver.findElement(By.id("logoutLink"));
   present = true;
} catch (NoSuchElementException ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.