How to fix : protractor.ps1 cannot be loaded because running scripts is disabled on this system

If you ever get below error while setting up / executing Protractor Test Automation suite:

protractor : File C:\Users\ishan\AppData\Roaming\npm\protractor.ps1 cannot be loaded because running scripts is disabled on this system. For     
more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.

This ps1 loading error usually comes up if the ExecutionPolicy at user role level is undefined. It can be fixed by updating ExecutionPolicy as Unrestricted.

protractor.ps1 cannot be loaded because running scripts is disabled on this system

Solution: 

1. Open Command Prompt
2. Navigate to Project Location
3. Type below Command and Hit Enter... Solved! Happy Testing :)

Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted

Post a Comment

0 Comments