Possible Duplicate:
display image from URL retrieved from ALAsset in iPhone
My code is:
Set<String> windowsid = driver.getWindowHandles();
Iterator<String> iterate = windowsid.iterator();
while(iterate.hasNext()){
System.out.println(iterate.next());
}
String mainwindow_id = iterate.next();
String tabbedwindow_id = iterate.next();
I get an error @ String mainwindow_id = iterate.next();
Stating the below, Line 45 is the one i have in quotes.
I have declared the Set as String
Please Help !
Exception in thread "main" java.util.NoSuchElementException
at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:375)
at java.util.LinkedHashMap$KeyIterator.next(LinkedHashMap.java:384)
at windows.traverse.main(traverse.java:45)
After the loop,
there are no elements left in the set to iterate. You iterated through all the windows and that’s why
NoSuchElementException.Can you explain a little bit about what you want to do?
If I understand you correctly, you dont need to use a loop. Since there are only two windows, you can just do ..