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.
Problem with link
Hi,
In one of my web page i have a link in a icon(in other words we are treating the icon as link) but it doesn't have any href(href = #) and while clicking the link it calls a functions and opens a window. When playback the script sahi clicks the link and the window opened but sahi keep on trying to click the link and the test gets failed.
Please guide me to solve this.
regards
Ragu
In one of my web page i have a link in a icon(in other words we are treating the icon as link) but it doesn't have any href(href = #) and while clicking the link it calls a functions and opens a window. When playback the script sahi clicks the link and the window opened but sahi keep on trying to click the link and the test gets failed.
Please guide me to solve this.
regards
Ragu
Tagged:
Comments
To give you more info on this, in log for the step, "TypeError: null is null or not an object" message is displaying.
Any suggestions????
Thanks
Ragu
Use _call(); to call the function.
Ex. if onclick = FunctionAfterIconClick() is used in browser code than _call(FunctionAfterIconClick()); will work.
I tried using
and in the log i am getting TypeError: Object Expected
Actually clicking the link is working fine and it is opening the dialog box but sahi repeats the step of clicking the link and fails the test and giving the error message "null is null or not an object".
Thanks
Ragu
It would be a great helpful, if you could share your idea on the above problem.
Narayan,
Do you have any thoughts on the cause of the above problem. "null is null or not an object".
Regards
ragu
This will diff combination with eval as you have used in call. Ex. _eval("return FnAfterLinkClick('value')");
What you are trying to do are all workarounds. In these cases you are testing the function working correctly, but not that it was called correctly when the click happened. Sahi should be able to click the element using _click and things should work correctly. This is really a bug.
cragu,
Could you do this and check if the link works for you?
1) Open sahi/htdocs/spr/concat.js in a text editor.
2) Search for Sahi.prototype.linkClick
3) Replace that function with this:
4) Restart Sahi, clear browser cache and try it again.
Let me know what you see.
Regards,
Narayan
Thanks a lot... Just to confirm before proceed, as i am using Oct 26 2008 build, in the concat.js file, i am seeing the following 2 functions. i don't see Sahi.prototype.linkClick
I need to replace the var linkclick() function with your new function right? Just to remind you, in my case sahi clicks the link and the window is getting opened but sahi keep on trying to click the link.
So sahll i proceed with replacing the function? waiting for your comment.
Thanks
Ragu
if (this.prevClick) {
performDefault = this.prevClick.apply(this, arguments);
}
with
if (this.prevClick) {
try {
performDefault = this.prevClick.apply(this, arguments);
}catch(e){}
}
_Click(_link("uc512_name")); TypeError: 'null' is null or not an object.
and in the sahi.bat
it showing Rhino lib:### Step did not return in 5 minuties.
Waiting for your comments.
Thanks
Ragu
Do you think this is a bug in sahi? because sahi clicks other links in this application and its working correctly. But in the case of the particular link, actually it is an image which is defined as link and its href=# but when clicking the link its opening the web page dialog window(which has the URL in it).
Sahi clicks the image link and opens the window correctly but why still sahi trying to click the link. What sahi is expecting in this case?
Awaiting your comments?
Thanks
Ragu
In the application for the link, Ajax tool control and updatepanel are used. is it the cause of the problem?
Thanks
Ragu