Hi,
I've tried using if...else.. logical step. The 'if' part just works fine but when I tried the scenario for negative test and supposed to be the 'else' part will execute, the test failed.
pseudo code goes like this:
Scenario 1
1. Navigate to application URL
2. Handle Log on dialog box (Valid Username and Password)
3. IF (Checks if application page is visible)
4. Navigate to each sections of the page and verifies each controls.
5. ELSE (Checks if page contains '<Error message>') -->> Not Executed
so, this test passed
Scenario 2
1. Navigate to application URL
2. Handle Log on dialog box (Invalid Username and Password)
3. IF (Checks if application page is visible) -->> since the page will not load, the IF part fails.
4. Navigate to each sections of the page and verifies each controls. -->> this will not be executed
5. ELSE (Checks if page contains '<Error message>') -->> this ELSE part also fails.
so for this scenario, the overall test execution fails which is not the expected result. I think the IF part and step 4 should not be executed so that the ELSE part could proceed.
I've attached screenshots of what I am doing.
Scenario1.jpg
Scenario2.jpg
Also, the above scenarios are executed separately. I've noticed that when I try to make the scenarios Data-Driven(Iteration 1 and 2), Iteration 2 being the negative test, it does not behave what is expected. Iteration 2 behaves like the Iteration 1. Invalid user can log on to the page. I think this is because Test Studio do not close Browser on every end of Iteration so even though I've added a 'Clear Cache' step at the end of the test, the credentials for Iteration 1 is still active for Iteration 2. I've also tried to set the Behavior Property ClosesBrowser = True but it has the same result.
I've attached the Log file with a note inside. (deleted some project releted text).
Thanks!
Mariko
I've tried using if...else.. logical step. The 'if' part just works fine but when I tried the scenario for negative test and supposed to be the 'else' part will execute, the test failed.
pseudo code goes like this:
Scenario 1
1. Navigate to application URL
2. Handle Log on dialog box (Valid Username and Password)
3. IF (Checks if application page is visible)
4. Navigate to each sections of the page and verifies each controls.
5. ELSE (Checks if page contains '<Error message>') -->> Not Executed
so, this test passed
Scenario 2
1. Navigate to application URL
2. Handle Log on dialog box (Invalid Username and Password)
3. IF (Checks if application page is visible) -->> since the page will not load, the IF part fails.
4. Navigate to each sections of the page and verifies each controls. -->> this will not be executed
5. ELSE (Checks if page contains '<Error message>') -->> this ELSE part also fails.
so for this scenario, the overall test execution fails which is not the expected result. I think the IF part and step 4 should not be executed so that the ELSE part could proceed.
I've attached screenshots of what I am doing.
Scenario1.jpg
Scenario2.jpg
Also, the above scenarios are executed separately. I've noticed that when I try to make the scenarios Data-Driven(Iteration 1 and 2), Iteration 2 being the negative test, it does not behave what is expected. Iteration 2 behaves like the Iteration 1. Invalid user can log on to the page. I think this is because Test Studio do not close Browser on every end of Iteration so even though I've added a 'Clear Cache' step at the end of the test, the credentials for Iteration 1 is still active for Iteration 2. I've also tried to set the Behavior Property ClosesBrowser = True but it has the same result.
I've attached the Log file with a note inside. (deleted some project releted text).
Thanks!
Mariko