Wednesday, October 9, 2013

WebDriver FireEvent

How to Fire Event on any WebElement using WebDriver

Steps for Fire Event:
1. Create the driver object for any browser
2. Perform the action on WebElement say "Select Item from the list box"
3. Code either of the following to fire event on the WebElement
  • driver.switchTo().activeElement().sendKeys(Keys.TAB);
    1. WebElement element = driver.findElement(By.id("myElement"));
    2. JavascriptLibrary javascript = new JavascriptLibrary();
    3. javascript.callEmbeddedSelenium(driver, "triggerEvent", element, "blur");

1 comment:

Related Posts Plugin for WordPress, Blogger...