Forum Discussion

salley's avatar
salley
Frequent Contributor
7 years ago

struggling to retrieve the first value found in a web table based on expected text

Hello, i'm trying to verify value in webtable.it's dynamic and row index changes based on the inputs and type of the input. what i'm trying to do is capture the subtotal in cell. so i could get the ...
  • AlexKaras's avatar
    AlexKaras
    7 years ago

    Hi,

     

    The best, fastest and most reliable solution is to talk to Development and ask them to provide unique and stable identifiers for all UI elements that your test code needs to work with.

    If this is not an option, then you still may try .FindAllChildren() and use the fact that the first subtotal section will be the last element of the returned array. This is not documented, but this is how .FindAllChildren() and .FindChild() work for more then decade since their implementation.

  • AlexKaras's avatar
    AlexKaras
    7 years ago

    Hi,

     

    Not sure I got the question...
    The code seems to be fine...

    To get the first UI object just use the last found one:

    Set myObject = arrobjects(UBound(arrobjects)) ' last found object corresponds to the first UI one

    What I am missing?

     

     

  • salley's avatar
    salley
    7 years ago

    Thanks  a lot Alex,,, it works just fine,,,,,,,,,,,,,,,,,, i'm able to use capture the desired row and use that row to capture the amount. I really appreciate your help. Cheers!