Tuesday, August 16, 2016

Protractor - Accepting browser alerts

In this short article we will see how can we accept alerts by using Protractor.


Because browser alerts represents non-angular code, we have to ignore angular synchronization first. Here is the code for accepting the alert. This was tested with Chromedriver.


Happy testing and... make it green, becomes a dream :).

Tuesday, August 9, 2016

Protractor - Double click on row based on cell text and column name

Working with Protractor promises can be, sometimes difficult. The same is true in the case we want to work with grids.
After searching for a while a solution for double clicking on a grid row, base on the cell text and the column name, I found one. Here is the code for it.

In this example you can double click or click a row based on the cell text and column name.
headers() is a separate function that identifies all column headers in the grid.


readGridData() is a separate function that takes all records from the grid and maps all cells in records.


row() and rows(), will get the records and the record texts in the grid


Happy testing and... make it green, becomes a dream :).

Popular Posts