I'm getting so many errors when updating the Appium dotnet driver, is there any way to fix them?
I just updated my Appium dotnet driver from 184.108.40.206 to 4.0 and I got so many errors and warnings on the code.
My major concerns are that it says
Driver.swapare not available and it's giving me an error at the driver initialisation line where I add the server IP address and the URL.
What are the possible solutions?
If you look at the Appium Dotnet Driver changelog (https://github.com/appium/appium-dotnet-driver/releases) you can see the 4.x version is nearly 2 years in beta. It contains a lot of breaking changes, around 2-3 years of them. What you are getting is normal with major version upgrades. The programming interface (API) changes in major version to handle new insights and a changing world.
In the code example you show the AndroidDriver is changed to use a
AppiumServiceBuilder.getUrl()instead of a
System.Uri. This page has some examples: https://github.com/appium/appium-dotnet-driver/wiki/How-to-start-an-AppiumDriver-locally
I would rollback to 3.x, unless there is a 4.x feature I really need now. Then I would reserve some time to implement an experiment with the new version and with that knowledge change the old test code to meet the new requirements.