Friday, March 22, 2013

Selenium AUTO UPLOAD [SOLVE]


Hi everyone.
I have a problem with automatic testing using Selenium IDE. I need to upload a file but Selenium seams unable to perform click on browse button. Using http://www.extjs.com/deploy/dev/exam...le-upload.html I can focus browse button but firing selenium click or clickOn event don't produce anything. Am I doing something wrong or is this some Selenium IDE limitation? Any help will be appreciated

the SOLVE is

In my Selenium tests I want to upload some files. However, due to security restrictions in the browser a JavaScript cannot fill in a path in the respective file input field by default. Fortunately, there exists a workaround (originally from http://lists.public.thoughtworks.org/pipermail/selenium-users/2005-March/000213.html).
In FireFox enter "about:config" in the address bar, and set the value of "signed.applets.codebase_principal_suppor" to "true". This allows non-signed scripts to request higher privileges.
In Selenium we then have to request the privilege to upload local files by adding the following JavaScript snippet to the function "Selenium.prototype.doType" in the file "selenium-api.js":
netscape.security.PrivilegeManager.enablePrivilege('UniversalFileRead');
Update 2009-01-04: Fixing links, fixing problem with quotes which got messed up by WordPress.




TAKEN FROM :

http://www.sencha.com/forum/showthread.php?82411-Selenium-and-File-Upload-Field
http://cakebaker.42dh.com/2006/03/29/file-upload-with-selenium/

//Taken for note :D