WebElement element = driver.findElement(By.id(pro.getProperty("")));

JavascriptExecutor jse = (JavascriptExecutor)driver;

jse.executeScript("return arguments[0].text", element);


 cartCountSearchTab = (() 
((JavascriptExecutor)driver).executeScript("return arguments[0].text;",driver.findElement(By.id(pro.getProperty(""))))).replaceAll(" ", "");

int cartCountTab = Integer.parseInt(cartCountSearchTab);

Null pointer exception is shown in the 4th line.

i.e. string declaration.

How to add web element to the string using ?



Source link https://sqa.stackexchange.com/questions/34707/-javascript-executor-to-the-string--

LEAVE A REPLY

Please enter your comment!
Please enter your name here