- Don’t forget to turn off
control_flow
, you cannot use a mix ofasync/await
and thecontrol flow
:async/await
causes the control flow to become unreliable. So if youasync/await
anywhere in a spec, you should set theSELENIUM_PROMISE_MANAGER: false
- Note: To write and run native
async/await
test, the node.js version should be greater than or equal to 8.0, and Jasmine version should be greater than or equal to 2.7
- It's the slowest and most brittle locator strategy of all
- Markup is very easily subject to change and therefore xpath locators require a lot of maintenance
- xpath expressions are unreadable and very hard to debug
- They are very performant and readable locators
- Access elements easier
/* recommended */
let nameElement = element(by.binding('color.name'));
let personName = element(by.model('person.name'));
let elementById = element(by.id('myId'));
let elementByCss = element(by.css('.myclass'));
/* by.css() === $() */
let navButton = element($('#myNavButton'));
- Encapsulate information about the elements on the page under test
- They can be reused across multiple tests
- Decouple the test logic from implementation details
// TODO