Query in windowhandlers | Selenium Forum
M
Posted on 31/03/2016
Sir i have say windows as per attachment:
Now i want to switch to various windows assuming all these windows are switchable without restriction...
Set<String>H=new HashSet<String>();
Iterator It=H.Iterator();
H= w.getWindowHandles();
String[] win=new String[H.size()];

Iterator.next() returns a String[];
Now sir if there are 4 window Ids n i want to store window ids in a array of string eclipse is forcing to cast windowId with String like this:

win[winIds]=(String) iterator.next();

[b:1uf5ghsu]Why is that so sir ????[/b:1uf5ghsu]

---------------------------------------------------------------------------------------------
[b:1uf5ghsu][b]Query2:[/b:1uf5ghsu][/b]
window1 ,window2,window3,window4
If am in window 4: then will the 1st cell of Hashset have windowId of window 4?
[b:1uf5ghsu]How do i figure out which Id is for which window when Hasshset does not follow order?[/b:1uf5ghsu]

M
Replied on 01/04/2016

[quote:3kgbcx1n]If am in window 4: then will the 1st cell of Hashset have windowId of window 4?
How do i figure out which Id is for which window when Hasshset does not follow order?[/quote:3kgbcx1n]

you have to go from

window 4------------> default content ----------------->window 1