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 find a word from a string in sahi

soumi1111soumi1111 Members
edited March 2013 in Sahi - Open Source
I am fetching rows from database using _getDB function and there I need to verify a particular word from a column .
Ex: I need to verify the existence of the word " Sahi" from a db column named "xyz" which has the value : " Sahi Automation tool is very helpful".

I am using :
var dbcom = _getDB("DB Name ");
var $rscom10 = dbcom.select("SELECT * FROM COMM_DAT_MESSAGE_T O");
_assertExists("Sahi", $rscom10[0]["XYZ"]);

But this assertion is not working.


TypeError: orig is undefined

Can anyone please suggest how to rectify this problem??

Regards
Soumi

Answers

  • _assertNotNull("Sahi is awesome".match("Sahi"))
  • Pratyush_TytoPratyush_Tyto Members
    edited December 2013
    Hi soumi1111,
    Apart from what globalworming mentioned, you can use this alternative as well.
    _assertContainsText("Sahi", $rscom10[0]["XYZ"]);

    Regards,
    Pratyush
Sign In or Register to comment.