How to select a frame using selenium?

前端 未结 5 581
清酒与你
清酒与你 2020-12-19 16:40

I\'m using Java to create selenium test cases. My system is based on portlets connected to each other. I\'m using \"selectFrame\" command to select the portlet.

I tr

5条回答
  •  青春惊慌失措
    2020-12-19 17:09

    You can switch to a frame, using its name or id easily:

    driver.switchTo().frame("frame_name");
    

    When you have selected a frame to switch to another frame you have to switch to the parent or root first with something like:

    driver.switchTo().defaultContent();
    driver.switchTo().frame("other_frame_name");
    

提交回复
热议问题