You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is not uncommon to unwrap an element in remote grid environments. For example, when org.openqa.selenium.support.events.EventFiringWebDriver.EventFiringWebElement wraps a org.openqa.selenium.remote.RemoteWebElement and the test needs to set a org.openqa.selenium.remote.LocalFileDetector on the RemoteWebElement.
Example:
public void fileInput(String cssSelector, String absolutePath)
{
WebElement fileElement = this.driver().findElement(By.cssSelector(cssSelector));
if (fileElement instanceof WrapsElement) {
fileElement= ((WrapsElement)fileElement).getWrappedElement();
}
if (fileElement instanceof RemoteWebElement)
{
LocalFileDetector detector = new LocalFileDetector();
File f = detector.getLocalFile(absolutePath);
((RemoteWebElement)fileElement).setFileDetector(detector);
path = f.getAbsolutePath();
}
fileElement.sendKeys(path);
}
Starting with Selenium 3.141.59, this code breaks since the package name changed for WrapsElement from org.openqa.selenium.internal to org.openqa.selenium. The interface org.openqa.selenium.internal.WrapsElement was left in the code base, and thus, existing imports are happy.
Consider removing org.openqa.selenium.internal.WrapsElement to avoid confusion.
The text was updated successfully, but these errors were encountered:
It is not uncommon to unwrap an element in remote grid environments. For example, when
org.openqa.selenium.support.events.EventFiringWebDriver.EventFiringWebElement
wraps aorg.openqa.selenium.remote.RemoteWebElement
and the test needs to set aorg.openqa.selenium.remote.LocalFileDetector
on theRemoteWebElement
.Example:
Starting with Selenium 3.141.59, this code breaks since the package name changed for
WrapsElement
fromorg.openqa.selenium.internal
toorg.openqa.selenium
. The interfaceorg.openqa.selenium.internal.WrapsElement
was left in the code base, and thus, existing imports are happy.Consider removing
org.openqa.selenium.internal.WrapsElement
to avoid confusion.The text was updated successfully, but these errors were encountered: