【问题标题】:Using Python in Visual Studio for automation testing, but Selenium is not recognized在 Visual Studio 中使用 Python 进行自动化测试,但 Selenium 无法识别
【发布时间】:2018-01-24 02:52:08
【问题描述】:

我是 Visual Studio 中用于自动化测试的 Python 新手。似乎 Selenium 库没有正确导入。谁能帮帮我?

重现步骤:

  1. 安装了最新版本的 Python。
  2. Pip 安装了 Selenium。
  3. 已安装 Visual Studio Enterprise 和 Community(使用 .NET、Python 开发、Node.js)。

在 Visual Studio 中开始使用 Python 应用程序中的新项目。但是,Visual Studio 无法识别 Selenium。我试图从 Project\ManageNugetPackages 导入 Selenium 库,但这个选项是 GreyOut。

谁能帮帮我?

Selenium issue not recognized.

Visual Studio Error message.

Error message.

Error.

【问题讨论】:

  • 请阅读screenshot of HTML or code or error is a bad idea 的原因。考虑使用基于格式化文本的 HTML 和代码试验来更新问题。
  • 我从未使用过 python 和 VS,但我的猜测是 pip install 会与 NuGet 安装冲突。我的建议是撤消 pip 安装并仅使用 NuGet。您必须单击项目(不是解决方案)才能管理 NuGet 包。

标签: python visual-studio selenium selenium-webdriver nuget-package


【解决方案1】:

这里是如何在 Visual Studio 中安装 python 包

在python环境上右击,点击Install Python Package

然后在 Python 环境资源管理器中搜索包并单击链接进行安装。

【讨论】:

    猜你喜欢
    • 2016-11-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-06-07
    • 2012-09-27
    • 1970-01-01
    相关资源
    最近更新 更多