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 can I call java functions in sahi script using object

monika786monika786 Members
edited March 2013 in Sahi Pro
I have created a java class containing non static function.This class does not contain main() method.And now I have to call java function using object in sahi script.How can I do it?
Program:
package com.Begin;

class Inher {
int length;
int breadth;
public void In(int x,int y)
{
length=x;
breadth=y;
}
public int area()
{
return(length*breadth);
}
}
public class DrawingRoom extends Inher{
int height;
public void Room(int x,int y,int z)
{
In(x,y);
height=z;
}
public int volume()
{
return(length*breadth*height);
}
}


script:
var $dr=new Packages.com.Begin.DrawingRoom();
dr.Room(3,4,5);
var $kk=dr.volume();
_alert($kk);

Answers

Sign In or Register to comment.