Screen Shot 2016-08-08 at 7.01.07 PM

Highlight Elements during your Protractor test run

Very long back I wrote an article on how to highlight elements during Webdriver run here

Let’s see how to do it with JavaScript in Protractor test.

In my test framework, I have a helper class for the commonly used API calls like click, sendKeys wrapped with custom names like clickWhenClickable and typeKeys respectively, in those functions before letting the protractor to actually click on it, we will call the highElement function for the same byObject so that it highlights and then it performs an action.

Its pretty straight forward,

Hope it helps!

Leave a Comment