18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
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.
Not recognising "_click(_link("Cancel Docs"))"
Hi,
I have a script that has the line "_click(_link("Cancel Docs"));" in it but when I run the script it won't click on the link "Cancel Docs"
I've tried asserting that the link exists and it does so i'm not sure what the problem could be. The test still passes even though the click hasn't happened. In the log that line is listed as though it worked.
Here is the code:
_click(_checkbox("on",_near(_cell($DocType),_near((_cell($versionNumber)),_near(_cell(new RegExp($Final)))))));
_wait(3000);
_assertExists(_link("Cancel Docs"));
_assert(_isVisible(_link("Cancel Docs")));
_assertEqual("Cancel Docs", _getText(_link("Cancel Docs")));
_assertContainsText("Cancel Docs", _link("Cancel Docs"));
_click(_link("Cancel Docs")); //This is the line that does not work
_wait(3000);
try{
_expectPrompt("Please enter the reason for these cancellation(s):", "Testing");
}
catch(e){
_log(exception);
}
I have a script that has the line "_click(_link("Cancel Docs"));" in it but when I run the script it won't click on the link "Cancel Docs"
I've tried asserting that the link exists and it does so i'm not sure what the problem could be. The test still passes even though the click hasn't happened. In the log that line is listed as though it worked.
Here is the code:
_click(_checkbox("on",_near(_cell($DocType),_near((_cell($versionNumber)),_near(_cell(new RegExp($Final)))))));
_wait(3000);
_assertExists(_link("Cancel Docs"));
_assert(_isVisible(_link("Cancel Docs")));
_assertEqual("Cancel Docs", _getText(_link("Cancel Docs")));
_assertContainsText("Cancel Docs", _link("Cancel Docs"));
_click(_link("Cancel Docs")); //This is the line that does not work
_wait(3000);
try{
_expectPrompt("Please enter the reason for these cancellation(s):", "Testing");
}
catch(e){
_log(exception);
}
Comments
Could you please check if you can click on Cancel Docs link manually?
Also, could you check if you are getting any error on Sahi console or on the logs? If so, then please post it here.
Regards
Sumitra
Manually I can click on the Cancel Docs link and then a window pops up to ask for the reason for cancelling. When I run the script through sahi no error occurs when it tries to click on the Cancel Docs link and it even says that it does the next step, "_expectPrompt("Please enter the reason for these cancellation(s):", "Testing"); ". But when I watch the playback no text box pops up and when I go back to the patient to check that the document has been cancelled it hasn't.
Thanks,
Juliem
The popup will not be visible during playback even though the behaviour will be as if the dialog did appear. You can check this by setting _expectConfirm value to false,
_expectConfirm("Are you sure you want to save this record?", false);
and see how it works.
You can also check if a confirm dialog appeared by asserting for it.
_assertEqual("Are you sure you want to save this record?", _lastConfirm());
Check if this solves your issue.
If you are still facing issue then could you please point us to the URL or point us to a sample application.
Regards
Sumitra
I've been discussing the problem with a developer here and it turns out that the "Cancel Docs" link executes a database transaction so it isn't a standard link.
We are yet to find time to fix the problem but i'm sure will.
Regards
Juliem