Hi Im constantly troubled with failings on Case sensitivity validations like below.
does not match the specified value (actual='Active', expected='ACTIVE').
is there a setting to Ignore case sensitivity in test suit level .
Please advice
How to ignore Case sensitivity in validations
Re: How to ignore Case sensitivity in validations
Hi,
I'm afraid, there is no solution at the test suite level. What you can do is to add a case insensitive regex to the problematic validations. Instead of AttributeEqual use AttributeRegEx. Unfortunately, Validate action with AttributeRegEx currently cannot be combined with variable (directly in Recording action). So you will have to convert the Validation action to "user code" first, and then modify the converted action with above suggested regex. It should look like this:
And the same you can do with repo xpaths:
or combined with variable...
BTW, you can cast your vote about combining regexes with variables (in validate actions) here:
http://uservoice.ranorex.com/forums/150 ... on-match-v
I'm afraid, there is no solution at the test suite level. What you can do is to add a case insensitive regex to the problematic validations. Instead of AttributeEqual use AttributeRegEx. Unfortunately, Validate action with AttributeRegEx currently cannot be combined with variable (directly in Recording action). So you will have to convert the Validation action to "user code" first, and then modify the converted action with above suggested regex. It should look like this:
Code: Select all
Validate.Attribute(repo.YourItemInfo, "InnerText", new Regex("(?i:" + stringVariable + ")\\s*$"));
Code: Select all
.//td[@innertext~'(?i:yourtext)\s*$']
Code: Select all
.//td[@innertext~'(?i:'+$stringVariable+')\s*$']
http://uservoice.ranorex.com/forums/150 ... on-match-v
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 to ignore Case sensitivity in validations
First, if the case is important and your SUT says "Active" then your test should test for "Active" not "ACTIVE". These are different, and sometimes it is a requirement to test for the exact case.
Second, if you don't care about case you can always just change the case of both actual and expected values to the same case like:
Second, if you don't care about case you can always just change the case of both actual and expected values to the same case like:
Code: Select all
Validate.Equal(actual.ToUpper(), expected.ToUpper());
Shortcuts usually aren't...
Re: How to ignore Case sensitivity in validations
Nice tip Kelly!krstcs wrote:Second, if you don't care about case you can always just change the case of both actual and expected values to the same case like:
Code: Select all
Validate.Equal(actual.ToUpper(), expected.ToUpper());
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