How to Retrieve Frame for Selenium-Webdriver

Asked 2 years ago, Updated 2 years ago, 73 views

How do I get frames for Selenium-Webdriver?

There are currently two frames on one page (window).If you specify a condition in one frame (Frame A) and click the extract button, the result will be reflected in the other frame (Frame B).After specifying conditions in frame A, we would like to operate frame B in ruby language in Selenium-Webdriver.Obtain Frame A using the program below and

frame=driver.find_element(:id, "Frame A")
driver.switch_to.frame(frame)

I tried to get frame B by returning it to the top frame in the program below, but I couldn't get it no matter how many times I tried.

driver.switch_to.window(driver.window_handle)

frame=driver.find_element(:name, "Frame B")
driver.switch_to.frame(frame)

On the other hand, I was able to get frame B in the same way.However, if you go back to the top frame and try to get frame A, you get an error.
How can I get it?
By the way, the operating system is Ubunto 16.04 and the browser uses Firefox.

selenium-webdriver

2022-09-30 10:14

1 Answers

Switch_to.default_content reverts to the top frame

driver.switch_to.default_content


2022-09-30 10:14

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.