Ignore spacing - Validation

Best practices, code snippets for common functionality, examples, and guidelines.
armstronghm24
Posts: 38
Joined: Tue Dec 20, 2016 10:16 pm

Ignore spacing - Validation

Post by armstronghm24 » Tue Jan 23, 2018 3:01 pm

I am trying to validate some text which contains spacing. How do I ignore any spacing when validating text against a variable. Here's an example of something I want to validate:
Rule Error
01 of 01

1234 INCREASES TO VARIABLE WHOLE LIFE AMOUNT NOT
ALLOWED AFTER 90 DAYS FROM

ISSUE DATE xx-xx-xxxx
------------------------------------------------------------

I would just like to validate that field contains: "Increases to variable whole life amount not allowed after 90 days from issue date". I am able to validate that it contains "Increases to variable whole life amount not", but when I try validating the field contains "Increases to variable whole life amount not allowed after 90 days from issue date", the validation doesn't work. I am assuming it is because the text falls on 3 separate lines. How do I get around this?

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

Re: Ignore spacing - Validation

Post by Support Team » Tue Jan 23, 2018 9:54 pm

Hi armstronghm24,

There can be several ways to handle this but varies on the element itself. Are the lines all within one element or are they spread across multiple elements? With a Ranorex Snapshot of this problematic element, I will be able to further assist you.

Cheers,
Ned
.
Image

armstronghm24
Posts: 38
Joined: Tue Dec 20, 2016 10:16 pm

Re: Ignore spacing - Validation

Post by armstronghm24 » Thu Jan 25, 2018 4:33 pm

Hi,

I would attach a snapshot if I could get one of the specific element. However, it is capturing my entire application which has confidential information at the moment. Do you know if there's a way to get the specific element in a snapshot? Otherwise I can tell you that the lines are all within one element. If that snapshot isn't possible or that isn't enough information to go on, I'll work on getting a snapshot with fake data...

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Ignore spacing - Validation

Post by odklizec » Thu Jan 25, 2018 5:13 pm

Hi,

You can try to generate the snapshot with unchecked option "Let snapshot contain complete ancestor subtree" as described here:
https://www.ranorex.com/forum/browsing- ... tml#p33974
This should limit the snapshot to just selected element.
Pavel Kudrys
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

armstronghm24
Posts: 38
Joined: Tue Dec 20, 2016 10:16 pm

Re: Ignore spacing - Validation

Post by armstronghm24 » Thu Jan 25, 2018 7:45 pm

I have a snapshot of the element attached.

Thanks for your help.
Attachments
ErrorTxtSnapShot.rxsnp
(28.43 KiB) Downloaded 11 times