Announcement

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

    user-extensions...

    Hi isomorphic and all the team,

    You are providing a javascript file named "user-extensions.js" for selenium support. I would like to know, if the API defined there is reachable from java code like AutoTest API is.

    To be more concrete, I want to use the simple click and double click defined there. My plan is to use it the same way I use the AutoTest API.

    Thank you very much for the help
    Rodrigue

    #2
    That code runs in Selenium's scope. Accessing it is very complicated.

    If you want to write tests in Java, consider Selenium Remote Control instead.

    Comment


      #3
      thanks for the fast reply.

      I'm writing code from WebDriver a.k.a Selenium2.0, which encapsulates the Selenium Remote Control.

      The problem is that for some reason, the click doesn't work on the linux system when running the java tests. But all works properly when runing tests using the selenium ide there...

      That's why I came to this idea.

      Do you know, if there some issue on linux systems?

      Thanks
      Last edited by rlagoue; 9 Aug 2010, 15:15.

      Comment


        #4
        Please read this and this.

        Sanjiv

        Comment


          #5
          Thanks Sanjiv,

          I understood the locator strategy of SmartGwt so far. I have a utitility class to retrieve it (and call other functions on canvas etc...) with the help of a JavascriptExecutor instance. The example posted by Simon Stewart:

          Code:
           
          public void click() { 
              ((JavascriptExecutor) driver).executeScript( 
                  "arguments[0].click;", element); 
            }
          Would it work with SmartGwt. I ask it, because I couldn't find a method in the AutoTest.js and in the canvas class (in SmartGwt) that simulates a click action.

          I should also mention, that my code "webElement#click()" works correctly on my windows vista plattform. I just don't have the chance that our build server is a debian plattform.

          Thanks for any help
          Rodrigue
          Last edited by rlagoue; 9 Aug 2010, 15:41.

          Comment


            #6
            Smart GWT / SmartClient requires the full sequence of mousedown, mousedown followed by the click event in order to simulate a real click event.

            Similarly for doubleclick the sequence of mousedown, mouseup, click, mousedown, mouseup, click.

            Selenium natively does not do this hence the SmartGWT user-extensions.js adds this capability.

            In the second link I posted I ask Simon if WebDriver click() calls call the complete sequence of events and he says they do. You're seeing this on Vista but not on your linux box so I suggest you check with the WebDriver team. Please keep us posted.

            Sanjiv

            Comment


              #7
              Thanks for your reply...

              So I will check it with the WebDriver team...

              Rodrigue

              Comment


                #8
                Hi Sanjiv!

                I just came to idea to run a selenium test with a minimal TestCases on my linux Box. I just tested a simple query on google, and click on the more options link after the search results have been displayed.

                It works for it. So I would conclude it's definitely a issue with caused from smartgwt, perhaps the by SmartGwt generated DOM elements have a problem with clicks.

                Here are the steps of my tests again:
                1. load the app
                2. click on a menu on the left navigation panel. A new content is displayed in the main page.
                3. click on a button (ToolStrip) in the main panel. A Modal dialog form get displayed.
                4. Fill the form with test data.
                5. Submit the form.

                Steps 2 and 3 don't run. The click actions there do simply not execute.

                But if I click manually the menu the test should click in step 2, while the tests is waiting (I set a long timeout) for the main page to be drawn (what should occur after the click in step 2). The test move forward and then block at step 3, until I also click manually the ToolStripButton. After that the dialog is displayed, filled and then submitted as expected.

                If I don't click manually, the test will wait until the timeout ends, what meand the test has failed.

                It seems like the dom elements are referenced programmaticaly, but the call of the click method doesn't work for them.

                I should mention, that I face this problem on a linux debian lenny. On the windows machine, all works as expected.

                Any helps is really welcome.
                Rodrigue

                Comment


                  #9
                  Hi Isomorphic and Sanjiv,

                  As the automated test generated with the help of selenium ide works on the linux plattform, and the fact that the only difference between the tests written with webdriver is that the selenium ide has access to the "user-extensions.js" file. My idea would be to find a way to allow Webdriver to use this file like selenium ide does...

                  Do you have any idea?

                  Thanks for any help
                  Rodrigue

                  Comment

                  Working...
                  X