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 expecte...
  • TanyaYatskovska's avatar
    12 years ago


    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.