Lydia
Lydia

Reputation: 21

Using Python in Visual Studio for automation testing, but Selenium is not recognized

I am new to Python in Visual Studio for automation testing. It seems Selenium library was not imported properly. Can anyone help me?

Reproduce steps:

  1. Installed the newest version of Python.
  2. Pip installed Selenium.
  3. Installed Visual Studio Enterprise and Community (with .NET, Python Development, Node.js).

Started in Visual Studio with a new project in Python application. But then Selenium is not recognized by Visual Studio. I was trying to import Selenium library from Project\ManageNugetPackages, but this option was GreyOut.

Can anyone help me?

Selenium issue not recognized.

Visual Studio Error message.

Error message.

Error.

Upvotes: 2

Views: 9158

Answers (1)

ChamindaC
ChamindaC

Reputation: 1492

Here is how to install python packages in Visual Studio

Right click on python environment and click Install Python Package enter image description here

Then in Python Environments explorer search for the package and click the link to install. enter image description here

Upvotes: 2

Related Questions