Announcement

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

    SmartClientWebDriver throwing exception

    I'm using SmartClient_v90p_2013-11-26 and I'm trying to run some Selenium tests with the SmartClientWebDriver. For that, Ive added all WEB-INF/lib JARs to my project as well as the Selenium ones.

    The code I'm trying is pretty simple:

    [code]
    SmartClientWebDriver driver = new SmartClientFirefoxDriver();
    driver.get("https://...");
    [code]

    On the SmartClientWebDriver instantiation I get the following exception - just after the Firefox window is open:

    Exception in thread "main" java.lang.AbstractMethodError: com.isomorphic.webdriver.SmartClientFirefoxDriver.getKeyboard()Lorg/openqa/selenium/interactions/Keyboard;
    at org.openqa.selenium.interactions.Actions.<init>(Actions.java:41)
    at com.isomorphic.webdriver.ScActions.<init>(ScActions.java:48)
    at com.isomorphic.webdriver.SmartClientWebDriver.<init>(SmartClientWebDriver.java:70)
    at com.isomorphic.webdriver.SmartClientFirefoxDriver.<init>(SmartClientFirefoxDriver.java:52)
    at Test.main(Test.java:8)

    I didn't find anything related to this error and very few information about configuring/using SmartClientWebDriver.

    Is there anything that must be configured that I'm not doing?

    When I change to use SmartClientChromeDriver or SmartClientIEDriver I get another exception:

    Exception in thread "main" java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see http://code.google.com/p/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://code.google.com/p/chromedriver/downloads/list

    Any help?

    Thanks
    Last edited by atumolin; 2 Dec 2013, 04:20.

    #2
    Webdriver library issues

    In order to run webdriver tests, the libraries in lib-WebDriverSupport are required. The main smartclient libraries are not required and may cause conflicts. The webdriver tests run in a separate virtual machine so this shouldn't be a problem. If you're running then in an IDE, we would recommend using a different project for your webdriver tests to prevent classpath contamination.

    The error you describe is caused by a mismatch between the version of isomorphic_webdriver.jar and selenium_java.jar. There was a minor tweak in the selenium API around version 2.34.0 where just one interface was moved from one package to another. The most recent daily build should be packaged with 2.37.0 and the corresponding isomorphic_webdriver.jar. Please provide information about which library versions you are using if your problems persist.

    Drivers for Chrome and IE are not included in the standard selenium libraries and change regularly. The additional libraries are available directly from Selenium if you require support for your versions of these browsers. Firefox is our recommended browser for webdriver testing as support for it tends to be more stable.

    Comment


      #3
      Thanks for your help. It worked now, or at least the SmartClientWebDriber instance is created.

      However, later on my test I try this command out:

      Code:
      driver.findElement(ByScLocator.scLocator("scLocator=//VLayout[ID='casesList']/member[Class=HLayout||index=0||length=8||classIndex=0||classLength=4]/member[Class=LinkButton||index=3||length=4||classIndex=1||classLength=2||roleIndex=1||roleLength=2||title=New%20Case||scRole=button]/")).click();
      And I get this exception:

      Code:
      Exception in thread "main" org.openqa.selenium.WebDriverException: waiting for evaluate.js load failed
      Command duration or timeout: 10.22 seconds
      Build info: version: '2.31.0', revision: '1bd294d', time: '2013-02-27 20:53:56'
      System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_09'
      Session ID: d6766eef-56e1-44c9-a571-0efabffc6ccc
      Driver info: org.openqa.selenium.firefox.FirefoxDriver
      Capabilities [{platform=XP, databaseEnabled=true, cssSelectorsEnabled=true, javascriptEnabled=true, acceptSslCerts=true, handlesAlerts=true, browserName=firefox, browserConnectionEnabled=true, nativeEvents=true, webStorageEnabled=true, rotatable=false, locationContextEnabled=true, applicationCacheEnabled=true, takesScreenshot=true, version=25.0.1}]
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
      	at java.lang.reflect.Constructor.newInstance(Unknown Source)
      	at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:187)
      	at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
      	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554)
      	at org.openqa.selenium.remote.RemoteWebDriver.executeScript(RemoteWebDriver.java:463)
      	at com.isomorphic.webdriver.ByScLocator.findElement(ByScLocator.java:101)
      	at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:299)
      	at com.isomorphic.webdriver.SmartClientWebDriver.findElement(SmartClientWebDriver.java:779)
      	at Test.main(Test.java:34)
      Caused by: org.openqa.selenium.remote.ErrorHandler$UnknownServerException: waiting for evaluate.js load failed
      Build info: version: '2.31.0', revision: '1bd294d', time: '2013-02-27 20:53:56'
      System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_09'
      Driver info: driver.version: unknown
      	at <anonymous class>.injectAndExecuteScript/p(file:///C:/Users/atumolin/AppData/Local/Temp/anonymous6509806216560013598webdriver-profile/extensions/fxdriver@googlecode.com/components/driver_component.js:8191)
      	at <anonymous class>.fxdriver.Timer.prototype.runWhenTrue/g(file:///C:/Users/atumolin/AppData/Local/Temp/anonymous6509806216560013598webdriver-profile/extensions/fxdriver@googlecode.com/components/driver_component.js:388)
      	at <anonymous class>.fxdriver.Timer.prototype.setTimeout/<.notify(file:///C:/Users/atumolin/AppData/Local/Temp/anonymous6509806216560013598webdriver-profile/extensions/fxdriver@googlecode.com/components/driver_component.js:382)
      Do you know what this could be?

      One other minor problem is that when I run the "driver.get(...)" command the URL is starting with the "null" string, which is not causing the URL to open. Have you ever seen it?

      Thanks

      Comment


        #4
        Hi,

        Any news on this issue? I'm having the same problem here, so please let me know of any progress.

        Thanks

        Comment


          #5
          Webdriver library issues

          Looking at your output, I see that it is from the 2.31.0 version of the selenium library. The latest daily builds are now released with 2.37.0. Could you please confirm if you are using this. Please check that you still don't have a copy of the old 2.31.0 jar on your classpath.

          Could you please respond with the version of SmartClient/SGWT that you are using currently?
          Last edited by ianr; 5 Dec 2013, 02:24.

          Comment


            #6
            Hi,

            Thanks for your help.

            I'm using SmartClient_v90p_2013-11-21 and I did what you suggested but I'm getting another error message:

            Code:
            java.lang.NoClassDefFoundError: org/openqa/selenium/HasInputDevices
            	at java.lang.ClassLoader.defineClass1(Native Method)
            	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
            	at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
            	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
            	at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
            	at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
            	at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
            	at java.security.AccessController.doPrivileged(Native Method)
            	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
            	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
            	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
            	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
            Caused by: java.lang.ClassNotFoundException: org.openqa.selenium.HasInputDevices
            	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
            	at java.security.AccessController.doPrivileged(Native Method)
            	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
            	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
            	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
            	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
            	... 12 more
            Exception in thread "main"
            Apparently this error was reported here: http://forums.smartclient.com/showthread.php?t=28602

            What makes it even stranger is that I did some tests on Linux and I was able to get it working. I took the same steps on windows (created a project from scratch) and I got the error again. So in summary, I can run tests with the WebDriver on Linux but not on Windows. Does that help in any way?

            Thanks

            Comment


              #7
              Selenium JAR

              Please upgrade to a later version of SmartClient and verify that the selenium-java-xxxx.jar in lib-WebDriverSupport is 2.37.0 (or later). There was a slight change the API and changes to accomodate this cause incompatibility with earlier versions.

              Comment


                #8
                It worked

                Thank you very much for your help. It worked with SmartClient_v90p_2013-12-07, with selenium-java-2.37.0.

                Comment


                  #9
                  Selenium JAR

                  Great! Glad to be of assistance

                  Comment


                    #10
                    Exception in thread &quot;main&quot; org.openqa.selenium.WebDriverException: java.lang.NullPoin

                    Hi;

                    I am trying to get familiar with selenium webdriver. I wrote the first piece of code on my XP machine.
                    The code just open the firefox browser and get the google.com page. Here it is:

                    -------------------------------------------------------------
                    import org.openqa.selenium.WebDriver;
                    import org.openqa.selenium.firefox.FirefoxDriver;


                    public class Login {

                    public static void main(String[] args) {

                    WebDriver driver = new FirefoxDriver();
                    driver.get("http://www.linkedin.com");

                    }
                    }
                    --------------------------------------------------------------
                    I run it and got the following response:


                    --------------------------------------------------------------
                    Exception in thread "main" org.openqa.selenium.WebDriverException: java.lang.NullPointerException
                    Build info: version: '2.39.0', revision: 'ff23eac', time: '2013-12-16 16:12:12'
                    System info: host: 'SCANLAG788569', ip: '10.162.240.145', os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1', java.version: '1.6.0_18'
                    Driver info: driver.version: FirefoxDriver
                    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:138)
                    at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:250)
                    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:110)
                    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:197)
                    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:190)
                    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:186)
                    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:99)
                    at Login.main(Login.java:9)
                    Caused by: java.lang.NullPointerException
                    at org.openqa.selenium.net.NetworkUtils.obtainLoopbackIp4Address(NetworkUtils.java:82)
                    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.determineNextFreePort(NewProfileExtensionConnection.java:175)
                    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:86)
                    ... 7 more

                    Comment


                      #11
                      Webdriver library issues

                      You're running a non-smartclient version of webdriver against a non-smartclient website so this isn't really an appropriate place to bring your issues. That being said, a quick search suggests that it is related to ipv6: http://code.google.com/p/selenium/issues/detail?id=5564

                      Hope this helps. Please directly contact the selenium/webdriver forums for non-smartclient related issues in the future.

                      Comment

                      Working...
                      X