Ask a Question

List box selection is not working properly

SOLVED
Ravikaanth
Contributor

List box selection is not working properly

I am trying to select one option from listbox. The problem is selection is done on different element. Please check the below code for your reference

 

Browsers.Item(btChrome).Navigate("url");
Aliases.browser.BrowserWindow.Maximize();

var selectElement=Aliases.browser.pageSignUpForFacebookFacebook.formReg.selectMonth;
selectElement = ClickItem("Jun");

The above code is to select June but it is selecting October. Please help me out to resolve this issue. Thanks in advance.

Ravikaanth_0-1685342055476.png

 

3 REPLIES 3
mikef
Staff

Hi @Ravikaanth

 

What version of TestComplete are you running? There was a related fix in 15.51  : 15.51 Release Notes 

Thanks @mikef  for your reply. I am using 15.51.4.7 version

 

rraghvani
Champion Level 3

If you are using JavaScript, then the coding to select an item should look like this,

var selectDay = Aliases.selectDay;
selectDay.ClickItem("16");

var selectMonth = Aliases.selectMonth;
selectMonth.ClickItem("Jun");

var selectYear = Aliases.selectYear;
selectYear.ClickItem("1980");

 

cancel
Showing results for 
Search instead for 
Did you mean: