Interview Questions

Explain how you can handle frames using Selenium 2.0 ?

Selenium WebDriver Interview question and Answers


(Continued from previous question...)

Explain how you can handle frames using Selenium 2.0 ?

To bring control on HTML frame you can use “SwitchTo” frame method-
driver.switchTo().frame(“frameName”);
To specify a frame you can use index number
driver.switchTo().frame(“parentFrame.4.frameName”);
This would bring control on frame named- “frameName” of the 4th sub frame names “parentFrame”

(Continued on next question...)

Other Interview Questions