selenium-powershell icon indicating copy to clipboard operation
selenium-powershell copied to clipboard

I cannot start chrome instant using PowerShell and Selenium module.

Open tarekahf opened this issue 3 years ago • 4 comments

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:

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 appreciate your help.

tarekahf avatar Feb 04 '22 17:02 tarekahf

Do you get an error of some kind for Import-Module Selenium?

vexx32 avatar Feb 04 '22 23:02 vexx32

I solved the problem by removing the latest one, install 3.0.1 and put the file chromedriver.exe the one that is compatible with my Chrome browser, must put it under powershell selenium folder to replace the existing one.

Why do we have to struggle? Why the latest version is not working?

When I installed the latest version I didn't get any error.

tarekahf avatar Feb 04 '22 23:02 tarekahf

I added this pull request to update the README file:

https://github.com/adamdriscoll/selenium-powershell/pull/219

If this works, then you may close this ticket, or let me know if there is another solution.

tarekahf avatar Feb 07 '22 21:02 tarekahf

@tarekahf the problem is what the message says. There is no cmdlet with the name "start-SeChrome".

In fact you installed the module with parameter "-AllowPrerelease" you should have been installed V4.0.0-preview3.

In this version all cmdlets Start-[yourBrowser] has been merged with Start-SeDriver.

In your case you have to do the following:

Start-SeDriver -Browser Chrome -StartURL "https://www.google.com" -Switches DisableAutomationExtension

Stop-SeDriver

If you're getting an error message because of Chromedriver Version, you can update it:

Update-SeDriver -Browser Chrome -OS Windows

Ronsox avatar Feb 24 '22 15:02 Ronsox