Visual studio 如何克服在Xamarin移动应用程序中安装Selenium WebDriver的问题?

Visual studio 如何克服在Xamarin移动应用程序中安装Selenium WebDriver的问题?,visual-studio,xamarin,selenium-webdriver,visual-studio-2017,appium-android,Visual Studio,Xamarin,Selenium Webdriver,Visual Studio 2017,Appium Android,我试图通过NuGet解决方案下载Selenium.WebDriver,但出现以下错误: Failed to add reference. The package 'Selenium.WebDriver' tried to add a framework reference to 'System.Drawing' which was not found in the GAC. 当我在xamarin中安装Appium时,我会遇到如上所述的错误,因此任何人都可以与我分享如何克服这一问题的想法 编辑您

我试图通过NuGet解决方案下载Selenium.WebDriver,但出现以下错误:

Failed to add reference. The package 'Selenium.WebDriver' tried to add a framework reference to 'System.Drawing' which was not found in the GAC.
当我在xamarin中安装Appium时,我会遇到如上所述的错误,因此任何人都可以与我分享如何克服这一问题的想法

  • 编辑您的
    .csproj
    文件。
  • 在VisualStudio中,您可以“卸载”项目,然后右键单击卸载的项目,就可以进行编辑
  • 找到包含引用的
    ItemGroup
    ,并对其进行编辑以包含此行
  • 大概是这样的:

    <ItemGroup>
        <Reference Include="System" />
        <Reference Include="System.Core" />
        <Reference Include="System.Drawing" />
        <Reference Include="WebDriver, Version=3.141.0.0, Culture=neutral, processorArchitecture=MSIL">
    
    
    
    Selenium.WebDriver旨在自动化Windows上的浏览器,而不是移动设备中的浏览器(因此也不是针对iOS或Android的Xamarin应用程序项目)。如果您希望驱动移动浏览器,那么您应该看看使用WebDriver协议测试/自动化设备浏览器的Appium,谢谢,但我尝试下载appium,我也遇到了同样的错误,所以可以建议任何解决方案吗?@shijietio您不可以将appium添加到您的xamarin项目中。你应该编辑你的问题,并说明你正试图完成什么。