I am automating a web login page that has Email, First Name, Last Name and Username as mandatory text fields. When I leave all of them blank and click the login button, it generates the correct error message (screenshot 5.png) and the recording passes. Now, if I enter the First Name and click login again, the correct error message is shown (screenshot 6.png). However, the recorder fails at this point failing to validate the error message(6.png). I have tried both image and text based comparison.
Please advise.
Thanks,
Image and Text based validation Fails
Image and Text based validation Fails
You do not have the required permissions to view the files attached to this post.
Re: Image and Text based validation Fails
Hi,
In a recent automation I need to make an image comparison step. Wrote about it in a post, hope it helps:
http://www.ranorex.com/forum/ranorex-im ... tml#p18500
at least you can have a % of simmilarity between images because even a pixel can ruin the comparison
regards,
Mateo.
In a recent automation I need to make an image comparison step. Wrote about it in a post, hope it helps:
http://www.ranorex.com/forum/ranorex-im ... tml#p18500
at least you can have a % of simmilarity between images because even a pixel can ruin the comparison
regards,
Mateo.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Image and Text based validation Fails
Hi,
I think performing image based validation only makes sense if you are not able to perform text based validation.
So, what exactly is the problem when validating the text.
Regards,
Tobias
Ranorex Team
I think performing image based validation only makes sense if you are not able to perform text based validation.
So, what exactly is the problem when validating the text.
Regards,
Tobias
Ranorex Team
Re: Image and Text based validation Fails
Hi,
My problem is that the same repository item has two different texts stored:
1) When the user doesn't enter anything, 5.png is shown in the UI and validated passes
2) When the user enters the firstname, 6.png is shown in the UI and the validation fails with the following error:
Attribute 'InnerText' of element for item 'xxxRepository.yyy.CommandErrors1' does not match the specified value (element is not valid).
Please advise.
My problem is that the same repository item has two different texts stored:
1) When the user doesn't enter anything, 5.png is shown in the UI and validated passes
2) When the user enters the firstname, 6.png is shown in the UI and the validation fails with the following error:
Attribute 'InnerText' of element for item 'xxxRepository.yyy.CommandErrors1' does not match the specified value (element is not valid).
Please advise.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Image and Text based validation Fails
Hi,
You could for instance add a UserCode action to your Recording where you can validate if whether the first or the second text is displayed, you could set the ExceptionOnFail property to false in order to prevent Ranorex from stopping the execution when the validation fails.
Regards,
Markus
You could for instance add a UserCode action to your Recording where you can validate if whether the first or the second text is displayed, you could set the ExceptionOnFail property to false in order to prevent Ranorex from stopping the execution when the validation fails.
Regards,
Markus
Re: Image and Text based validation Fails
Hi,
Would you have an example code snippet for the UserCode action where you can validate if whether the first or the second text is displayed?
Would you have an example code snippet for the UserCode action where you can validate if whether the first or the second text is displayed?
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Image and Text based validation Fails
Hello,
You can check that using the "Validate.Exists()" method using the RanoreXPath of the item. The last parameter of the method is the ExceptionOnFail property.
For example:
Regards,
Bernhard
You can check that using the "Validate.Exists()" method using the RanoreXPath of the item. The last parameter of the method is the ExceptionOnFail property.
For example:
bool formExists = Validate.Exists("/form[@title='Calculator']", 3000, "Validate Calculator", false); if(formExists) { Report.Info("Calculator exists"); } else { Report.Info("Calculator doesn't exist"); }Please modify this example for your needs.
Regards,
Bernhard