dotnet-client: Updating to latest Selenium and Selenium support NuGetPackages raises Casting issue

Description

Updating to latest Selenium(v3.12.0) and selenium support (v3.12.0) NuGetPackages raises Casting issue It was working fine till earlier version v3.11.2

Environment

Appium version 1.8.0 Desktop OS/version used to run Appium: Windows 10 Pro Node.js version (unless using Appium.app|exe): 8.10.0 Mobile platform/version under test: Android API 25 ,v7.1.1 Real device or emulator/simulator: Real Device Samsung Tab Appium CLI or Appium.app|exe: both IDE: VisualStudio 2017 Enterprise and C# as coding language Selenium Driver and Selenium support driver : v3.12.0 (Issue creating version)

Selenium Driver and Selenium support driver v3.11.2 worked fine without any casting issues

Code To Reproduce Issue [ Good To Have ]

public static AndroidElement UserName_Field()

    {
        AndroidElement UserName = driver.FindElement(By.Id("*:id/LoginView_txtUsername"));
        return UserName;
    }

Ecxeption stacktraces

Test Name: TestMethod1 Test FullName: UnitTestProject1.UnitTest1.TestMethod1 Test Source: C:\Users\gokulnath.kumar\source\repos\UnitTestProject1\UnitTestProject1\UnitTest1.cs : line 25 Test Outcome: Failed Test Duration: 0:00:53.4154213

Result StackTrace:

at OpenQA.Selenium.Appium.AppiumDriver`1.FindElement(By by) at *_Mobile.Page_Objects.Login_Objects.UserName_Field() in C:\Users\gokulnath.kumar\source\repos\UnitTestProject1\UnitTestProject1\Page_Objects\Login_Objects.cs:line 21 at *_Mobile.Log_in_module.Login_module.Login(String Uname, String Pwd) in C:\Users\gokulnath.kumar\source\repos\UnitTestProject1\UnitTestProject1\App_Modules\Login_module.cs:line 18 at UnitTestProject1.UnitTest1.TestMethod1() in C:\Users\gokulnath.kumar\source\repos\UnitTestProject1\UnitTestProject1\UnitTest1.cs:line 27 Result Message: Test method UnitTestProject1.UnitTest1.TestMethod1 threw exception: System.InvalidCastException: Unable to cast object of type ‘OpenQA.Selenium.Remote.RemoteWebElement’ to type ‘OpenQA.Selenium.Appium.Android.AndroidElement’.

Link to Appium logs

https://gist.github.com/Gocoollnath/c6b4be5ababf838a0acf0adb72552a20

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 18

Most upvoted comments

https://github.com/SeleniumHQ/selenium/issues/6045 . It’s confirmed that how RemoteWebDriver works have been changed based on request in latest Selenium driver versions. Can the update be also made to Appium? @jlipps @imurchie @TikhomirovSergey @mykola-mokhnach .Please, can you provide an update when this change be incorporated in Appium too?

@nikolay-advolodkin The latest and beta release supports up to Selenium v3.14. Your screenshot shows you have 3.14.1. Please raise a new issue using the issue template.