October 2018
Intermediate to advanced
192 pages
5h 12m
English
As we can see in the preceding code, there is a new entry in our encyclopedia of Selenium concepts, which is JavascriptExecutor. It is one of the interfaces in Selenium that can be used to accomplish things that cannot be accomplished through regular locators. It lets us execute JavaScript code in Selenium. Let's study the following line from the code in the previous section:
isJqueryCallDone = (Boolean) ((JavascriptExecutor) driver).executeScript("return jQuery.active===0");
The isJqueryCallDone phrase is a Boolean variable that is assigned the value of return jQuery.active===0.
Here, we are invoking the executeScript function on the driver object after casting it to JavascriptExecutor. Only then will the ...
Read now
Unlock full access