与主题相同。由于OpenQA.Selenium.Appium.Service.AppiumCommandExecutor
,无法使用AndroidDriver。在两周前使用项目可以正常工作。当我在手机运行时将AndroidDriver
替换为RemoteWebDriver
应用程序时。如何解决此问题,或者我应该在哪里寻找解决方案?您是否知道如何将RemoteWebDriver
转换为AndroidDriver
?是.net
问题吗?
消息:OneTimeSetUp:System.TypeLoadException:方法“ Dispose”在 从中输入“ OpenQA.Selenium.Appium.Service.AppiumCommandExecutor” assembly'appium-dotnet-driver,版本= 3.0.0.2,文化=中性, PublicKeyToken = null'没有实现。
给我这样的带有DesiredCapabilities的消息有问题吗? PICTURE
我的实现:
private string reportDirectory = "reports";
private string reportFormat = "xml";
private string testName = "Test";
protected AndroidDriver<AppiumWebElement> driver = null;
DesiredCapabilities dc = new DesiredCapabilities();
public Driver()
{
dc.SetCapability("reportDirectory", reportDirectory);
dc.SetCapability("reportFormat", reportFormat);
dc.SetCapability("testName", testName);
dc.SetCapability("deviceName", AppConfigReader.DEVICE_NAME);
dc.SetCapability("language", "en");
dc.SetCapability("locale", "UK");
dc.SetCapability("newCommandTimeout", 120);
dc.SetCapability("platformName", "android");
//dc.SetCapability("automationName", "UiAutomator2");
dc.SetCapability(MobileCapabilityType.Udid, AppConfigReader.DEVICE_NAME);
dc.SetCapability(AndroidMobileCapabilityType.AppPackage, AppConfigReader.APPLICATION_NAME);
dc.SetCapability(AndroidMobileCapabilityType.AppActivity, "novacura.flow.client.android.SplashScreen");
driver = new AndroidDriver<AppiumWebElement>(new Uri(AppConfigReader.HOST), dc);
}