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.

Dynamic row identification

jasonbjasonb Members
edited March 2013 in Sahi - Open Source
Hi All,

I'm trying to figure out how to find the row number where a particular text value is (it's a dynamically created table, so if something is deleted/added the row num will change.) Then I'd like to get the text from a column in that row (which is always the same [5]), save it to a variable and then do an assert on the saved text. I've seen some code here which allows me to cycle through the rows of a table but I haven't yet seen something which cycles through table rows until it finds something specific, all the examples I've seen always just go to the end of the table in question.

Any pointers are appreciated.

Thanks,
| JB

Answers

  • Hi jason

    then use the exaples you found here and add a break like
    // pseudocode
    lookUpText = "example"
    for row in rows
      rowText = _getText(row)
      if rowText.match(lookUpText)
        _alert("Found lookUpText in row")
        break
    
    
Sign In or Register to comment.