Hi Team,
We are validating some objects in our recording. We want to get the status of the validation (success or failure) inside a code module. Could you please let us know if there is any function or code avaliable to get the validation status(for all validation, not specific to particular type/object).
It would be great if you could share us your thoughts/workaround.
Thank you,
Anbu K
Function to identify Validation status
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Function to identify Validation status
Hi,
Regards,
Peter
Ranorex Team
You want to receive all validation steps in your solution, right? Do you want to perform this action during runtime or when the solution has finished?Anbu wrote:We are validating some objects in our recording. We want to get the status of the validation (success or failure) inside a code module. Could you please let us know if there is any function or code avaliable to get the validation status(for all validation, not specific to particular type/object).
Regards,
Peter
Ranorex Team
Re: Function to identify Validation status
Hi, We have a user Actions recording (Recording1.rxrec) with some validation steps. After each validation step, I need to call a function which posts the defect. For that, I need to know the status of the validation step since the defect should be be posted only when the validation step fails.
We are trying to get the validation status inside code module(Recording1.usercode.vb).
Kindly let us know if this is possible with Ranorex.
Thanks
Anbu K
We are trying to get the validation status inside code module(Recording1.usercode.vb).
Kindly let us know if this is possible with Ranorex.
Thanks
Anbu K
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Function to identify Validation status
Hi,
Ranorex throws a validation exception if a validation went wrong. If you add a try catch block over your validation action, you could execute any code you want in the catch block.
Regards,
Peter
Ranorex Team
Anbu wrote:Kindly let us know if this is possible with Ranorex.
Ranorex throws a validation exception if a validation went wrong. If you add a try catch block over your validation action, you could execute any code you want in the catch block.
Regards,
Peter
Ranorex Team
Re: Function to identify Validation status
Hi Peter,
Thanks for your response.
We are trying to get the status of the validation without converting it into user code. Please could you let us know if it is possible to get the validation status by having the validate step as a recorded step in the user actions table?
Regards
Anbu K
Thanks for your response.
We are trying to get the status of the validation without converting it into user code. Please could you let us know if it is possible to get the validation status by having the validate step as a recorded step in the user actions table?
Regards
Anbu K
Re: Function to identify Validation status
Hi Peter,
If I add a try catch block over validation action what will be the line of code that will go to the next test case instead of exit out the test run.
Thank you,
Beginner
If I add a try catch block over validation action what will be the line of code that will go to the next test case instead of exit out the test run.
Thank you,
Beginner
Tipu
Re: Function to identify Validation status
Hi Peter/Team,
Please could you let us know if we can get the validation(Recorded one) status without using any user code?
Is there any inbuilt option avaible in Ranorex to identify the validation status?
Thank you,
Anbu K
Please could you let us know if we can get the validation(Recorded one) status without using any user code?
Is there any inbuilt option avaible in Ranorex to identify the validation status?
Thank you,
Anbu K
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Function to identify Validation status
Hi!
It is not possible to do this without writing any user code.
But I can give you tow possible ways to realize it, writing just a few lines of code.
The first one might be:
Create your validation and activate “Continue on fail” for this validation via the context menu of the action.
Afterwards, you should set the property “Report Level on Failure” for this action to “Warn”. This means that there won't be an exception to the report file, but a warning.
After the validation, define a user code method. In this method, check if there was a warning so far in the current module, if there was a warning, call your method.
The second solution:
Create your validation, convert it to user code (via the actions context menu) and put a try block around the validation. In the catch block, call your method.
E.g.
Best regards,
Martin
Ranorex Support Team
It is not possible to do this without writing any user code.
But I can give you tow possible ways to realize it, writing just a few lines of code.
The first one might be:
Create your validation and activate “Continue on fail” for this validation via the context menu of the action.
Afterwards, you should set the property “Report Level on Failure” for this action to “Warn”. This means that there won't be an exception to the report file, but a warning.
After the validation, define a user code method. In this method, check if there was a warning so far in the current module, if there was a warning, call your method.
Code: Select all
if (TestSuiteModule.Current.HasWarnings) {
//Call your method
}
Create your validation, convert it to user code (via the actions context menu) and put a try block around the validation. In the catch block, call your method.
E.g.
Code: Select all
try {
Validate.Attribute(repo.WebDocumentTest_Automation_Tools___.ATagTest_AutomationInfo, "InnerText", "SomeValidation");
} catch {
//Call your method
}
Martin
Ranorex Support Team
You do not have the required permissions to view the files attached to this post.