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 use Regular Expression in a single line for different field.

sujatasujata Members
edited November -1 in Sahi - Open Source
_assertEqual("Home About Settings Organisation Roles User Work Flow Module" _getText(_row(6)));

For this step I want to use regular expression in multiple field.
In this case I want to assert only Organisation.And rest of the part can change .I have tried with
_assertEqual("/.* Organisation /" _getText(_row(6)));
But it is not working,Can anyone help me.

Regards
sujata

Comments

  • Akss004Akss004 Members
    Hi,

    This will work.

    _assertEqual("/.* Organisation .*/" _getText(_row(6)));
  • Hi Sujata,

    If you just want to test if the cell contains "Organisation", use
    _assertExists(_cell("Organisation", _in(_row(6))))
    

    You could also use,
    _containsText(_row(6),"Organisation")
    

    I would suggest you establish a UI relation to fetch the content of the cell like in the first case.

    Regards,
    dkulkarni
  • sujatasujata Members
    edited July 2011
    Actually in this case i want test sorting functionality. If i click on any column name,is it sorting or not and then i want to assert them.But i am not able to do this because sahi is not identifying the place changes in the screen for any element.
Sign In or Register to comment.