October 2018
Intermediate to advanced
192 pages
5h 12m
English
We can perform operations on a particular window by using the switchTo() command first and then verifying the title. If the title of the window matches the one we want, we can start performing operations on that window or we can invoke the switchTo method again. We can iterate through all open windows using the while loop. Apart from this, we can also search for the existence of elements, we can fire up JavaScript events to check that some JavaScript function exists, and so on.
In the condition of the while loop, we utilize the hasNext() method on the iterator object. The hasNext method keeps on fetching values in the iterator object until it reaches the last value.
The following piece of code can be used ...
Read now
Unlock full access