Skip to content

Need Help Resolving Casting Error with the Java_Client  #1194

@jshinn6788

Description

@jshinn6788

I am getting the same casting error when I use WindowsElement.
The error is: org.openqa.selenium.remote.RemoteWebElement cannot be cast to UI.appium.java_client.windows.WindowsElement.

What do I need to do to solve this? need help.

Here is an example of my code:

///This is in my WindowsDriverBaseClase
protected WindowsDriver driver;

public class WindowsDriver {
try {
DesiredCapabilities appCapabilities = new DesiredCapabilities();
appCapabilities.setCapability("platformName", "Windows");
appCapabilities.setCapability("automationName", "Appium");
appCapabilities.setCapability("app", "C:\ProgramData\..\");
driver = new WindowsDriver(new URL("http://127.0.0.1:4723"), appCapabilities);
} catch (Exception e) {
e.printStackTrace();
}
}

//page object model
WindowsElement txbx_user = (WindowsElement) driver.findElementByAccessibilityId("13");

public void setUser() {
txbx_user.sendKeys("testing");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions