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.
Sahi Scripting - Calling Java
I read the post or tutorial on this topic, similarly when I tried using below code an getting error
java class "java.lang.String" has no public instance field or method named "toString". when executing code,
am I missing some package details here?
java class "java.lang.String" has no public instance field or method named "toString". when executing code,
var $a = Packages.java.lang.Package.toString(2010);
_alert(a);
var $b = Packages.java.lang.String.toString(2010);
_alert(b);
am I missing some package details here?
This discussion has been closed.
Comments
What are you trying to do? Convert an int to String? You can use
var $a = "" + 2010
for that.
Regards,
Narayan
var $a = ""+2010; it works
thats nice trick.
As all says, when thinking so hard on a problem we tend to go so crazy on logics, where we will never get to small easy stuff. :-)
Thank you