Announcement

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

    Selenium

    Hi,
    Can selenium testing tools be used with SmartClient/GWT ? With gwt-ext, i used to set the id of widget in order to have direct access to them from selenium command (locator).
    Is it possible to set id for all widget present in SmartClient/GWT ?
    Thanks.

    #2
    up

    SetId like with gwt-ext ?

    Comment


      #3
      ++

      GWT widgets provide the method "ensureDebugId" which seems not to work with SmartGWT.

      Is there a chance of making the method workable with one of the next SmartGWT releases?

      Thanks!

      Comment


        #4
        Is anyone here familiar with Selenium at the code level? (or is willing to do a little digging). Basically in order to support Selenium, the function for
        ID --> DOM lookup in Selenium needs to be overridden with a simple SmartClient specific function.

        Tools like Selenium IDE also support customization by pointing to a user defined JS file.

        My bandwidth is a little limited due to other tasks so if anyone can take the lead on this it would be great. Post here or email for details. Else I'll get to it in the order of priority relative to other tasks..

        Thanks,
        Sanjiv

        Comment


          #5
          Should be easy. From what I've read you need to add the SC ID function to user-extensions.js

          Something along the lines of

          Code:
          /**
           * Finds a SmartClient element based on the id
           * @param id SmartClient element id
           */
          PageBot.prototype.SCid = function(id, inDocument) {
            return inDocument.getElementById(id); //change this to the custom function
          }

          Comment


            #6
            Originally posted by mike.art1
            Should be easy. From what I've read you need to add the SC ID function to user-extensions.js

            Something along the lines of

            Code:
            /**
             * Finds a SmartClient element based on the id
             * @param id SmartClient element id
             */
            PageBot.prototype.SCid = function(id, inDocument) {
              return inDocument.getElementById(id); //change this to the custom function
            }
            I just did some experiments today.
            Apparently the problem is not the id but the trigger of events.
            That is I can (apparently) properly record all my actions, but when I rerun the tests while I'm seeing the fields correctly filled, my "clicks" are not working.

            Did someone find a solution?
            Using a 1000 bucks / mo. software is a no way, possibilities are somehow running tests in javascript or using some macro plugin and doing the checks manually.

            Comment


              #7
              See also this:
              http://clearspace.openqa.org/message/56726

              given that this is a pretty important requirement for us, do you would accept some patches to make gwt firebug friendly?
              I was thinking along the lines of putting a parameter somewhere to listen "soft" clicks from firebug.
              Not sure to understand well but maybe putting an optional (via the parameter) javascript onClick() listener on every canvas that fire a proper smartGwt click event.

              I'm looking at the Canvas.setupClickEvent() code

              Comment


                #8
                I found a workaround (for buttons) to be able to test with Selenium:

                make sure to assign ID to your buttons;
                yourButton.setID("AddUserBtn");

                then in selenium replace the XPath from the recorder (that use temporary id) with something like:
                //div[@eventproxy="AddUserBtn"]/table/tbody/tr/td

                and then replace click event with KeyPress using blank as Value.

                now it works fine.

                Comment


                  #9
                  Just a note that part of the underlying problem is that Selenium currently plays back a simplified event stream (click but not mouseup/mousedown). With other tools that do this, it's often possible to get a working record and playback by doing everything via the keyboard only when recording the test case.

                  Comment


                    #10
                    The problem is not about recording and replaying

                    Isomorphic , The real problem is not about having a way to record actions and replay them. It's about having the possibility to write by hands selenium commands (Mouse down/Mouse Up are part of it) in order to simulate all end users actions.
                    Uberto found a way to click a button through selenium commands, and to identify uniquelly a button by calling the setID method.
                    The question is :
                    Is there a setID method for all SmartGWT widgets objects ?
                    If yes it is possible to test SmartGWT with Selenium (not by recording and replaying but by writing the selenium commands directly) .
                    For ext/ Gwt-ext, i've found a framework based on selenium which help greatly to write functional tests. Every Ext widget has its own way to be accessed : http://code.google.com/p/kdev-wtf/

                    Sory for my english.

                    Comment


                      #11
                      SmartGWT does not provide a setID on every UI object, for example FormItems and MenuItems do not have a way to define the ID.

                      This makes it impossible to do automated testing with tools like Selenium.

                      There is at least one commercial product (from a company called SOASTA, a SmartClient partner) that claims to have a working solution, but I have not tried it (others have reported that the fees are very expensive).

                      I would also like to be able to use a free (or affordable) acceptance testing framework on my SmartGWT projects, but this is just not possible at the time being.

                      So what I do is use the Presenter-first pattern for my end-to-end testing, which reproduces user actions, but leaves all my specific SmartGWT code uncovered. I'm not very happy with the situation, but this seems to be the only thing one can do.

                      (About Presenter-first: http://www.atomicobject.com/pages/Presenter+First)

                      Comment


                        #12
                        Thanks for the Presenter-frst link

                        dfreire, I think that we, people who would like to use a free automated testing tool with Smartgwt, are not numerous enough for SmartGwt developper team.
                        But i insist that this is very important for the growth of SmartGWT comparing to ext-gwt, it main concurrent.


                        Originally posted by dfreire
                        SmartGWT does not provide a setID on every UI object, for example FormItems and MenuItems do not have a way to define the ID.

                        This makes it impossible to do automated testing with tools like Selenium.

                        There is at least one commercial product (from a company called SOASTA, a SmartClient partner) that claims to have a working solution, but I have not tried it (others have reported that the fees are very expensive).

                        I would also like to be able to use a free (or affordable) acceptance testing framework on my SmartGWT projects, but this is just not possible at the time being.

                        So what I do is use the Presenter-first pattern for my end-to-end testing, which reproduces user actions, but leaves all my specific SmartGWT code uncovered. I'm not very happy with the situation, but this seems to be the only thing one can do.

                        (About Presenter-first: http://www.atomicobject.com/pages/Presenter+First)

                        Comment


                          #13
                          Hi taxaw,
                          I know that the Isomorphic guys are communicating with the Selenium folks on this. I'm not sure what the status of things are. Hopefully we'll have an update soon.

                          Sanjiv

                          Comment


                            #14
                            Thanks Sanjiv for your answer

                            Hi Sanjiv,
                            thank you for your quick answer.
                            I was in the first group (see the smartclient forum) to ask to smartclient Developper to work with you for gwt version of Smartclient.
                            I manage a IT company and i'm the one who provide technical orientation to my developers because of my long experience (+10) as a java developper.
                            Quality Assurance is now a must for every serious software development project. And Selenium provides a wide range of tools for it : Selenium RC, Grid, CubicTest (a gui test designer for selenium)++++.
                            Selenium is the future of free QA Testing !
                            Because of my interest in SmartGwt and your work, i insist on the fact that Selenium compliance for Smartgwt is important for Smartgwt Growth.
                            This is why i wait before using Smartgwt in my projects.
                            Tank you.

                            Comment


                              #15
                              Hi,
                              we are also interested in possibility to run automated tests (selenium) on smartgwt applications.

                              Is there any progress yet?

                              Comment

                              Working...
                              X