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.

File Upload using Native Events in Sahi OS

agilehero1980agilehero1980 Members
edited July 2013 in Sahi - Open Source
Hello All,

I am using Sahi 4.3 OS in a Windows 7 environment. I am unable to use the _setFile API after following all the documentation.
I am following the guide for File Upload using Native Events in Sahi OS from the documentation. A function setFileUpload($fileEl, $path) is created, but this uses the _focusWindow API. This does not appear to be present in the OS version meaning I can not use upload with the OS version. I have tried this workaround in a trial of the Pro version and it works well.

Is there something I am missing or should the OS version have access to this API?? I have searched the forums and google but can not come up with anything useful

Thanks

agilehero1980

Answers

  • Hi agilehero,
    Please switch to Sahi OS latest version i.e. 4.4 and try using _setFile as well as _setFile2.
    If it still doesn't serve your purpose please let me know.

    Regards.
  • Thanks Pratyush,

    I have now tried using the _setFile and _setFile2 with 4.4 of the OS version. I receive an error on playback in the sahi console:

    TypeError: this.getFileInputFrom(...) is null (https://application1.com/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_ScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=;;System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35:en-GB:c9cbdec3-c810-4e87-846c-fb25a7c08002:ea597d4b:b25378d2;Telerik.Web.UI:en-GB:df833b2e-28ee-45e7-8320-6f2a9cb883d7:16e4e7cd:f7645509:22a6274a:ed16cbdc:68f76a79:24ee1bba:a585d0d4:874f8ea2:f46195d3:19620875:490a9d4e:2a2fc429:bd8f85e4:2715)

    I am also not able to use the setFileUpload($fileEl, $path) workaround as described in the documentation.

    Thanks again

    agilehero1980
Sign In or Register to comment.