Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Selenium TestRunnerDriver not working

    Hi

    I'm using SmartClient 10.0 power edition. Last updated in early November build.

    We are busy automating our tests. I've got the SmartClient record and playback working with Selenium IDE. And also stored a html test file that is working well.

    I'm now trying to automate it with com.isomorphic.autotest.TestRunnerDriver. I've been following the documentation but clearly I'm missing something.

    I've added the following code to a TomCat war project:

    Code:
    TestRunnerDriver testRunner = new TestRunnerDriver();
    
    testRunner.setHttpPort(80);
    testRunner.setBrowser("firefox");
    testRunner.setHttpTarget("http://adminonline.biz");
    testRunner.setUserExtensionsFile("C:\\Dev\\util-lib\\SmartClient_v100p_2014-10-07_PowerEdition\\smartclientSDK\\tools\\selenium\\user-extensions.js");
    testRunner.setNoEmail();
    testRunner.setMaximizeBrowser(true);
    testRunner.setTestRoot("/C:/Dev/workspace/billion/src/main/webapp/testfiles/");
    testRunner.setFiles(new String[] {"adminonlinetest1.rctest.html"});
    testRunner.setFileRoot("C:\\Dev\\workspace\\billion\\src\\main\\webapp\\");
    
    testRunner.run();
    When I trigger the code via webservice, the following logs are the output, but NO browser startes - basically nothing happen:
    07:02:08.397 DEBUG - Security checking request GET /billion-booking/controller/run-tests
    07:02:08.397 DEBUG - Not subject to any constraint
    === 2014-12-15 07:02:08,398 [c-10] INFO RequestContext - URL: '/billion-booking/controller/run-tests', User-Agent: 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36': Safari with Accept-Encoding header
    === 2014-12-15 07:02:08,399 [c-10] WARN TestRunnerConfiguration - Danger - ServletContext detected as org.apache.catalina.core.ApplicationContextFacade@166a9512
    === 2014-12-15 07:02:08,399 [c-10] INFO TestRunnerConfiguration - Detected webRoot as C:/Dev/workspace/billion/target/billion-booking
    === 2014-12-15 07:02:08,399 [c-10] INFO TestRunnerConfiguration - Detected fileRoot as C:\Dev\workspace\billion\src\main\webapp\
    === 2014-12-15 07:02:08,399 [c-10] WARN TestRunnerConfiguration - Both fileRoot and webRoot are set, but they are different! You may be able to modify server.properties to change webRoot.
    2014/12/15 07:02:08:401 CAT [INFO] SeleniumServer - Writing debug logs to selenium.log
    2014/12/15 07:02:08:401 CAT [INFO] SeleniumServer - Java: Oracle Corporation 23.7-b01
    2014/12/15 07:02:08:401 CAT [INFO] SeleniumServer - OS: Windows 8 6.2 amd64
    2014/12/15 07:02:08:402 CAT [INFO] SeleniumServer - vnull [null], with Core vnull [null]
    2014/12/15 07:02:08:403 CAT [INFO] HttpServer - Version Jetty/5.1.10
    2014/12/15 07:02:08:403 CAT [INFO] Container - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
    2014/12/15 07:02:08:404 CAT [INFO] Container - Started HttpContext[/selenium-server,/selenium-server]
    2014/12/15 07:02:08:404 CAT [INFO] Container - Started HttpContext[/,/]
    2014/12/15 07:02:08:405 CAT [INFO] SocketListener - Started SocketListener on 0.0.0.0:4444
    2014/12/15 07:02:08:405 CAT [INFO] Container - Started org.mortbay.jetty.Server@753c9a33
    === 2014-12-15 07:02:08,405 [c-10] INFO SeleniumServerHelper - Selenium server started
    2014/12/15 07:02:08:406 CAT [INFO] ThreadedServer - Stopping Acceptor ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=4444]
    2014/12/15 07:02:08:507 CAT [INFO] SocketListener - Stopped SocketListener on 0.0.0.0:4444
    2014/12/15 07:02:08:617 CAT [INFO] Container - Stopped HttpContext[/selenium-server/driver,/selenium-server/driver]
    2014/12/15 07:02:08:670 CAT [INFO] Container - Stopped HttpContext[/selenium-server,/selenium-server]
    2014/12/15 07:02:08:736 CAT [INFO] Container - Stopped HttpContext[/,/]
    2014/12/15 07:02:08:736 CAT [INFO] Container - Stopped org.mortbay.jetty.Server@753c9a33
    === 2014-12-15 07:02:08,736 [c-10] INFO SeleniumServerHelper - Selenium server stopped

    Any help will be highly appreciated. I tried everything and came to the end of what I must try.

    #2
    If I put the code in a main function and run it as standalone Java I get the following error:

    Code:
    public static void main(String[] args) {
    
       System.out.println("About to execute testRunner");
    
       try {
    
          System.out.println("Executed testRunner");
    
          TestRunnerDriver testRunner = new TestRunnerDriver();
    
          testRunner.setHttpPort(80);
          testRunner.setBrowser("firefox");
          testRunner.setHttpTarget("http://adminonline.biz");
          testRunner.setUserExtensionsFile("C:\\Dev\\util-lib\\SmartClient_v100p_2014-10-07_PowerEdition\\smartclientSDK\\tools\\selenium\\user-extensions.js");
          testRunner.setNoEmail();
          testRunner.setMaximizeBrowser(true);
                   testRunner.setTestRoot("/C:/Dev/workspace/billion/src/main/webapp/testfiles/");
          testRunner.setFiles(new String[] {"adminonlinetest1.rctest.html"});
                testRunner.setFileRoot("C:\\Dev\\workspace\\billion\\src\\main\\webapp\\");
    
          testRunner.run();
    
       } catch (Exception e) {
          e.printStackTrace();
    }
    
    }
    Here's the logs with error stacktrace:


    About to execute testRunner
    Executed testRunner
    ISC: Configuring log4j from: file:/C:/Dev/workspace/billion/target/classes/log4j.isc.config.xml
    === 2014-12-15 07:15:22,936 [main] INFO ISCInit - Isomorphic SmartClient/SmartGWT Framework - Initializing
    === 2014-12-15 07:15:22,942 [main] INFO ConfigLoader - Attempting to load framework.properties from CLASSPATH
    === 2014-12-15 07:15:23,046 [main] INFO ConfigLoader - Successfully loaded framework.properties from CLASSPATH at location: jar:file:/C:/Users/henkiem/.m2/repository/com/isomorphic/isomorphic-core-rpc/10.0p_2014-11-12/isomorphic-core-rpc-10.0p_2014-11-12.jar!/framework.properties
    === 2014-12-15 07:15:23,047 [main] INFO ConfigLoader - Attempting to load project.properties from CLASSPATH
    === 2014-12-15 07:15:23,047 [main] INFO ConfigLoader - Unable to locate project.properties in CLASSPATH
    === 2014-12-15 07:15:23,052 [main] INFO ConfigLoader - Successfully loaded isc_interfaces.properties from CLASSPATH at location: jar:file:/C:/Users/henkiem/.m2/repository/com/isomorphic/isomorphic-core-rpc/10.0p_2014-11-12/isomorphic-core-rpc-10.0p_2014-11-12.jar!/isc_interfaces.properties
    === 2014-12-15 07:15:23,052 [main] INFO ConfigLoader - Attempting to load server.properties from CLASSPATH
    === 2014-12-15 07:15:23,056 [main] INFO ConfigLoader - Successfully loaded server.properties from CLASSPATH at location: file:/C:/Dev/workspace/billion/target/classes/server.properties
    === 2014-12-15 07:15:23,063 [main] INFO Logger - Logging system started.
    === 2014-12-15 07:15:23,063 [main] INFO ISCInit - No ServletContext available yet - using container IO for now
    === 2014-12-15 07:15:23,064 [main] INFO ISCInit - Isomorphic SmartClient/SmartGWT Framework (v10.0p_2014-11-12/PowerEdition Deployment 2014-11-12) - Initialization Complete
    === 2014-12-15 07:15:23,065 [main] INFO TestRunnerConfiguration - Detected webRoot as __USE_CONTAINER__
    === 2014-12-15 07:15:23,065 [main] INFO TestRunnerConfiguration - Detected fileRoot as C:\Dev\workspace\billion\src\main\webapp\
    === 2014-12-15 07:15:23,065 [main] INFO TestRunnerConfiguration - Setting container fallback root directory to C:\Dev\workspace\billion\src\main\webapp\
    log4j:WARN No appenders could be found for logger (org.openqa.selenium.server.SeleniumServer).
    log4j:WARN Please initialize the log4j system properly.
    log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
    === 2014-12-15 07:15:23,208 [main] INFO SeleniumServerHelper - Selenium server started
    Exception in thread "main" java.lang.NoSuchMethodError: com.isomorphic.autotest.TestRunnerHTMLLauncher.runHTMLSuite(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/io/File;JZ)Ljava/lang/String;
    at com.isomorphic.autotest.TestRunnerHelper.testRctest(TestRunnerHelper.java:291)
    at com.isomorphic.autotest.TestRunnerHelper.processSeleniumTests(TestRunnerHelper.java:128)
    at com.isomorphic.autotest.TestRunnerHelper.testAll(TestRunnerHelper.java:110)
    at com.isomorphic.autotest.TestRunner.testAll(TestRunner.java:252)
    at com.isomorphic.autotest.TestRunnerLauncher.launch(TestRunnerLauncher.java:373)
    at com.isomorphic.autotest.TestRunnerDriver.run(TestRunnerDriver.java:65)
    at za.co.billiongroup.utils.SmokeTest1.main(SmokeTest1.java:29)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

    Comment


      #3
      At a glance, you either have two versions of the same jars in your classpath, or you are doing something like building with one set of jars while deploying with an older set.

      Also, if you are not aware, your Support is expired.

      Comment

      Working...
      X