Selenium Testing of GWT 2.0

前端 未结 4 1813
陌清茗
陌清茗 2021-01-04 14:27

How can I make a selenium click() work the same as a manual mouse click?

I have recently upgraded GWT from 1.7.1 to 2.0. Some selenium tests (SeleniumRC v1.0.1, IE7)

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-04 15:00

    I wanted to post the code that finally worked for me following useful comments from AutomatedTester.

    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.WebDriverBackedSelenium;
    import org.openqa.selenium.ie.InternetExplorerDriver;
    
    import com.thoughtworks.selenium.Selenium;
    
    public class TestTreeClick {
    
        public static void main(String[] args) {
            WebDriver driver = new InternetExplorerDriver();
            Selenium selenium = new WebDriverBackedSelenium(driver, "http://gwt.google.com/samples/Showcase/Showcase.html#CwTree");
            selenium.open("http://gwt.google.com/samples/Showcase/Showcase.html#CwTree");
            selenium.click("gwt-debug-cwTree-staticTree-root-child0-content");
        }
    }
    

提交回复
热议问题