JavaScriptExecutor FuelUX Repeater assign value to search page input element

  • 1 Replies
  • 933 Views
I am trying to assign a value to a FuelUX Repeater's input via JavaScriptExecuter.
http://getfuelux.com/javascript.html#repeater

Code
WebElement repeater = driver.findElement(By.id("repeaterIllustration"));
WebElement repeaterPagination = repeater.findElement(By.xpath( "//div[contains(@class, 'repeater-pagination')]"));
WebElement pageInput = repeaterPagination.findElement(By.xpath("//input[contains(@class, 'repeater-secondaryPaging')]"));

For some reason I am not able to assign the value '9' to the Repeater's page input :
Code
jsDriver = (JavascriptExecutor) driver;
jsDriver.executeScript("arguments[0].val('9')", pageInput);

Any help would be appreciated.
« Last Edit: February 18, 2016, 09:54:06 am by Luthar »

*

Oren

  • **
  • 59
.val() is a jQuery function and it will not run on an object that is not wrapped by jQuery.

You could try wrapping it with the $ sign like so:

Code
jsDriver.executeScript("$(arguments[0]).val('9')", pageInput);

Or you just could use pure JavaScript:

Code
jsDriver.executeScript("arguments[0].val = 9", pageInput);

 

Sitemap 1 2 3 4 5 6 7 8