Announcement

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

    Selenium Webdriver click() does not work on buttons

    When trying to do a click() call from selenium on a smartclient button, nothing happens. The web element is found, but click() does nothing. I've tried also with using scLocator("SCButton") with same results.

    Simple Selenium Code:
    Code:
    SmartClientFirefoxDriver ffDriver = new SmartClientFirefoxDriver();
    ffDriver.setBaseUrl("http://localhost:8080/");
        ffDriver.get("trigger.html");
        WebElement button = ffDriver.findElement(ByScLocator.scLocator("//IButton[ID=\"SCButton\"]"));
    button.click();
    Simple Smartclient code:
    Code:
    isc.IButton.create({
    	ID: "SCButton",
        left:0, top:240, width:150,
        title:"Click me!",
        click: function () {
    		alert("HERE");
        }
    })
    SmartClient Version: SNAPSHOT_v9.1d_2014-01-16/PowerEdition Development Only (built 2014-01-16)

    Browser: Firefox 26.0

    #2
    WebDriver Support

    We are unable to reproduce this using your code and the current daily release. There are no known fixes affecting this area since your stated version but it may be worth trying the latest.

    Your issue states that the WebElement is being returned but the click() method doesn't work. While we aren't seeing this, the WebElement.click() method is provided by the underlying selenium library and wouldn't be affected by any changes to our isomorphic-webdriver.jar classes. Our tests used selenium-java-2.37.0.jar (which is contained in the latest release) with FF26. WebDriver support is in constant flux as new versions of FF are released so it may be worth investigating this library if yours is earlier.

    Comment


      #3
      I tried using the webdriver that was included as part of the Smartclient SDK but click still doesn't work. The version of Selenium I'm using is the lastest version which is 2.39. I tried using the ChromeDriver and click() works fine. So it's only on Firefox that the click() doesn't work. On Firefox, sendKeys() works fine as I've tried using it on a input field.
      Last edited by acarur01; 3 Feb 2014, 14:20.

      Comment


        #4
        Webdriver library issues

        It certainly sounds as if you have a version issue between the webdriver library and Firefox. SmartClient requires webdriver to use "native events" to support Firefox. This is the area which is most often in flux with each version of FF. That being said, 2.39 does support FF26. Could you please confirm that your classpath *ONLY* references this version of selenium-java.jar. Please only include the libraries from lib-WebDriverSupport and NOT the main SmartClient libraries: Webdriver test run in a separate JVM and conflicts can occur with other libraries. Please also let us know which OS you are using as the default behaviour can vary.

        Finally, SmartClientWebDriver does contain a helper method: click(By by) which is enhanced over the standard WebElement.click() method for SmartClient elements. Our earlier testing did find that your existing code worked as expected however but this method is safer to use where timing issues might occur (for example, two separate single clicks might accidentally be seen as a double click event).

        Comment

        Working...
        X