Reputation:
I have issue when i try rebuild my project , i get following error:
Type 'By' has no properties in common with type 'Locator'
Can someone please point me in the right direction?
Upvotes: 7
Views: 3742
Reputation: 1959
This is a bug in Protractor 4.x / Webdriver. the element
method expects a Locator
but by.css
returns a webdriver.by
object. To fix this compilation error you need to cast it to a Locator
like:
import { Locator } from 'protractor/built/locators';
...
element(<Locator>by.css('h1'))
Upvotes: 10