Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove org.openqa.selenium.internal.WrapsElement #6881

Closed
joshlandin opened this issue Jan 24, 2019 · 1 comment
Closed

Remove org.openqa.selenium.internal.WrapsElement #6881

joshlandin opened this issue Jan 24, 2019 · 1 comment
Labels

Comments

@joshlandin
Copy link

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.

@shs96c shs96c added the C-java label Jan 24, 2019
@shs96c
Copy link
Member

shs96c commented Jan 24, 2019

It was marked as deprecated, so it's gone in 0fe993f485a16a9531afd6929ddd82e2ece656fd. Thanks for pointing it out!

@shs96c shs96c closed this as completed Jan 24, 2019
@lock lock bot locked and limited conversation to collaborators Aug 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants