Need help typing getElements
return value in typescript
#11989
-
Hello all! I have a really basic question but I just can not figure it out on my own. I am using For example (i know 0 doesn't pull the last item, this is just an example):
However, because I am using typescript, I need a type for I did make sure to follow along with the Typescript Setup in the Docs to set up my install correctly but I still can not find the correct type. I am not sure if the information I found on Does anyone know the return value for Any help is greatly appreciated!! Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@sarahandromeda the return value for
Let me know if these work. |
Beta Was this translation helpful? Give feedback.
@sarahandromeda the return value for
await $$(someSelector)
should beWebdriverIO.ElementArray
andfoundElems[0]
should resolve toWebdriverIO.Element
. If you don't have theWebdriverIO
namespace available, I guess the type setup is not correct. It should normally pick it up automatically. Try one of the following:@wdio/globals/types
to thetsconfig.json
as you can see in the docsimport { $$ } from '@wdio/globals'
/// <reference types="webdriverio">
to the top of the file.Let me know if these work.