How to switch between frames in Selenium WebDriver using Java

后端 未结 7 1713
轮回少年
轮回少年 2020-11-22 13:31

I am using java with WebDriver.I have to switch between two frames. I have recorded the test case in selenium IDE and in that I got the values as selectFrame relative=top se

7条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-22 13:57

    You can also use:

    driver.switch_to.frame(0)
    

    (0) being the first iframe on the html.

    to switch back to the default content:

    driver.switch_to.default_content()
    

提交回复
热议问题