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 use javascript in sahi for clicking links

madanmadan Members
edited January 2013 in Sahi - Open Source
Hi,

I am using javaScript like as mentioned below

browser.accessor("document.getElementById(\"userName\")").setValue("test1");
> for textboxes or buttons having 'Id'

browser.accessor("document.getElementsByName(\"Submit\")[0]").click();
> for text boxes or buttons having 'name'

Now i want to know how to use the javascript code in the accessor method when i want to click a 'link 'which is having 'className' as mentioned below.

<div class="bookNow">
<p>
<a href="abc"> View </a>
</p>

I want to click on the link 'View' using javascript

can anybody help ASAP

Regards,
Madan
Sign In or Register to comment.