java - Selenium - trapped in an iframe -
I am trying to navigate to the original frame of a frame with tinimax that I have navigated:
<. P> driver.switchTo () frame (1); I have tried to use the driver switchTo (). DefaultContent (); To navigate parents back, but it is not working, it is not throwing any errors, it refuses to recognize any web element which I know is on the parent page.WebDriver I navigated into the frame of tinimax.
final list & lt; WebElement & gt; Iframes = driver.findElements (.tagName ("iframe")); Println (iframes); // Console: [] (An empty list)
Before this code, and for navigation, post:
driver.findElement (by. Xpath ("// * [initial (@ id, 'ask_answer_link')]")). Click (); Thread.Sleep (5000); . Driver.switchTo () frame (1); Web Element i = Driver.Fid Element (By CCSSilec ("#Tinense")); Javascript explorer js = null; If (javascript excluser for example driver) {js = (JavaScript Excerpt) driver; } Js.executeScript ("Logic [0] .innerHTML = '" + msg + "' ', i); Thread.Sleep (5000);
This document, which is located inside the main HTML document, can not remove it:
Whatever I have thought, I still got stuck in the frame of tinimax.
edit I probably did not edit the post.
Have you made the following efforts? When you are working inside the frame, then just use the following line in a suitable place and it should focus on the default content
Driver.SwitchTo (). Window (driver. WindowHandles.FirstOrDefault ());
Comments
Post a Comment