Difference between selenium.selectFrame() and selenium.selectWindow()
I've been struggling with the difference between the following commands, used while accessing widgets contained within iframes:
selenium.selectFrame("widget0");
selenium.selectWindow("name=widget0");
In the past (prior to开发者_StackOverflow中文版 IDE v1.0.12), I have been using these interchangeably, preferring the former over the latter in most cases. However, with 1.0.12, swapping them out after recording does not work. In what cases would each one be used?
Thanks.
selectFrame is the API of selenium to select a particular frame form HTML source. Say, some HTML elements are present inside a iframe of HTML source, therefore u are not able to take event on those elements until to use selectFrame API.
selectWindow will be used in those cases where after take some event a new browser popup window open and u need to take action on the popup window instead of main browser page. After doing ur operation u need to select back ur main browser window.
精彩评论