Wednesday, November 2, 2011

WebDriver - Listbox and few other details

In latest WebDriver , we have to use sendKeys to select a value from the listbox.
RenderedWebElement class has been depreceated.

Normal Driver instance can be as follows:
  firefox:
            FirefoxProfile firefoxProfile = new FirefoxProfile();
            firefoxProfile.setAcceptUntrustedCertificates(true);
            localDriver = new FirefoxDriver(firefoxProfile);
            localDriver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
            driver = localDriver;
         
 iexplore:
            DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer();
ieCapabilities.setCapability(
     InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,
                            true);
            ieCapabilities
                    .setCapability(CapabilityType.HAS_NATIVE_EVENTS, true);
            ieCapabilities.setCapability(CapabilityType.TAKES_SCREENSHOT, true);
            ieCapabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
            ieCapabilities.setCapability(CapabilityType.SUPPORTS_JAVASCRIPT,
                    true);
            localDriver = new InternetExplorerDriver(ieCapabilities);
           driver = localDriver;





No comments: