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.
File upload with _setFile is not happening in Firefox
Hi,
I have to do File upload in my application and used _set File function. It worked while i test the application in IE, but the same script i am not able to playback in FireFox.
This particular function works in IE:-
function upload()
{
_click(_link("Application Form"));
_popup("Document Upload")._setSelected(_select("plDocumentTypeId"), "Bvf Document");
_popup("Document Upload")._setFile(_file("theFile"), "C:\\Documents and Settings\\bsundharesan\\Desktop\\test.pdf");
if(_isIE())
{
_popup("Document Upload")._call(_file("theFile").outerHTML=_file("theFile").outerHTML.replace(/type=file/,"type=text"));
}
else
{
_popup("Document Upload")._call(_file("theFile").type="text");
}
_setValue(_textbox("theFile"),"C:\\Documents and Settings\\bsundharesan\\Desktop\\test.pdf");
_popup("Document Upload")._click(_submit("Upload"));
_popup("Document Upload")._click(_button("Close"));
The same script does not works in FF, and i get an error near the if(_isIE()) condition:-
_sahi.setServerVar('___lastValue___1290166543411', _isIE());
Window/Domain not found: popupNameFromStep=; derivedName=File Upload; windowName=; windowTitle=File Upload; wasOpened=1; domain= at Nov 19, 2010 5:06:37 PM
i tried with if(_isFF()) also if(_isFF3()), but it did not work, but if i remove the if and else loop and place the code of line :- _popup("Document Upload")._call(_file("theFile").type="text");
. it works....
Can someone help me as to what is the problem in playing back the same script in Firefox.
I need to give a demonstration of it.
Regards,
Bhavitha
I have to do File upload in my application and used _set File function. It worked while i test the application in IE, but the same script i am not able to playback in FireFox.
This particular function works in IE:-
function upload()
{
_click(_link("Application Form"));
_popup("Document Upload")._setSelected(_select("plDocumentTypeId"), "Bvf Document");
_popup("Document Upload")._setFile(_file("theFile"), "C:\\Documents and Settings\\bsundharesan\\Desktop\\test.pdf");
if(_isIE())
{
_popup("Document Upload")._call(_file("theFile").outerHTML=_file("theFile").outerHTML.replace(/type=file/,"type=text"));
}
else
{
_popup("Document Upload")._call(_file("theFile").type="text");
}
_setValue(_textbox("theFile"),"C:\\Documents and Settings\\bsundharesan\\Desktop\\test.pdf");
_popup("Document Upload")._click(_submit("Upload"));
_popup("Document Upload")._click(_button("Close"));
The same script does not works in FF, and i get an error near the if(_isIE()) condition:-
_sahi.setServerVar('___lastValue___1290166543411', _isIE());
Window/Domain not found: popupNameFromStep=; derivedName=File Upload; windowName=; windowTitle=File Upload; wasOpened=1; domain= at Nov 19, 2010 5:06:37 PM
i tried with if(_isFF()) also if(_isFF3()), but it did not work, but if i remove the if and else loop and place the code of line :- _popup("Document Upload")._call(_file("theFile").type="text");
. it works....
Can someone help me as to what is the problem in playing back the same script in Firefox.
I need to give a demonstration of it.
Regards,
Bhavitha
This discussion has been closed.
Comments
You could store the variable for isIE() much before in your script and then use it.
It worked. Thanks a lot, you are excellent.
We are successfully using sahi for our application, thanks for developing such a simple and powerful tool