Menu

Run selenium test with jsystem

Help
2009-07-31
2012-09-15
  • Roy de Kleijn

    Roy de Kleijn - 2009-07-31

    Dear All,

    I create a test using Selenium RC & junit & eclipse. It seems like that the test runs, but the browser window stay blank.
    Anyone can help?

    Test Script:
    package org.jsystem.quickstart;
    import org.junit.*;

    import com.thoughtworks.selenium.DefaultSelenium;
    import com.thoughtworks.selenium.Selenium;

    import junit.framework.SystemTestCase4;
    public class GoogleTest extends SystemTestCase4{
    private Selenium selenium;

    @Test public void setup(){
    selenium = new DefaultSelenium("ipaddress", 4444, "*firefox", "http://www.google.com");
    selenium.start();
    }

    @Test public void GoogleSearch(){
    selenium.open("http://www.google.com");
    //Detect field by name
    //Can also detect field by id
    if(selenium.isElementPresent("name=q")){
    selenium.type("q", "Testing");

    }
    }

    public void tearDown(){
    //selenium.stop();
    }
    }

    Regards,
    Roy

     
    • Roy de Kleijn

      Roy de Kleijn - 2009-07-31

      The browser tries to open: http://localhost:4444/selenium-server/core/Blank.html?start=true for some reason.

      I try to run the test on a vmware appliance which is on a server.

       
  • Anonymous

    Anonymous - 2009-11-23

    Your example gives me

    java.lang.NullPointerException

    at com.roche.cit1k.SeleniumExample3.GoogleSearch(SeleniumExample3.java:18)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
    l.java:25)

    at java.lang.reflect.Method.invoke(Method.java:597)

    at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)

    any suggestions why? Thanks

     
  • Anonymous

    Anonymous - 2009-11-23

    I've replaced ipaddress with localhost

     
  • Anonymous

    Anonymous - 2009-11-23

    should

    @Test public void setup(){

    not be

    @Before public void setup(){

     

Log in to post a comment.