Forum Discussion

slaugier's avatar
slaugier
Occasional Contributor
7 years ago

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");

 

 

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");

 

 

I tried to add 

aqEnvironment.LanguageForNonUnicodePrograms = "French";

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

 

Do you have any idea?

 

Sylvain

  • 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. 

  • cunderw's avatar
    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. 

    • tristaanogre's avatar
      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. 

    • cunderw's avatar
      cunderw
      Community Hero

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

  • slaugier's avatar
    slaugier
    Occasional Contributor

    Thank you for your messages.

     

    The solution was to replace special characters with \n.

     

    Best,