Closed OtiliaRegheni closed 3 months ago
Firefox ESR 102 is no longer supported so please switch to the recent (ESR) release. Also you should update geckodriver accordingly. If it is still reproducible for you please attach a trace-level log from geckodriver. Also read more about reporting actionable bugs in our contribution guidelines. Thanks.
Hello. I will try with a latest version of Firefox ESR and gecko driver and came back with feedback regarding this. Thank you.
Closing as incomplete because of a missing reply from the reporter, but happy to reopen if more details are provided, which demonstrate that this is an issue with geckodriver or Firefox.
System
When switching to a different frame on a webpage using Selenium WebDriver with Firefox 102.0 ESR and GeckoDriver v0.32, intermittent exceptions are encountered when attempting to interact with elements within the switched frame. Instead of receiving a TimeoutException or a relevant error indicating the frame is not ready, the following exceptions are thrown without a preceding indication of frame availability issues:
NoSuchWindowException: Browsing context has been discarded.
StaleElementReferenceException: The element reference is stale; either the element is no longer attached to the DOM, it is not in the current frame context, or the document has been refreshed.
This behavior is inconsistent and complicates element interaction within frames, requiring a workaround that involves retrying the frame switch and element interaction.
This issue can be reproduced by following these steps:
1.Initiate a Selenium WebDriver session with Firefox 102.0 ESR using GeckoDriver v0.32. 2.Navigate to a webpage that contains multiple frames. 3.Switch to a new frame using the "ExpectedConditions.frameToBeAvailableAndSwitchToIt(frameBy)" condition. 4.Attempt to select an element within the new frame context.
Expected Behavior: After switching to a new frame, elements within that frame should be selectable without errors.
Actual Behavior: When attempting to select an element within a newly switched frame, exceptions are thrown intermittently: