Validating text in Multiple Language Formats

Ask general questions here.
starrdoug99
Posts: 5
Joined: Thu Jul 12, 2012 4:32 pm

Validating text in Multiple Language Formats

Post by starrdoug99 » Mon Jun 04, 2018 7:21 pm

We are using Ranorex to validate a bunch of values in cells in reports on one of our web products. We validate the value in each cell in a validation step in a recording as you would expect. This product just implemented support for multiple languages and we are being asked to make the automation run in each of these languages. Most of the repo items work fine, because they are looking at other attributes besides "innertext".

The problem I'm having is with all of the validation steps, the format for currency is different. For example $49.24 is $49,24 in French, notice the comma instead of a decimal place between the dollars and sense. I know that I could variabalize all of these values then pass in the value I want for each cell from a data-source, but there are thousands of cells that we are validating on.

I was just curious if anyone has a better suggestion for how to validate these values, without creating thousands of variables, or having to implement a user code method on every validation step. I'm thinking a simple solution like putting a wildcard where the decimal place is or something along those lines. From what I've read, and tried so far, I couldn't find a way to make that work.

Thank you
Doug

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Validating text in Multiple Language Formats

Post by Support Team » Mon Jun 04, 2018 9:03 pm

Hi starrdoug99,

I think a regular expression pattern (also known as regex) for the innertext value is what you are looking for. The below pattern will match ($ OR £ OR €) 49 (. OR ,) 24 such as the examples below.
  • $49.24
    $49,24
    £49.24
    €49.24
Regex Pattern: (\$|\£|\€)49(\.|\,)24
Used in a RanorexPath: //input[@innertext~'(\$|\£|\€)49(\.|\,)24']

I hope this helps! If you need further assistance, please provide a few Ranorex Snapshots of each different type of currency you need to match and I will be happy to further assist you.

Cheers,
Ned
.
Image