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 check whether a link is disabled or not

nandubijoornandubijoor Members
edited April 2014 in Sahi Pro
Hi Narayan,

I have a requirement like i need to click on a link only when clicking is allowed.
how to check whether given link is disabled or not.
Thanks

Best Answer

Answers

  • How do you disable the link? Via CSS, JS?
  • In some product its through css and some through js. If u can help me out in both case will be good.
  • Well.. a test site with 2 links and both methods to disable them would be very helpful. Can you provide that?
  • Hi globalworming,

    Whenever i face the same issue with respect to disabling link using css or js, I will let you know because in my case they disabled it by not setting the target

    Link is not disabled but the target is not set
    for e.g- If 5349802 is a link in web page, it is defined like bellow without the target page
    <a class="tablechardata"><center>5349802</center></a>

    is there any solution to handle it?
  • Its working.

    Thank you
  • nandubijoornandubijoor Members
    edited April 2014
    hi globalworming,

    It's not returning any value. However, if i put "if loop" and try to compare with a null value then it goes to the else part as shown in the example below:-

    var $check=_link("my-link").href; //returns an empty value
    _log("Value of check is :-->" + $check);
    if($check=="") {
    _log("inside href col 0");
    }else{
    _log("Hello User");
    }

    The same code works in SAHI controller in "Evaluate Expression" section but not while running .sah file. Kindly help. Also if possible, tell me the data type.

    Regards,
    NanduBijoor
Sign In or Register to comment.