Forum Discussion
It's already in the loop. I selected everything and tried move it to the right but it doesn't let me do it.
I would try the two If Then sections like this instead
If ... Then
Else
If... Then
If that doesn't work, then put some debug statements before and after each step of the two IF statements to make sure that the variables you are testing on actually contain the values you expect. You may be accidentally comparing string to number or have some other mismatch.
- Iso_Yura2 years agoContributor
Not it works, but not how I need to.
I have DDL test:
step 1
step 2
step 3
step 4
If...Then
run test A
Else
run test B
Now it executes all 4 steps, then it gets to If statement, which is True, then it runs test A.
After that it runs again 4 DDL steps(that's what I need) but then it runs again test A.
It shouldn't run test A, as condition is False now. It should run test B.
My test creates a new project, where project name is a variable stored in csv file, this is what my data driven loop does, each line in csv file is a project name.
After I created first project A, it should run DDL test where it reads project name from csv file, then I store project name into a variable X, then it gets to the condition where I check if variable X is == project name, in instance if X==new project1 then run test A, if X==new project2 then run test B.
Every time when it runs through DDL steps it takes a project name as "new project1", "new project2", "new project3" and "new project4". It stores it into variable X, then it compares if X==new project1, and so on.
In my If statement condition I have If X == "variable from DB Table", I'm expecting that it compares X with value in DB Table, this is new project1, new project2, basically those values are the same as I use for data driven loop(DDL).
- Marsha_R2 years agoModerator
So then you need to check your variable values at each step and make sure they are updating as you expect. You can use the Watch List
https://support.smartbear.com/testcomplete/docs/testing-with/debugging/panels/watch-list/about.html
and then Debug and step through the code.
Related Content
- 7 years ago
Recent Discussions
- 3 days ago