Forum Discussion

tobello's avatar
tobello
Contributor
10 years ago

how does TC retrieve Ajax controls without html name/Id

I have a packaged (bougth from a 3rd party) application that we want to automate user regression tests from the UI.

 

Unfortunatly, application controls are ajax but no html ID...

Using keyword tests was very difficult and painfull and the gain was quite ironic vs the effort.

Scripting was a solution but still the control mapping issue for over 100 pages and huge amount of controls.

 

 

So we decide to look for another tool that we can leverage... But since we have the TC licence, I decide to give another chance instead of going through another learning challenge/curve and test delay.

 

Can anyone tell me if he has encounter such a challenge and how they come over it?

Is there a way TC can lookup on ajax controls easily?

 

When I sniff/spy 1 textbox on the page we had these:

 

FullName:

Sys.Browser("iexplore").Page("http://iffs.dev.uni/frontrt.aspx?Page=fcallefront&Efrontcall=Execmenu&Efrontmenu=HTMLBUILDER.RELOGIN$3CE10967684B4FAAAB9551BAFE83DAA8&CW=undefined&CH=983#Back1").Form("FOLDER").Table(0).Cell(1, 0).Table(0).Cell(0, 2).Table(0).Cell(2, 0).Panel(8).Panel(0).Panel(0).Table(0).Cell(1, 0).Table(0).Cell(0, 0).Panel("controls_container").Panel("id_controls_area").Panel(5).Textbox(1)

 

Name:

Textbox(1)

 

ObjectIdentifier

1

 

outerHTML (Internet Explorer):

<INPUT style="Z-INDEX: 519; BACKGROUND-COLOR: #ff8080; WIDTH: 216px; HEIGHT: 18px; TOP: 48px; LEFT: 152px" class=class_studio_field_4 title="Field cannot be empty" tabIndex=0 maxLength=32 unselectable="off" ajxwidth="216" ajxtopcontainer="id_controls_area" ajxheight="20" ajxdesign="false" ajxname="RT_ABBREVIATION1_2_1_1_1" ajxnameid="###RT_ABBREVIATION1_2_1_1_1_246" ajxleft="152" ajxtop="48" ajxhorzalign="left" ajxvertalign="top" ajxicon="undefined" ajxhidden="false" ajxdisplayrules="undefined" ajxevents="undefined" ajxmenuitems="undefined" ajxuniquename="201|RT_ABBREVIATION1_2_1_1_1" ajxoverride="undefined" ajxexclusive="true" ajxfield="ABBREVIATION1" ajxstyle="4" ajxdisabled="false" ajxforcedisabled="false" ajxnotnull="true" ajxtitle="undefined" ajxpath="ABBREVIATION1" ajxcheckingrules="undefined" ajxtabindex="0" _disabled="false" ajxinfo="undefined" ajxnotrim="undefined" ajxnull="false" ajxcheckable="true" ajxbackcolor ajxerror="Field cannot be empty">

 

Thanks in advance

  • Hi Ted,

     

    Judging by the outerHTML property, the ajxuniquename attribute should contain a unique name for this textbox. Did you try accessing objects via their HTML attributes? TestComplete provides two methods that could help you with this – refer to the "Finding Web Objects Using XPath Expressions" ( http://smartbear.com/viewarticle/62117/ ) help topic for details.

     

    In this case, addressing a text box can be done via the following XPath Expression:

    //INPUT[@ajxuniquename="201|RT_ABBREVIATION1_2_1_1_1"]