Sitam Jana
Sitam Jana

Reputation: 3129

WebDriver : SendKeys(Integer) NOT working in Firefox 29

I am using Firefox 29 and WebDriver java 2.41.0 bindings to automate test scenarios. Have one scenario to input an integer to a input-box which was working FINE with Firefox 28 and now failing with v29 i.e latest FF version. The code I wrote for the same is:

int inputString = 123456;
driver.FindElement(By.Id("tinymce")).SendKeys(inputString);

Please help me getting through of this.

Upvotes: 0

Views: 1264

Answers (4)

nilesh
nilesh

Reputation: 14287

Quick test below worked for me. I understand JS is not the right way to do browser simulation, one should always FIRST use webdriver methods since they use browsers native api, but thought it would unblock you while the bug is fixed in selenium

 DesiredCapabilities desiredCapabilities = DesiredCapabilities.firefox();
 desiredCapabilities.setCapability(CapabilityType.HAS_NATIVE_EVENTS,true);
 WebDriver driver = new FirefoxDriver(desiredCapabilities);
 driver.get("http://yizeng.me/2014/01/31/test-wysiwyg-editors-using-selenium-webdriver/");
 WebElement frame = driver.findElement(By.id("tinymce-editor_ifr"));
 driver.switchTo().frame(frame);
 WebElement body = driver.findElement(By.id("tinymce"));      
 JavascriptExecutor js = (JavascriptExecutor)driver;
 js.executeScript("arguments[0].innerHTML = '<h1>Heading</h1>Hello There'",body);

Upvotes: 1

Arran
Arran

Reputation: 25066

This will be the result of this issue:

https://code.google.com/p/selenium/issues/detail?id=7291

Fixed by this revision in the Selenium code:

https://code.google.com/p/selenium/source/detail?r=afde40cbbf5c

Upvotes: 2

SirFrederick
SirFrederick

Reputation: 1

One thing I do before sending a value to a box is to clear it, also, the value I send is always a string, the parsing should be done by the page/code as you need to validate what the user has entered. But I do agree with skv, we need to see the actual error being thrown.

Upvotes: 0

Sunilkumar V
Sunilkumar V

Reputation: 962

Can you check following points

  • Can you make sure there are no application changes, I mean the locator is returning single node element.
  • Can you also post the exception that you are getting. To troubleshoot this problem, need these details.

Upvotes: 0

Related Questions