Forum Discussion

nwang66's avatar
nwang66
Contributor
14 years ago

ClickItem() of drop down menu doesn't trigger related event on web page

My tested application is implemented in ASP.NET. Infragistics 2009.2 web client has been installed on my computer. There is a drop down menu. Select one of the options, a panel (table) will be shown up that contains a couple of drop down menus and textboxes. My TestComplete 7.5 script was working fine. Then my tested application has been updated from Infragistics 2005.3, updated from ASP.NET MVC1 to MVC2… (may also other updating). I updated my TestComplete to 8.0. Then the scripts are not working any more. 

 


I recorded my operations into a script (C# script): click the drop down menu (menu1), select the option, the panel shows up and select option on menu2. However, when I re-play this recorded script, it is failed because this hidden panel (table) is not shown up, i.e. change() event on menu1 is not triggered… I tried methods of Click(), ClickItem(), Keys(), etc. Sometimes they work, sometimes not. No one is stable… 

 


function Test1(){


     var form;

     form = Aliases["Sys"]["IEXPLORE"]["pageComplaintDetail"]["formDetailform"];

     form["selectNewstatus"]["ClickItem"]("Resolved");

     //following controls were hidden and should be shown up after above option is selected



     form["selectDplvalidity"]["ClickItem"]("Verified");      

     form["ICResolution"]["Keys"]("S");

}

 


    Thanks a lot!

 


Nancy Wang

2 Replies

  • Cameronsmith63's avatar
    Cameronsmith63
    Occasional Contributor
    I think i came across the same problem, but what i did instead, was store each name in the drop down menu in a DB. what you can do to get past this problem is to record a keyword test, click on the drop down menu/combo box, click on menu1. stop the recording. then go to the line where you click on menu1, create a DDT, set up all you DB connections and entries and variables, click next a couple until you come to the option of "hard-coded value",  and select the DB column. Once that is complete, you can convert that key word to a script and fit it into your script at whatever part it should be.



      

  • Hi Nancy,





    As far as I understand, the problem is that some client-side JavaScript events do not fire when you execute your TestComplete script, and therefore, the tested application behaves incorrectly on the test playback. If so, note that TestComplete wrapper methods (like ClickItem) often use native properties/methods to perform the needed actions directly, without simulating the corresponding clicks and keystrokes, and this approach works fine in most cases unless you have some specific event handlers assigned. If you need the event handlers to be called, you need to make TestComplete simulate user actions explicitly (that is, use the Keys method or simulate a mouse click action on specific coordinates after evaluating the coordinates in your script). This will make all the event handlers be called.