Forum Discussion

mtrampe's avatar
mtrampe
Occasional Contributor
12 years ago

Special Characters like θ are not recognize by Test Complete

I am verifying if the text displayed in the web page show the correct characters, but when I get the value by using contentText, the special characters changed to "?". when I try to compare my expected result from what I got from the web page it is not the same.



Is there a way I can capture the special character and correctly compare it to my expected result?



Thanks!


  • Hi Mike,


     


    Now, I've got what you meant.


     


    Actually, TestComplete should operate with the Greek characters. The problem is that third-party controls used in TestComplete are non-Unicode, and therefore, they cannot display Unicode characters. However, TestComplete stores and uses valid Unicode symbols. You can check this by executing the following code (it saves the subject of this thread to the text file):


    function test()


    {



     var text=Sys.Browser("chrome").Page("*").Form("form").Panel("container").Panel("main").Panel("content").


    Panel(0).Panel("p_lt_zoneContent_pageplaceholder_pageplaceholder_lt_zoneContent_GroupForumList_groupElem1_threadElem").


    Panel(0).Table(0).Cell(1, 0).Panel(0).Table(0).Cell(2, 0).Panel(0).


    Table(0).Cell(0, 0).TextNode(0).contentText;


     var sPath = "d:\\MyFile.txt";


     


     aqFile.WriteToTextFile(sPath, text, aqFile.ctUnicode, true);



    }


    You should see in the file: RE: Special Characters like θ are not recognized by Test Complete


     


    So, you can create a property checkpoint for the web element and compare it with the stored value:



    aqObject.CheckProperty(NameMapping.Sys.Browser("chrome").Page("*").Form("form").


    Panel("container").Panel("main").Panel("content").Panel(0).


    Panel("p_lt_zoneContent_pageplaceholder_pageplaceholder_lt_zoneContent_GroupForumList_groupElem1_threadElem").


    Panel(0).Table(0).Cell(1, 0).Panel(0).Table(0).Cell(1, 0).Panel(0).Table(0).Cell(0, 0).TextNode(0),


    "contentText", cmpContains, "RE: Special Characters like θ");



     


    Otherwise, you will have to specify the Greek language in the 'Language for non-Unicode programs' option of the operating system.


     




  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Mike,


     


    What exact characters are changed? Can you post here a screenshot of your text area with them?


    Also, let us know what TC version you are using.


     

  • mtrampe's avatar
    mtrampe
    Occasional Contributor
    Hi Tanya,



    I’m using TC 9.10 and as of now this characters are affected θ (theta), λ (lambda) and κ (kappa).  I haven’t tried other characters yet but this 3 are outstanding. 

     
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)


    Hi Mike,


     


    Now, I've got what you meant.


     


    Actually, TestComplete should operate with the Greek characters. The problem is that third-party controls used in TestComplete are non-Unicode, and therefore, they cannot display Unicode characters. However, TestComplete stores and uses valid Unicode symbols. You can check this by executing the following code (it saves the subject of this thread to the text file):


    function test()


    {



     var text=Sys.Browser("chrome").Page("*").Form("form").Panel("container").Panel("main").Panel("content").


    Panel(0).Panel("p_lt_zoneContent_pageplaceholder_pageplaceholder_lt_zoneContent_GroupForumList_groupElem1_threadElem").


    Panel(0).Table(0).Cell(1, 0).Panel(0).Table(0).Cell(2, 0).Panel(0).


    Table(0).Cell(0, 0).TextNode(0).contentText;


     var sPath = "d:\\MyFile.txt";


     


     aqFile.WriteToTextFile(sPath, text, aqFile.ctUnicode, true);



    }


    You should see in the file: RE: Special Characters like θ are not recognized by Test Complete


     


    So, you can create a property checkpoint for the web element and compare it with the stored value:



    aqObject.CheckProperty(NameMapping.Sys.Browser("chrome").Page("*").Form("form").


    Panel("container").Panel("main").Panel("content").Panel(0).


    Panel("p_lt_zoneContent_pageplaceholder_pageplaceholder_lt_zoneContent_GroupForumList_groupElem1_threadElem").


    Panel(0).Table(0).Cell(1, 0).Panel(0).Table(0).Cell(1, 0).Panel(0).Table(0).Cell(0, 0).TextNode(0),


    "contentText", cmpContains, "RE: Special Characters like θ");



     


    Otherwise, you will have to specify the Greek language in the 'Language for non-Unicode programs' option of the operating system.