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.

color coding

PriyaPriya Members
edited November -1 in Sahi - Open Source
Hi All

Can any one help me in how to indentify different colors using sahi.


with Regards
priya

Comments

  • Hi,

    Please see this example if it helps:
    _style(_byId("yourID"), "color");
    gives the font color of the text. This is how I use it to validate colors of various text:
    if (_condition(_style(_byId("yourID"), "color") == "rgb(255, 0, 0)"))
        do something;
    else
        do something else;
    
    Hope this helps.
    Regards,
    Pankaj.
  • Hi Pankaj,
    Thanks for the responce. Actually i need to retrieve the colour of the image , through which property i can retrieve the color of that image. In the Properties of the image i could't find any property releated to the color


    With Regards
    Priya
  • Hi Priya,

    I am not sure if we can check the color of an image . But ya there can be some way of checking the color of the pixels on the screen where your image is located. lets see what Narayan or others suggest :)
Sign In or Register to comment.