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.
Not able to recognize object while playback
Hi,
In my application sahi is not recognizing few objects example I need to add existing documents clicking "Browse" button the property/Accessor is _file("versionFile") but while playing back it's not recognizing.
Can any suggest to handle this issue.
Thanks,
Lokesh.
In my application sahi is not recognizing few objects example I need to add existing documents clicking "Browse" button the property/Accessor is _file("versionFile") but while playing back it's not recognizing.
Can any suggest to handle this issue.
Thanks,
Lokesh.
This discussion has been closed.
Comments
If you want to upload an exsiting document you will have to use: _setFile()
For more Details: http://sahi.co.in/w/_setFile
Let me know if you face any problem.
Regards
Sumitra
Even I have used the same statement but file is not attaching, the below statements I have used,
_setFile(_file("versionFile"), "C:\\Users\\lokeshk\\Desktop\\Test Documents\\Document Test 5.docx");
_click(_button("Add"));
Thanks,
Lokesh.
_setFile works in a round about way. It is not handled at the browser level. It is handled at the proxy. So you will not see the file input box being populated with your desired filename. But when the form is submitted, the proxy will add the correct file to the request before it sends it to your web server. But if there are javascript checks before form submit to see if the filename is non-empty, then the script will not work as desired.
If there are javascript validations on the file field, you can try this hack. Before submitting the file, change the field’s type to “text”, and then set its value.
In you case,
Let me know if this solves your issue.
Regards
Sumitra
Now it's working.
Thanks,
Lokesh.