In contrast to actions like FillWith or SelectOption, access to attributes (like ElementScope.Value) are not secured via the Try() method. Why so?
Unfortunately, this runs into race conditions, e.g. acessing:
scope.FindId("test").Value;
Value is (summarized) implemented as:
return this.Now().native.GetAttribute("value");
if the page changes between the call of Now() and the GetAttribute() call I get the following exception:
OpenQA.Selenium.StaleElementReferenceException : Element is no longer valid
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebElement.GetAttribute(String attributeName)
Is it possible to provide "secure" access as well?
Best regards,
Dominik