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.

Find Object, Store Locally and perform operation not working

sndp2510sndp2510 Members
edited July 2014 in Sahi Pro
Hi

Details:
OS : Windows 7
Browser : Internet Explorer 8
Sahi Build: Sahi Pro 5.1.2

While executing the below code i am getting the following error:

Error:
Sahi properties file = C:\Users\sandeep.kumar\sahi_pro\config\sahi.properties
Sahi user properties file = C:\Users\sandeep.kumar\sahi_pro\userdata\config\userdata.properties
found the element
false
Exception in thread "main" error:_click(_byText("Gift Cards", "link"))
Error: The parameter passed to _click was not found on the browser
at net.sf.sahi.client.Browser.executeStep(Browser.java:235)
at net.sf.sahi.client.Browser.execute(Browser.java:202)
at net.sf.sahi.client.Browser.click(Browser.java:431)
at net.sf.sahi.client.ElementStub.click(ElementStub.java:75)
at sndp.sahi.Checking.main(Checking.java:31)


Actual Code:
public class Checking {
static net.sf.sahi.client.Browser sahiBrowser = null;
public static void main(String[] args) {

String sahiBase = "C:\\Users\\sandeep.kumar\\sahi_pro"; // where Sahi is installed or unzipped
String userDataDirectory = "C:\\Users\\sandeep.kumar\\sahi_pro\\userdata"; // path to the userdata directory.

Configuration.initJava(sahiBase, userDataDirectory);

sahiBrowser = new net.sf.sahi.client.Browser("ie");
sahiBrowser.open();
sahiBrowser.navigateTo("http://www.amazon.com/";);

//sahiBrowser.link("Gift Cards").click(); // Working


ElementStub lnk = sahiBrowser.byText("Gift Cards","link");
System.out.println("found the element");
/*****Below Code NOT Working Why??******/
System.out.println(lnk.exists());
lnk.click();
/******************************************/
}
Sign In or Register to comment.