Frame element obtained by document.getElementById is different from the same frame element obtained using WebDriver FindElement using the ID strategy

Confirmed Issue #3894474 • Assigned to Mustapha J.

Details

Created
Aug 5, 2015
Privacy
This issue is public.
Reports
Reported by 0 people

Sign in to watch or report this issue.

Steps to reproduce

The core issue is that the element
obtained from script using document.getElementById should be equivalent
to the same element obtained using the WebDriver FindElement command using the ID strategy.
Make sure to use the 3.0.0 of the Selenium C# language bindings or newer

Test Code:
var edgeService = EdgeDriverService.CreateDefaultService();
edgeService.UseVerboseLogging = true;
var edgeDriver = new EdgeDriver(edgeService);

edgeDriver.Navigate().GoToUrl(“http://ie-snap/scratchtests/mustjab/webdriver/test/missedJsReference.html”);
edgeDriver.SwitchTo().Frame(“inner”);
IWebElement edgeWebDriverElement = edgeDriver.FindElement(By.Id(“oneline”));
edgeDriver.SwitchTo().DefaultContent();
IWebElement edgeScriptElement = (IWebElement)((IJavaScriptExecutor)edgeDriver).ExecuteScript(“return frames[0].document.getElementById(‘oneline’);”);

if (!edgeWebDriverElement.Equals(edgeScriptElement)) throw new Exception(“edgeWebDriverElement does not equal edgeScriptElement”);

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Mara P.”

      Changed Assigned To from “Mara P.” to “Corey B.”

      Changed Status to “Confirmed”

      Changed Assigned To from “Corey B.” to “John J.”

      Changed Assigned To from “John J.” to “Clay M.”

      Changed Assigned To from “Clay M.” to “Ben B.”

      Changed Title from “Comparing frame elements leads to StaleElementReferenceException” to “Comparing frame elements leads to StaleElementReferenceException”

      Changed Steps to Reproduce

      Changed Title from “Comparing frame elements leads to StaleElementReferenceException” to “Frame element obtained by document.getElementById is different from the same frame element obtained using WebDriver FindElement using the ID strategy”

      Changed Steps to Reproduce

      Changed Assigned To from “Ben B.” to “Mustapha J.”

    You need to sign in to your Microsoft account to add a comment.

    Sign in