Results 1 to 4 of 4

Thread: How to handle multiple components match in ST

  1. #1

    Default How to handle multiple components match in ST

    Hello team,

    I have to do a check of multiple elements that have the same locator. If I use ST.component('selector') I get the following error:
    Code:
    Component Query locator matches multiple items
    Is there a way to get elements one by one, as in xPath, where you can do $x('(locator)[index]')?

    Thank you,
    Sergiu

  2. #2
    Sencha User
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446

    Default

    Hi--

    What is your selector? Is there a more specific property on your component that you can use to differentiate the two components?

    Thanks
    Joel

  3. #3

    Default

    Helo Joel,

    There is nothing specific to any of the components. The only thing that will work is the index, as in xPath. Is there something similar in Sencha Test?

    And a second question: Is there a reason why ST cannot handle arrays of elements? This is an important feature in Webdriver

  4. #4
    Sencha User
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446

    Default

    Hi--

    Have you tried something like:

    ST.component('button:nth-child(2)')
    Re: the "array of elements", can you expand on what you mean? Thanks!

  5. #5
    Sencha User
    Join Date
    Sep 2017
    Posts
    11

    Default

    Quote Originally Posted by joel.watson View Post
    Hi--

    Have you tried something like:



    Re: the "array of elements", can you expand on what you mean? Thanks!
    Hey Joel, I'm having a similar issue, I believe, what I want to do is to find all elements that have a given property and click them. I could easily do it with jUnit this way:


    • public void myElements() {
    • List<WebElement> list = driver.findElements(By.xpath("//span[@class='x-tab-close-btn']"));

    • for(WebElement el: list) {
    • el.click();
    • }


      I can't find a way to do it on Sencha Test though. Any ideas? Thanks for the attention.

Similar Threads

  1. Search for Multiple columns
    By Vinod Jayendra in forum Sencha GXT Q&A
    Replies: 1
    Last Post: 25 Apr 2011, 10:11 AM
  2. ComboBox search on individual string components
    By Mahendru in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 8 Oct 2010, 7:52 AM
  3. Combobox - Multiple search
    By cheloperel in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 13 Nov 2008, 5:35 AM
  4. Search multiple Fields with one ComboBox
    By Oliver80 in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 9 Sep 2008, 4:44 AM

Posting Permissions

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