Thursday, April 4, 2019

How to use Protractor elementExplorer for simple debugging

The elementExplorer is a good tool to debug Protractor scripts. You need to have an appropriate Protractor version and npm version for this, because the newest versions are not supported.

First of all, check the version of npm installed in your system:

nvm list







The highest version of npm must be 6.11.0. If it is not the case, you have to choose this one:

nvm use 6.11.0

If you don't have nvm, you may download from here:

https://app.box.com/s/of2zldgjfpjjbggch3bknzshdh6fx1om

Second, check the version of Protractor:

protractor --version

It must be not higher than 5.4.2. If it is not the case, you may do the following:

npm -g install protractor@5.4.2
webdriver-manager update

There are two ways to start elementExplorer:

1. protractor --elementExplorer
2. node <..>/npm/node_modules/protractor/bin/elementexplorer.js

I prefer the second one because it is then possible to repeat your commands you typed by means of using arrows Up and Down.