Fetch dynamic data from api and run the same test by looping though data #26662
chintanshah27
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
I am trying to find the solution for my team where they need to fetch data from api and then they need to loop through this data to verify ui.
Because of data hoisting forEach and api call happening at the same time and unable to wait before for loop starts.
I have written a code snippet to explain above problem
In above example data is always printed from what i have declared at the top and not inside before loop.
do any of you have ever need to do it and how did you solve it?
Beta Was this translation helpful? Give feedback.
All reactions