ericmckean / chromedriver

Automatically exported from code.google.com/p/chromedriver
0 stars 0 forks source link

Incorrect Stale frame element behavior #948

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Stale reference to a frame is throwing NoSuchFrameError instead of 
ObsoleteElementError

I can reproduce this 100% of the time on a page that I (unfortunately) can not 
share. 

I'm pulling the debug info from: 
https://github.com/SeleniumHQ/selenium/blob/master/rb/lib/selenium/webdriver/rem
ote/bridge.rb#L617

*args: [:findElement, {}, {:using=>"id", :value=>"menuFrame"}]
raw_execute(*args)['value']: {"ELEMENT"=>"0.6930554306600243-1"}

*args: [:getElementTagName, {:id=>"0.6930554306600243-1"}]
raw_execute(*args)['value']: iframe

*args: [:switchToFrame, {}, {:id=>#}]

This throws: Selenium::WebDriver::Error::NoSuchFrameError: no such frame: 
element is not a frame
  (Session info: chrome=37.0.2062.120)
Se version 2.43

There is dynamic content updating the iframe, and if I hard code a sleep or 
capture and retry this call will pass, but I shouldn't have to capture an 
UnknownFrameException in order to retry a stale element.

Original issue reported on code.google.com by titusfor...@gmail.com on 21 Oct 2014 at 6:28

GoogleCodeExporter commented 9 years ago
Since you know the codes well,  can you provide a small standalone program
that we can reproduce the problem

Original comment by andrewch...@chromium.org on 24 Nov 2014 at 10:53

GoogleCodeExporter commented 9 years ago
Unfortunately, the page I see this on can not be made public, and I can't 
reproduce it elsewhere. 

I'm pretty sure it is an issue of the element moving in the DOM after lookup. 
As I understand it, Chrome grabs the coordinates of the frame element after the 
page load. If the frame element can not later be found at that location, when 
we try to switch to it, it seems to be throwing a NoSuchFrameError. I'm 
assuming it would just be a matter of checking if the element is stale before 
attempting to switch to it. 

Original comment by titusfor...@gmail.com on 24 Nov 2014 at 11:13

GoogleCodeExporter commented 9 years ago
can you send the page  to me direct?

Original comment by andrewch...@chromium.org on 2 Dec 2014 at 10:33

GoogleCodeExporter commented 9 years ago
Unfortunately employee-only access, and I wasn't able to mock it out well 
enough to reproduce it on its own. Sorry.

Original comment by titusfor...@gmail.com on 2 Dec 2014 at 10:41

GoogleCodeExporter commented 9 years ago

Original comment by andrewch...@chromium.org on 30 Dec 2014 at 1:54

GoogleCodeExporter commented 9 years ago

Original comment by samu...@chromium.org on 21 Feb 2015 at 12:26