18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

Will _span("Text") return multiple elements?

stevenlongstevenlong Members
edited November -1 in Sahi - Open Source
If _span("Text") matches more than one element, will all matching elements be returned, or just the first? And if all are returned, is there a way I could get a count of them?

Comments

  • narayannarayan Administrators
    Right now it returns only the first element.
    You could access say the 5th element by _span("Text[4]")
    This is much faster than getting all elements and then returning by index.

    It is not easy to count the number of elements right now.
    I could add it if you think it will be useful.

    May we could add a _spans("Text") which returns all spans in an array. You could then work on the array.
    You think that may work?
  • stevenlongstevenlong Members
    edited March 2008
    For what I'm currently working on, where I need to validate that all items on a purchase order are updated with the same delivery date, it would be very useful to have a _spans("Text") to return an array of all matching elements.

    Similarly, if the same could be done to make a _rows(_table(0),
Sign In or Register to comment.