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.
How can I change file upload action url in Java API?
I have read this page - http://sahi.co.in/w/_setfile. _setFile function has the thrid parameter to change the action url if necessary, but the Java API seems not provide the actionUrl parameter. How should I change the action url with Java API? Thanks.
Javadoc for setFile method of ElementStub.
=================================
setFile
public void setFile(java.lang.String value)
throws ExecutionException
Sets the value of this file upload element.
This method will do nothing for elements which are not file upload fields.
Internally calls browser.setFile(this, value);
Parameters:
value -
Throws:
ExecutionException
===============================
Javadoc for setFile method of ElementStub.
=================================
setFile
public void setFile(java.lang.String value)
throws ExecutionException
Sets the value of this file upload element.
This method will do nothing for elements which are not file upload fields.
Internally calls browser.setFile(this, value);
Parameters:
value -
Throws:
ExecutionException
===============================
Comments
As of now you wont be able to change the action url with Java API. This feature will be available in the next release.
Regards
Sumitra
You can do this:
browser.execute("_sahi._setFile(_sahi._file('abc'), 'file/path', 'url')");
In fact any Sahi API can be called like this.
Regards,
Narayan