Announcement

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

    Selenium RemoteWebDriver in SmartGWT

    Hello!

    I've been evaluating the integration of selenium 2 and SmartGWT before deciding to migrate to SmartGWT plattform, and I successfully did a PoC using SmartClientFirefoxDriver. However, I haven't been able to find any references to the RemoteWebDriver selenium class equivalent in SmartGWT library. Is there no way to do remote testing using Selenium and SmartGWT, or does Isomorphic provide a way to do remote testing with selenium and SmartGWT? Which class should be used to do so?

    I am using SmartClient_v90p_2014-01-13 Evaluation version

    Greetings

    #2
    RemoteWebDriver support

    Hi,

    Currently there isn't a method to directly use RemoteWebDriver but The SmartClientWebDriver implementations currently use the Selenium 2 implementations of RemoteWebDriver behind the scenes so these may be able to fulfil your requirements. If you have a need to directly inject a RemoteWebDriver please respond to this thread with a little more detail of your use case and we will investigate further.

    Comment


      #3
      RemoteWebDriver

      Hi again,

      My spcific question is, how can i acomplish this using SmartClientFirefoxDriver:

      Code:
      File profile_dir=new File(firefox_profile);
      FirefoxProfile profile = new FirefoxProfile(profile_dir);
      DesiredCapabilities capabilities = DesiredCapabilities.firefox();
      capabilities.setCapability(FirefoxDriver.PROFILE, profile);
      this.driver=new RemoteWebDriver(new URL(selenium_grid_ip), capabilities);
      To sum up, I want to (given a grid ip and a firefox profile) run my tests on a Selenium Node using SmartGWT,

      Thanks in advance

      Comment


        #4
        RemoteWebDriver

        We will investigate extending the support classes to allow injection of a RemoteWebDriver instance. Please watch this thread and I'll update it when this becomes available.

        Comment


          #5
          Will do, thanks!

          Comment


            #6
            RemoteWebDriver support

            A provisional version of RemoteWebDriver support is now available in the the current daily build (SmartClient_v90p_2014-01-27). A class named SmartClientRemoteWebDriver has been implemented with a constructor which takes an instance of RemoteWebDriver. This should allow you to inject your pre-configured instance.

            Please advise if this is suitable. If not, it would be appreciated if you could provide a small example with instructions on how to recreate any issues.

            Comment


              #7
              SmartClientRemoteWebDriver

              SmartClientRemoteWebDriver seems to add the characters "null" to the front of my testcase URL. For example the following test case works just fine:

              Code:
              DesiredCapabilities capabilities = getCapabilities(method);
              URL sauceLabsURL = new URL(PARAM_SAUCELABS_URL);
              RemoteWebDriver remoteDriver = new RemoteWebDriver(sauceLabsURL, capabilities);
              The resulting URL in my address bar is:
              http://project.company.cloudbees.net/

              While SmartClientRemoteWebDriver used like this:

              Code:
              DesiredCapabilities capabilities = getCapabilities(method);
              URL sauceLabsURL = new URL(PARAM_SAUCELABS_URL);
              RemoteWebDriver  remoteDriver = new RemoteWebDriver(sauceLabsURL, capabilities);
              [b][i]SmartClientRemoteWebDriver driver = new SmartClientRemoteWebDriver(remoteDriver);[/i][/b]
              Results in the URL:
              nullhttp://project.company.cloudbees.net/

              The easy answer is to skip SmartClientRemoteWebDriver and continue using RemoteWebDriver. Why is "null" being added to the URL?
              Last edited by shane.gramlich; 6 Mar 2014, 03:08. Reason: formating

              Comment


                #8
                null in URL

                This is because, for the purpose of supporting our SeleneseRunner, the SCWD classes use setBaseUrl() to navigate to the test application and then work with relative URLs. Since you are not setting this, it is defaulting to Null and hence you are seeing this problem. We will investigate further how to resolve this but a simple workaround would just be the setBaseUrl(""), or set it and use relative URLs in your tests.

                Comment


                  #9
                  SmartClientRemoteWebDriver

                  Yes! Confirmed, you are correct and thank you

                  Code:
                  DesiredCapabilities capabilities = getCapabilities(method);
                  URL sauceLabsURL = new URL(PARAM_SAUCELABS_URL);
                  remoteDriver = new RemoteWebDriver(sauceLabsURL, capabilities);
                  driver = new SmartClientRemoteWebDriver(remoteDriver);
                  driver.setBaseUrl("");
                  This was a better solution, relative paths restrict us to testing 1 domain. I'll subscribe to the thread for new developments.

                  Comment

                  Working...
                  X