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.

Read table data (from td)

DaltonDalton Members
edited June 2013 in Sahi - Open Source
Hi all,
I have a different scenario in front of me. i have to read a value from table which is as follows
<code>
<table class="xxb xy3" cellspacing="0" _startrow="0" _rowcount="10" _totalwidth="210" style="table-layout:fixed;position:relative;width:210px;">
<tbody><tr class="xxy" _afrrk="0"> … </tr><tr class="xxy" _afrrk="1"> … </tr><tr class="xxy" _afrrk="2"><td class="xxv" nowrap=""> … </td><td class="xxv" nowrap="">
test
</td></tr><tr class="xxy" _afrrk="3"><td class="xxv" nowrap="">
APN
</td><td class="xxv" nowrap=""> … </td></tr>

</code>

I want to read a value "test" from browser. there is no id to read value.i tried it through class id which gives me result "unidentified"

Can any one know how to do this

Thanks in advance

Answers

  • Hi Dalton,
    Try using the following code:
    _cell("test")
    
    Try it on Sahi OS v4.4.

    Regards.
  • DaltonDalton Members
    the value not always "test" or APN . the drop down chages every time .so need to capture depends in class
  • Hi Dalton,

    You could use Positional Relations API's. they are very good at getting such dynamic values.
    you could get the values using something like.
    _select(0, _rightOf(_cell(" filed on left of your drop down")).children).textContent

    Regards,
    Sreekanth.
  • Hi Dalton,
    Have the positional relations APIs helped you out or do you still need some help regarding that?

    Regards.
Sign In or Register to comment.