AnsweredAssumed Answered

Will all my assertions in my test case will run in CA dev test and how to do a negative scenario?

Question asked by johnysv on Dec 15, 2017
Latest reply on Feb 6, 2018 by johnysv

I ran a test suite which has 3 test cases(ran locally) . I thought my assertions in each test case got passed. So again I tried out in another way. I manually made an assertion in one of the test case to be "false"(by giving some wrong value). This time when I ran the suite again (ran locally) and got the same result which is "PASS" for 3 test cases. I dont know what happened here. Even my assertion is false , how the test case got passed.? Whats the point of automating this? If the API doesnt give response , will my test case pass too?

 

Is there a place where I can see the results for each assertion whether it got passed or failed because I can see only the result for entire test case.

 

case 1: I gave like if my assertion is "true" then "end the test". In this case my assertion got succeeded (because i gave correct value in "expected value" field) and all my test cases got passed.

 

case 2: I gave like if my assertion is "true" then end the test.In this case my assertion got failed (because I gave a wrong value in "expected value" field). This time also all my 3 test cases got passed.

 

Note: assertion is in my 1st test case(out of three test cases)

 

If the service which I m testing is not working, then case2 will happen, correct?.So in that case, how will I know if my test case got passed?

 My question is : I am expecting a value "x" in one field which I will keep it as "expected value". So, if my service has no issues then "x" will be obtained in the response and then it will match exactly with my "expected value". What if when my actual service is down? I wont get "x" in my response. Then my assertion will become false. If my assertion is false....my service response is wrong.....and if it is wrong, how can my test case get passed?Is there anyother way my test case (only one case out of three) get failed if my actual service is down. Or is there any other option to do my negative scenario? 

 

And I m not sure all of my assertions are executed if I have multiple assertions in my test case. 

 

 

see attached screen shot

Outcomes