I have question, if there is possibility to repeat current test case, if we know that there is an problem with page loading.
I catch the exception when element not exist on page, right now I woul like not failed test case, but repeat this test case by defined by counter number (static variable). Is this possible in Ranorex, which method I can use? or maybe some article on blog?
How repeat current test case
Re: How repeat current test case
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: How repeat current test case
I check it, and set up as described, but test case was not repeted.
Element was not exist on page, loader instead. Test case failed on try-catch exception
I would expect that this test case will be repeated.
try {
this.Element.WaitForExists(_DefaultTimeout);
} catch(Exception e) {
Log(ReportLevel.Failure, "Validation", "Element not found on page, this.Element);
}
Is there possibility to run method to repeat test case from code. e.g. in try-catch block?
Element was not exist on page, loader instead. Test case failed on try-catch exception
I would expect that this test case will be repeated.
try {
this.Element.WaitForExists(_DefaultTimeout);
} catch(Exception e) {
Log(ReportLevel.Failure, "Validation", "Element not found on page, this.Element);
}
Is there possibility to run method to repeat test case from code. e.g. in try-catch block?
Re: How repeat current test case
Hi,
Have you tried to run your test with retry and without try-catch block? I think try-catch could be the reason, why the test is not repeated? As far as I know, there is no publicly available way to replay a test case from code.
Have you tried to run your test with retry and without try-catch block? I think try-catch could be the reason, why the test is not repeated? As far as I know, there is no publicly available way to replay a test case from code.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: How repeat current test case
Hi darpro,
If only "Failure" is triggered in the module, then the retry should work despite the try-catch. However, if your code also has some other issue, then an "Error" could be triggered, some exception in the code. In this case, the retry will not work. "Error" and "Failure" are not the same thing. You can test this by changing the report level to "Error" in your code below. Are you sure that you don't also have some other exceptions in your code?
Regards,
McTurtle
If only "Failure" is triggered in the module, then the retry should work despite the try-catch. However, if your code also has some other issue, then an "Error" could be triggered, some exception in the code. In this case, the retry will not work. "Error" and "Failure" are not the same thing. You can test this by changing the report level to "Error" in your code below. Are you sure that you don't also have some other exceptions in your code?
Regards,
McTurtle