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.

Unable to assert single quote

kinnukinnu Members
edited June 2010 in Sahi - Open Source
Dear,

Error: The parameter passed to _getText was not found on the browser
(when using single quote in the script)

scenario:
_assertExists(_link("International Organizations' Documentation"));
_assert(_isVisible(_link("International Organizations' Documentation")));
_assertContainsText("International Organizations' Documentation", _link("International Organizations' Documentation"));

Note: I also tried: &quot:

Looking forward for help!

Thanks,
kinnu

Comments

  • narayannarayan Administrators
    Hi Kinnu,

    We checked with such link content and it seems to work fine. Could you specify the following:

    1) Sahi build number
    2) Browser type and version
    3) Which assertion is actually failing
    4) HTML of the specified link.

    Regards,
    Narayan
  • kinnukinnu Members
    Hi Narayan,

    Firstly Thank you for the prompt response

    1) Sahi build number - Sahi V3 (Sahi 2010-04-30) - (is this the one?)

    2) Browser type and version - IE 8.0

    3) Which assertion is actually failing -
    _assertExists(_link("International Organization's Documentation"));
    Assertion Failed. at 09-Jun-2010 14:10:37
    _assert(_isVisible(_link("International Organization's Documentation")));
    Assertion Failed. at 09-Jun-2010 14:10:49
    _assertContainsText("International Organization's Documentation", _link("International Organization's Documentation"));
    Error: The parameter passed to _getText was not found on the browser
    No trace available

    4) HTML of the specified link. - Unable to post link because for permission issues (
    Warning! The following errors must be corrected before your message can be posted:

    * New Members can not post links, images or email addresses until they become more active.)


    And more thing, how can I assert the title with greater than document count (e.g: >15) and inbetween (10 to 30)

    Thanks,
    Raj
  • narayannarayan Administrators
    Hi Raj,

    It looks like the link is not present on the screen, or it has been modified. Can you recheck if that link is there?

    Paste the html without the url, or change http: to http__

    You can assert in-between etc. using _assertTrue and passing in the condition. Btw, could not understand "title with greater than document count". An example would help.

    Regards,
    Narayan
  • kinnukinnu Members
    Hi Narayan,

    The link is present without modifications.

    url: http_//online2.ibfd.org/kbase
    Collections page: International Organizations’ Documentation (20 documents) (I removed the document count in the script)

    or

    http_//online2.ibfd.org/kbase/results.jsp?No=0&Ne=4912&N=3+4937&Ns=ibfd-published-date%7C1


    Re "title with greater than document count" -
    Exampe:
    International Organizations’ Documentation (20 documents)
    I wanted to test this giving in-between (10 and 30 )and greater than 10 - (for document count)
  • narayannarayan Administrators
    If the link is like this:
    <a href="...">International Organizations’ Documentation (20 documents)</a>
    

    Then you will need to use a regular expression to do a partial match. In your case

    _link(/International Organizations’ Documentation/)

    should work.

    Btw, the single quote you have in your html is a "right single quotation mark" and not the same as a regular single quote
    ' : regular quotation mark
    ’ : right single quotation mark

    Make sure you are using the correct one in your script.

    To check for document count, first fetch the text of the link and then parse it to get the count.
    var $text = "";
    _set($text, _getText(_link(/International Organizations’ Documentation/))); // get the text
    var $count = parseInt($text.substring($text.indexOf("(")+1)); // extract the number
    _log($count);
    _assertTrue($count > 10 && $count < 30);
    
  • kinnukinnu Members
    Thank You very much Narayan.

    Hope to bother you sometime later :)

    Have a nice time
This discussion has been closed.