Forum Discussion

Ravikaanth's avatar
Ravikaanth
Contributor
10 months ago
Solved

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.

 

3 Replies

  • rraghvani's avatar
    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");