Announcement

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

    Selenium testcase for visibility

    We have elements that are dynamically hidden in our product. If isElementPresent is used, it always returns true regardless of whether the element is on the screen or not. Is there some other way if testing this? We basically want to test that the element is getting hidden when a button is pressed or a condition is met in the server-side

    #2
    isElementClickable() is more appropriate for checking whether an element is interactive as opposed to simply present in the DOM.

    Comment


      #3
      I am told isElementClickable is a java method? We are using javascript.

      Comment


        #4
        No, it's not a Java method, it's a method on isc.AutoTest. However, it was added in 3.1, so perhaps that's the issue?

        Comment


          #5
          Yes, this would be the issue - we cannot move to 3.1 as yet.

          Comment


            #6
            If you need to emulate this in 3.0, you could use getElement() then use DOM-level techniques to check for visibility.

            Comment


              #7
              That looks very complex - there's really no other way for this?

              Comment


                #8
                That's why we made it simpler in 3.1.

                If you Google "selenium check element visible" you can see that the link we provided was hit #3. If you like, we'll happily agree that Selenium probably should have provided a helper method for this..

                Comment


                  #9
                  There's a couple of questions regard 8.3d build:

                  1) Method waitForElementClickable() that appears in documentations (http://www.smartclient.com/smartgwtee-latest/javadoc/com/smartgwt/client/docs/UsingSelenium.html) does not exist in user-extensions.js - is it only available for SmartGWT?

                  2) We need details how method isElementClickable() (in user-extensions.js) works and an examples how the method can be used. Is there documentation somewhere for this?

                  Comment


                    #10
                    Originally posted by acarur01 View Post
                    There's a couple of questions regard 8.3d build:

                    1) Method waitForElementClickable() that appears in documentations (http://www.smartclient.com/smartgwtee-latest/javadoc/com/smartgwt/client/docs/UsingSelenium.html) does not exist in user-extensions.js - is it only available for SmartGWT?
                    Selenium will automatically create several commands whenever a function of the form:

                    Selenium.prototype.isXXX()

                    is defined in user-extensions.js; one of those is the function waitForXXX(). That command then becomes legal in Selenium HTML scripts, and is visible from within Selenium IDE. If you open Selenium IDE with our user extensions, you should see the command waitForElementClickable() available.

                    Originally posted by acarur01 View Post
                    2) We need details how method isElementClickable() (in user-extensions.js) works and an examples how the method can be used. Is there documentation somewhere for this?
                    The best documentation for waitForelementClickable() is the SC reference doc for Autotest.waitForElementClickable(). The only difference is that, with the Selenium HTML command, you have to pass an scLocator rather than an element (which is allowed for AutoTest.waitForElementClickable().) An example of using this command is provided in the Selenium User Guide, which is also in the SC reference docs under usingSelenium. (There is some kind of formatting issue with the text in HTML causing a few sentences to be repeated, but just ignore that.)

                    Comment

                    Working...
                    X