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 change file upload action url in Java API?

ilovepumpkinilovepumpkin Members
edited November -1 in Sahi - Open Source
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
===============================

Comments

  • Hi ilovepumpkin,

    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
  • May I know when the next release be rolled out? If it is not long, I could wait for it otherwise I will have to find a workaround. Thanks.
  • narayannarayan Administrators
    Hi,

    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
  • Thank you for pointing this out. I will give it a try.
Sign In or Register to comment.