Hi there. I'm currently evaluating a number of test automation tools. For initial comparison demonstrations I'm recording scripts against calc.exe. I can create the test case recording (10,+,10,=,validate '20') but whenever I click the display to validate 20 it reads the Text property as an empty string - even though the screenshot it takes displays '20' - and seems to then blank the display.
Any information is appreciated, thanks.
OS: Windows 7
Ranorex: 3.0.2.12718
.Net: 4.0.30319.225
Issue with validating text
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Issue with validating text
Hello Andrew,
the display of the Windows 7 calculator is a little complicated, because it also can contain some extra information like "M". Enter a number in the calculator for recognition in the Spy and analyze the display with the Spy. I get this RanoreXPath:
The RanoreXPath identifies an element and sometimes you need to adapt it a little, although mostly its only because you want to make it more general such that it works for all situations where you want to use it.
Regards,
Roland
Ranorex Support Team
the display of the Windows 7 calculator is a little complicated, because it also can contain some extra information like "M". Enter a number in the calculator for recognition in the Spy and analyze the display with the Spy. I get this RanoreXPath:
Code: Select all
/form[@title='Calculator']/element/container/text[@ControlId='150']
Regards,
Roland
Ranorex Support Team
Re: Issue with validating text
Thanks very much for the response.
I'll test out the Spy further tomorrow.
I'll test out the Spy further tomorrow.
Re: Issue with validating text
Spy seems to give me
and the related generated .cs is
I suppose I should be able to use that xpath with validate attribute as you would with selenium, however to test that I changed the '20' references to '99' in the .cs file, ran the exe yet it still validated for '20'.
Code: Select all
/form[@title='Calculator']/element/container[@caption='' and @class='#32770' and @instance='0']/text[@windowtext='20']
Code: Select all
Validate.Attribute(repo.FormCalculator.TextN160Info, "Text", "20");
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Issue with validating text
As you said yourself, the *.cs code file for a recording is automatically generated. Consequently, your changes will be overwritten every time the code for the recording is generated and that is whenever you press compile or run. That's why the first line in the recording code file says "Do not edit"
Please, edit the recording only within the Recorder UI or in the UserCode file. See the corresponding section in the Ranorex User Guide:
http://www.ranorex.com/support/user-gui ... rding.html
Regards,
Alex
Ranorex Team

Please, edit the recording only within the Recorder UI or in the UserCode file. See the corresponding section in the Ranorex User Guide:
http://www.ranorex.com/support/user-gui ... rding.html
Regards,
Alex
Ranorex Team
Re: Issue with validating text
Thanks again for your help and apologies for the silly questions. I'm evaluating a dozen different automation tools at the moment and really don't have time to go through all of the help documentation for all of them, so it's catch as catch can at the moment. I will try and have a good look through the Ranorex docs before bothering you again.