'I cannot start chrome instant using PowerShell and Selenium module
I am not sure what I am missing, but I installed Selenium module under PowerShell 7.1 and I cannot start chrome instance. I followed the steps below (from https://github.com/adamdriscoll/selenium-powershell):
Install-Module -Name Selenium -AllowPrerelease
$driver = start-SeChrome
I get this error:
start-SeChrome: The term 'start-SeChrome' is not recognized as a name of a cmdlet, function, script file, or executable program.
I also tried running the script from vscode, still the same problem. See the snapshot below.
Edit: I was able to remove the latest Selenium version, and installed module 3.0.1. I had to uninstall the old one, delete the related module folders, kill all the session, and install 3.0.1. Now the command is available, but I am getting this error:
MethodInvocationException: Exception calling ".ctor" with "2" argument(s): "unknown error: cannot find Chrome binary"
See the snapshot below.
I appreciate your help.
Solution 1:[1]
Did you put an import statement at the top of your script?
Import-Module "{FullPath}\selenium-powershell\Selenium.psd1"
The "OR" between the Install statement and the Import statement in the docs does not make sense to me. You have to install once just to get the module on your computer, but you have to import at the top of the script so the script can find the installed module.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Darin |


