PROTRACTOR SNIPPETS
How To Test Non-Angular Pages Using Protractor
Protractor was majorly used for testing angular application and pages. However there is also a need of testing non-angular pages. Support is available to test non-angular pages however implementation is bit different.
Key Points For Testing Non - Angular Pages
Protractor has a in built mechanism where it keeps on waiting for angular pages to load and to began execution. However if our pages of operation are non-angular then protractor keeps on waiting finally resulting into timeouts.
​
Make use of:
1. Use browser.driver instead of driver.
2. Use browser.driver.ignoreSynchronization = true
3. Use browser.driver.findElement(by.locator('elem_id')) instead of element(by.locator('elem_id')).
​
If you have a mix and match of angular and non-angular pages use of browser.driver.ignoreSynchronization = true / false should be able to solve the problem however it can be a bit complicated.
Protractor has maxSessions in multiCapabilities with shardTestFiles to support multiple browser execution.
​
A typical " protractor.conf " configuration is shown below.
maxSessions: 2,
multiCapabilities: [
{
'name': 'Chrome',
'browserName': 'chrome',
'platform': 'Windows 8.1',
'count': 1,
'shardTestFiles': true,
},
{
'name': 'Firefox 47.0.1',
'browserName': 'firefox',
'platform': 'Windows 8.1',
'count': 1,
'shardTestFiles': true,
'maxInstances': 1
}, ],
Note:- It is worth understanding that not all Firefox versions do not work with Protarctor. The latest FIrefox version know to work with Protractor is Firefox 47.0.1.