Pls consider the below code:
//CL.DCBS_List_AllElements = $$('#directClassBased > option')
this.shouldMatchDCBSList = async function () {
var DCBSItems = await CL.DCBS_List_AllElements;
console.log('Test Text = '+await CL.DCBS_List_AllElements.get(3).getText());
console.log('Test Text 2 = '+await DCBSItems.get(4).getText());
When I execute this piece of code, the first console.log (console.log('Test Text = '+await CL.DCBS_List_AllElements.get(3).getText());) return the text as expected. But for the next one, when I am using it as a variable ( "await DCBSItems.get(4).getText()" ) , it gives me the following error:
Failed: DCBSItems.get is not a function
This is kind of strange as I could get the text returned before when I passed the elements using the parameters/variables. I spent many hours to fix it but its not working now. How can we fix it ?