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.

Selecting option in a table row by background-color (css)

dasspunkdasspunk Members
edited November -1 in Sahi - Open Source
I need to be able to select an option from a pulldown (one of MANY on page) that has dynamic name (making it hard to select). It IS, however, highighted in the html via a background-color. So I'm trying to grab the first select near an object that has background-color set to #FFFF99 via something like...

HTML:
<tr style="background-color:#FFFF99;">...

CODE:
_setSelected(_select(0, _near(_style(background-color, "#FFFF99"))), "F");

Of course this doesn't work. Any ideas on how to do this?

Thanks,
Brian

Comments

  • narayannarayan Administrators
    Hi Brian,

    _style returns the given style attribute of an element. It is not an element accessor API.

    I think there should be simpler way than searching by style. Is it possible to send a screen shot to support@sahi.co.in?

    Regards,
    Narayan
Sign In or Register to comment.