Ask a Question

My CheckProperty with cmpEqual always return an error when it checks 2 identical texts

SOLVED
slaugier
Occasional Contributor

My CheckProperty with cmpEqual always return an error when it checks 2 identical texts

Hi

 

My aqObject.CheckProperty always fails. However, the text is strictly the same.

 

I tried with cmpEqual : 

aqObject.CheckProperty(Aliases.browser.page1000508080FinvestQa31Startse.panelLeftcontainer.panelRiskClassGauge.panelGauge.panelContainer.panelHighcharts0, "contentText", cmpEqual, "Created with Highcharts 4.1.4↴IR7↴Classe de↴risque 2↴Classe de risque 2↴Classe de↴risque 3↴Classe de risque 3↴Classe de↴risque 4↴Classe de risque 4");

cmpEqual_error.PNG

 

 

and with cmpMatches :

  aqObject.CheckProperty(Aliases.browser.page1000508080FinvestQa31Startse.panelLeftcontainer.panelRiskClassGauge.panelGauge.panelContainer.panelHighcharts0, "contentText", cmpMatches, "Created with Highcharts 4.1.4↴IR7↴Classe de↴risque 2↴Classe de risque 2↴Classe de↴risque 3↴Classe de risque 3↴Classe de↴risque 4↴Classe de risque 4");

cmpMatches_error.PNG 

 

I tried to add 

aqEnvironment.LanguageForNonUnicodePrograms = "French";

at the beginning of my function, but it doesn't help.

 

Do you have any idea?

 

Sylvain

5 REPLIES 5
cunderw
Community Hero

Being a web page, my guess is that there is a zero width character in the on screen text (often used for formatting). Can you try comparing the two strings with a better diff tool? https://text-compare.com might help. 


Thanks,
Carson

Click the Accept as Solution button if my answer has helped
slaugier
Occasional Contributor

Thanks for your answer.

 

https://text-compare.com/ says : The two texts are identical

Can you copy the text directly from your website, and your expected text into a text file and upload them? 


Thanks,
Carson

Click the Accept as Solution button if my answer has helped
tristaanogre
Esteemed Contributor

Note that the characters you have in your code that show up as 

are how TestComplete represents those non-printing characters.  They may be more accurately represented by a /n or something like that.  As @cunderw suggests, that may be where the problem is. 


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
slaugier
Occasional Contributor

Thank you for your messages.

 

The solution was to replace special characters with \n.

 

Best,

cancel
Showing results for 
Search instead for 
Did you mean: