My Code is like
async function myTestFunc(){
let items:ElementArrayFinder = await element.all( by.xpath("./li"));
}
That code gives below error
'items' is declared but its value is never read.ts(6133)
Type 'any[] | ElementFinder[]' is not assignable to type 'ElementArrayFinder'.
Type 'any[]' is missing the following properties from type 'ElementArrayFinder': browser_, getWebElements, locator_, actionResults_, and 35 more
Docs say "element.all
" returns "ElementArrayFinder
".
but when "element.all
" used within async/await function it seems to be returning "ElementFinder[]
".
How is that possible ?
because of this I can't use methods like "each()
" or "get()
" in "ElementArrayFinder
".
What is the best possible way to use "element.all
" within "ElementArrayFinder
" ?
This is my package.json
"devDependencies": {
"@types/jasmine": "^3.3.5",
"@types/node": "^10.12.18",
"protractor": "^5.4.2",
"typescript": "^3.2.2"
},
"dependencies": {
"@types/jasmine-data-provider": "^2.2.1",
"jasmine-data-provider": "^2.2.0",
"protractor-jasmine2-html-reporter": "0.0.7"
}