Results 1 to 6 of 6

Thread: Combobox item selection;

  1. #1
    Sencha Premium Member
    Join Date
    Oct 2009
    Location
    Milan
    Posts
    15

    Default Combobox item selection;

    Hello,
    i use Sencha Studio 2.2.1.83 with a Extjs project with framework 4.2.
    This is my combobox html

    <div class="x-boundlist x-boundlist-floating x-layer x-boundlist-default x-border-box" id="boundlist-2584" tabindex="-1" style="right: auto; left: 553px; top: 239px; z-index: 29001; height: 300px; width: 279px;">
    <div id="boundlist-2584-listEl" role="presentation" class="x-boundlist-list-ct x-unselectable" style="overflow: auto; height: 299px;">
    <div class="x-boundlist-item">CAR</div>
    <div class="x-boundlist-item">Carico elettrico (generico)</div>
    <div class="x-boundlist-item">Carico Elettrico Controllato</div>
    <div class="x-boundlist-item">Carico Elettrico Modulabile</div>
    <div class="x-boundlist-item">Carico Termico</div>
    </div>
    </div>

    I use ST.component to get combobox and i can expand it. But, i can't select an item.
    I try with:
    .expand().down("//li[text()='Carico Elettrico Modulabile']").click()
    .expand().down('//li[@data-recordindex="2"]').click()
    ST.Locator.find("//li[contains(@class,'x-boundlist-item') and contains(text(), 'Carico Termico (Modulato)')]")
    also with
    DataView but the test crash with Failed with error "cq.pseudos[name] is not a function"

    Do you have any idea?

  2. #2
    Sencha Premium Member
    Join Date
    Oct 2009
    Location
    Milan
    Posts
    15

    Default

    Hi,
    after many tests now i can select element from list with
    ST.element('boundlist[hidden=false]',30000).down('div > div:nth-child(4)').click();

    The question now is:
    can i change div:nth-child(4) with a query to find an element by text?
    I try this
    ST.element('boundlist[hidden=false]',30000).down("div > div[contains(@class,'x-boundlist-item') and contains(@innerText, 'Carico Termico (Modulato)')]").click()
    but not working.
    thanks

  3. #3
    Sencha - Sales Team daniel.gallo's Avatar
    Join Date
    Apr 2009
    Location
    London, England
    Posts
    382
    Answers
    67

    Default

    Please try the following example:

    Code:
    // Scenario URL: https://docs.sencha.com/extjs/4.2.2/extjs-build/examples/build/KitchenSink/ext-theme-neptune/#register-form
    
    describe('Combobox', function() {
        it('should expand and select a value by the combobox dataview', function() {
            ST.comboBox('combobox[name="state"]')
                .expand();
            
            // Interact with the combobox's boundlist using the dataView API, locating a record by field name and value
            ST.dataView('boundlist[pickerField][hidden=false]')
                .itemWith('state', 'California')
                .click();
            
            // Check selected value is correct
            ST.comboBox('combobox[name="state"]')
                .displayValue('California');
        });
    });
    Daniel Gallo
    Sales Engineer
    Sencha

  4. #4
    Sencha User oracle7's Avatar
    Join Date
    Jan 2020
    Posts
    13

    Default

    Have any of you tested comboboxes with firefox.
    last few webdrivers can't handle .type("string") api method nor does

    ST.dataView('boundlist[pickerField][hidden=false]')
    .itemWith('state', 'String')
    .click();


    with previous .expand() call works.
    It all works in Chromedriver (chrome browser), but with Firefox it doesn't.

  5. #5
    Sencha - Sales Team daniel.gallo's Avatar
    Join Date
    Apr 2009
    Location
    London, England
    Posts
    382
    Answers
    67

    Default

    Quote Originally Posted by oracle7 View Post
    Have any of you tested comboboxes with firefox.
    last few webdrivers can't handle .type("string") api method nor does

    ST.dataView('boundlist[pickerField][hidden=false]')
    .itemWith('state', 'String')
    .click();


    with previous .expand() call works.
    It all works in Chromedriver (chrome browser), but with Firefox it doesn't.
    This works for me on Mac with latest Firefox (version 72), latest geckodriver, and Selenium Server 3.141.59 and 3.9.1. Please verify you're using the latest Firefox and geckodriver.
    Daniel Gallo
    Sales Engineer
    Sencha

  6. #6
    Sencha User oracle7's Avatar
    Join Date
    Jan 2020
    Posts
    13

    Default

    Hi yes,

    I'm using Selenium Server 3.141.59 and geckodriver for Windows. It kinda click on "something" but doesn't pick value from dropdown.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •