Forum Discussion

fayrehouse's avatar
fayrehouse
Frequent Contributor
12 years ago

ObjectIdentifier different in FF/IE to Chrome/Safari?

Hi all,



Can anyone suggest why, for "Textarea" objects, the ObjectIdentifier param is "different" in IE/FF to that found by Chrome/Safari? Example:



In F/IE:

R1C1:

Sys.Browser("iexplore").Page("<<<URL>>>").....Table(0).Cell(0, 1).Textarea("checkRows_0_abc")

R1C2:

Sys.Browser("iexplore").Page("<<<URL>>>").....Table(0).Cell(0, 1).Textarea("checkRows_0_def")R

1C3:

Sys.Browser("iexplore").Page("<<<URL>>>").....Table(0).Cell(0, 1).Textarea("checkRows_0_hijklm")

R2C1:

Sys.Browser("iexplore").Page("<<<URL>>>").....Table(0).Cell(1, 1).Textarea("checkRows_1_abc")

R2C2:

Sys.Browser("iexplore").Page("<<<URL>>>").....Table(0).Cell(1, 1).Textarea("checkRows_1_def")

R2C3:

Sys.Browser("iexplore").Page("<<<URL>>>").....Table(0).Cell(1, 1).Textarea("checkRows_1_hijklm")


In Safari/Chrome

R1C1:

Sys.Browser("safari").Page("<<<URL>>>").....Table(0).Cell(0, 1).Textarea(0)

R1C2:

Sys.Browser("safari").Page("<<<URL>>>").....Table(0).Cell(0, 1).Textarea(1)

R1C3:

Sys.Browser("safari").Page("<<<URL>>>").....Table(0).Cell(0, 1).Textarea(2)

R2C1:

Sys.Browser("safari").Page("<<<URL>>>").....Table(0).Cell(1, 1).Textarea(0)

R2C2:

Sys.Browser("safari").Page("<<<URL>>>").....Table(0).Cell(1, 1).Textarea(1)

R2C3:

Sys.Browser("safari").Page("<<<URL>>>").....Table(0).Cell(1, 1).Textarea(2)





Thanks



Steve

 



  • Hi Steve,


     


    I've failed to reproduce this behavior in TestComplete 9.31. The HTML code for the textarea element looks like this:


    <textarea name="mytextareaobj"> test in textarea</textarea>


    TestComplete always recognizes the textarea element by its name.


     


    First of all, please make sure that you are using the latest product version - 9.31. 


    Also, please check whether the name attribute is used in your HTML code to identify the elements.


     

  • fayrehouse's avatar
    fayrehouse
    Frequent Contributor
    Hi Tanya,



    I can confirm I'm using 9.31. In Chrome and FF, I was able to ffnd the following, by way of example:




    Chrome (via Inspect Element):


     


    <textarea name="vehicles[0].vrm" onkeypress="enableDisableCheckbox();" id="0_0" class="fontbgyellowfgblackborder vrmField" autocomplete="off" maxlen="7"></textarea>


     


     


    FF (via firebug):


     


    <textarea class="fontbgyellowfgblackborder vrmField" id="0_0" onkeypress="enableDisableCheckbox();" name="vehicles[0].vrm" autocomplete="off" maxlen="7"></textarea>








    I did get a fairly garbled explanation of sorts from the Devs here - or at least an explanation of why they are using text areas at all in this table - it's to do with copy and paste of data apparently from Excel (if that makes any sense). However, that doesn't to me explain how the names in TC are varying. 



    That said, I *have* found a workaround, as shown below - but it WOULD be good to get a bit of understanding why the browsers are acting differently -even if it's to give our Dev's some feedback ;-)



    My cross browser workaround:



        var x = 1; // row in table


        Columns = Sys.Browser().Page("https://our.url*").Frame("main").Form("EntryForm").Panel(4).Table(0).Cell(x, 1).FindAllChildren("ObjectType","Textarea",1,true)


        Columns = VBArray(Columns).toArray();


        Columns[4].Keys("[End]![Home][Del]" + RegArray);


     

    Thanks for your ongoing help again!



    Steve