How to update the method scope variable from a callback function #30007
Unanswered
sravanthi1047
asked this question in
Questions and Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am new bie to Cypress and I am facing trouble in updating the method level variable using callback function. Can anyone help me here please.
In the above code, I am trying to increment the value of method variable 'warningLabelsCount' inside a callback function, and am expecting the final value after the for loop and hence the callback finishes its function. The value of variable 'warningLableCount' @ line #542 is coming as expected but the output of line #547 is always giving 0.
I am really stuck at this point. Can anyone please let me know my mistake here and how to get the updated warning labels count returned from the function.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions