MachinePublishers / jBrowserDriver

A programmable, embeddable web browser driver compatible with the Selenium WebDriver spec -- headless, WebKit-based, pure Java
Other
809 stars 143 forks source link

Unable switch to frame #235

Open w3ea opened 7 years ago

w3ea commented 7 years ago

hi when i want to switch another frame Jbrowser stuck and hang this is my code: driver.switchTo().frame(driver.findElement(By.cssSelector("iframe[title='recaptcha widget']"))); OR even with frame's name driver.switchTo().frame("undefined");

hollingsworthd commented 7 years ago

If the frame's name is "undefined" it's possible that the frame doesn't yet exist when the switchTo call is made. For purposes of this issue, maybe check if it's there by taking a screenshot first or running in non-headless mode.

w3ea commented 7 years ago

ok i check that but this code work in chromedriver and in chromedriver when a frame doesn't exist it show error in terminal not freezing

fickmj commented 6 years ago

I seem to be experiencing a very similar issue. When I attempt to switch the frame the next find element call hangs indefinitely.
driver.switchTo().frame("e1menuAppIframe"); driver.findElementByXPath("//div[@title='Alpha Name']");

The switch seems to execute but the findElementByXPath hangs.

svsik commented 6 years ago

Any update on this issue? I see it is still apparent.

leindecker commented 5 years ago

Hi All,

I was facing the same issue And in order to navigate between frames I used the following solution

I've wrote a method that receive a WebElement and then send the 'name' attribute to the frame() method. Like this, frame is my WebElement, driver.switchTo().frame(frame.getAttribute("name"));

I hope it could be useful for someone.

Thanks Guilherme Leindecker