Verification fails with Actual = Expected

Ask general questions here.
zoework
Posts: 38
Joined: Tue Jan 27, 2015 10:44 pm
Location: Charlotte, NC, USA

Verification fails with Actual = Expected

Post by zoework » Mon Jun 29, 2015 7:40 pm

The following error message shows the Actual and Expected results, but they look the same to me:
Attribute 'InnerText' of element for item 'Phoenix_OrdersRepository.TradeKingLIVE.Content.Alerts' does not match the specified value (actual='Alerts ', expected='Alerts ').
Any ideas on what is going wrong?
Thanks,
Zoë (aka zoework)

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

Re: Verification fails with Actual = Expected

Post by odklizec » Mon Jun 29, 2015 7:59 pm

Hi,

In my opinion, there are some invisible characters at the end of validated strings (like the end of line, new line, tab instead of space or multiple spaces) not visible in report? Have you tried to debug the code and examine the validated strings? I'm sure you can find the difference in debug ;)
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

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Verification fails with Actual = Expected

Post by krstcs » Tue Jun 30, 2015 1:44 pm

I agree with Pavel, it is probably capturing some non-printable whitespace characters at the end.

Also, instead of using Attribute Equal, you could try Attribute Regex and trim the whitespace from the expected value.
Shortcuts usually aren't...

zoework
Posts: 38
Joined: Tue Jan 27, 2015 10:44 pm
Location: Charlotte, NC, USA

Re: Verification fails with Actual = Expected

Post by zoework » Wed Jul 01, 2015 3:24 pm

Thanks everybody. I'm now using AttributeContains instead of AttributeEquals and it works fine.
Thanks,
Zoë (aka zoework)