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.

How to validate rearranged content and color scheme

jeevithajeevitha Members
edited November -1 in Sahi - Open Source
Hi,

Using SAHI tool,I'm able to automate the web page effectively.But,can you please guide me of how to verify as the rearranged content(customized part)are displayed as per we have rearranged them.

and is it possible to verify the accent decoration of color scheme using SAHI.

Comments

  • narayannarayan Administrators
    Hi Jeevitha,

    If you want to check that element A is beneath element B or to the right of it, you can use _position
    _position gives [x, y] coordinates (in an array)
    so
    x = _position(element)[0]
    y = _position(element)[1]

    To check if elementA is to the left of elementB

    _assert(_position(elementA)[0] < _position(elementB)[0]);

    Similarly you can look for other relative alignments.

    Another useful API is _style(element, "property");

    Eg. _assertEqual("#0000FF", _style(element, "background-color")); // checks that background is blue

    or

    Eg. _assertEqual("#00FFFF", _style(element, "color"));

    I did not understand what you meant by "accent decoration of color scheme", but I guess _style may help you.

    Regards,
    Narayan
  • Hi Narayan,

    Thanks for your support.Rearranged contents are works out fine after asserting the below script:
    _assert(_position(_image("Save"))[0] < _position(_image("Cancel"))[0]);

    using SAHI need more information for validating the color which is present below the header name (not as background of web page).
  • narayannarayan Administrators
    Jeevitha,

    I am not sure how your application is structured. You will need to either show us the html code or use something like firebug to check what the concerned element and property are.

    Regards,
    Narayan
Sign In or Register to comment.