Forum Discussion

laxmankumar's avatar
laxmankumar
Occasional Contributor
11 years ago

Unable to Find item from ComboBox

When I try to run my script using TestComplete 9 (TC9), TC9 does not recogize the item in a combo box (highligted below).  Please note that,  I am noice to TestComplete...




function Test1()


{


  var browser;


  var page;


  var form;


  var textbox;


  var table;


  Browsers.Item(btIExplorer, "", Browsers.pX64).Run("http://www.cnn.com/");


  browser = Aliases.browser;


  browser.pageCnnComBreakingNewsUSWorldWea.Wait();


  browser.ToUrl("http://www.qaforums.com/");


  page = browser.pageSoftwareTestingAndQualityAss;


  page.Wait();


  form = page.form;


  textbox = form.textboxLoginname;


  textbox.Click(27, 13);


  textbox.SetText("XXXXXXXX");


  textbox.Keys("[Tab]");


  table = form.tableAutonumber1;


  table.passwordboxLoginpass.SetText("XXXXXXX");


  table.submitbuttonButtlogin.ClickButton();


  page = browser.pageSoftwareQualityAssuranceForu2;


  page.Wait();


  page.table.linkSearch.Click();


  page = browser.pageSoftwareQualityAssuranceForu;


  page.Wait();


  form = page.table.form;


 

//Script fails here


  form.selectForum.ClickItem("AutomatedQA / SmartBear TestComplete");

 


  table = form.tableTablesurround.cell.tableTableborders;


  textbox = table.cellLighttable.textboxWords;


  textbox.Click(40, 7);


  textbox.SetText("DataDriven");


  table.submitbuttonButtsubmit.ClickButton();


  page = browser.pageSoftwareQualityAssuranceForu3;


  page.Wait();


  page.table.linkLogout.Click();


  browser.pageSoftwareQualityAssuranceForu4.Wait();


}


  • Hi Laxman,


     


    There are several spaces at the beginning of each item name - it looks like the developers made the hierarchy in the combo box by using this approach. 


    To make TestComplete work correctly, add the * wildcard to the item name:




    form.selectForum.ClickItem("*AutomatedQA / SmartBear TestComplete");




     

1 Reply

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Laxman,


     


    There are several spaces at the beginning of each item name - it looks like the developers made the hierarchy in the combo box by using this approach. 


    To make TestComplete work correctly, add the * wildcard to the item name:




    form.selectForum.ClickItem("*AutomatedQA / SmartBear TestComplete");