Search This Blog

Loading...

Saturday, March 29, 2014

How to send text to webelement using javascript


Sometimes with webdriver its not possible to type text in a textbox like password,extjs textbox fields. At that time try below script to send text to textbox. It works.

WebDriver driver = new FirefoxDriver();

((JavascriptExecutor)driver).executeScript("arguments[0].value='test'", driver.findElement(By.xpath(xpath)));

Thursday, February 16, 2012

Handling Permission denied error for error using Seleium WebDriver

Depending on the application page structure you may encounter with below error sometimes on FF (may be other browsers) latest versions while trying to clicking on any element, and there is no consistent resolution from Selenium Team yet, and we need to live with some work around for this.

Wednesday, November 16, 2011

Key press events using selenium RC

To handle key press events like to press page down, tab key or other keys selenium RC supports this by passing ASCII code of keys to keyDownNative function.

Syntax:

keyDownNative(String keycode);

Example:
  • For page down/scroll: keyDownNative("32"); //32 is ASCII code for space bar.
  • To press tab key: keyDownNative("9"); // 9 is ASCII code for Tab.