uploading a file during a test in IE

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

uploading a file during a test in IE

GW-5
Hi all,

Does anybody know a way to select 'browse' option to upload files and how to specify the access path. Once the 'Choose file' window pops up the Selenium test is paused. Is there a way to get Selenium to interact with this window?

Thanks,
Alex
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=1724&messageID=4958#4958

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: uploading a file during a test in IE

Alexandre Garel

alex zevenbergen a écrit :
> Hi all,
>
> Does anybody know a way to select 'browse' option to upload files and how to specify the access path. Once the 'Choose file' window pops up the Selenium test is paused. Is there a way to get Selenium to interact with this window?
>
>  
No way this is a javascript restriction due to security reasons. A
javascript won't be able to upload a file.
Alex

Ce message est protégé par les règles relatives au secret des correspondances. Il est donc établi à destination exclusive de son destinataire. Celui-ci peut donc contenir des informations confidentielles. La divulgation de ces informations est à ce titre rigoureusement interdite. Si vous avez reçu ce message par erreur, merci de le renvoyer à l'expéditeur dont l'adresse e-mail figure ci-dessus et de détruire le message ainsi que toute pièce jointe.

This message is protected by the secrecy of correspondence rules. Therefore, this message is intended solely for the attention of the addressee. This message may contain privileged or confidential information, as such the disclosure of these informations is strictly forbidden. If, by mistake, you have received this message, please return this message to the addressser whose e-mail address is written above and destroy this message and all files attached.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: uploading a file during a test in IE

GW-5
but there is a way of changing the confiure options in Firefox right?

Would anybody be able to give me a quick walk through on how to do this as i convinced my team to move to Firefox for their testing.

Thanks
Alex
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=1724&messageID=5234#5234

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: uploading a file during a test in IE

GW-5
Alex,

Here's the answer, from http://lists.public.thoughtworks.org/pipermail/selenium-users/2005-March/000213.html.
I've added a couple of lines to show how to do these steps.

a) The Mozilla (Firefox) must have the configuration option
"[b]signed.applets.codebase_principal_support[/b]" set to the value "[b]true[/b]".
This allows non-signed scripts to request higher privileges.
You can set this by going to [b]about:config[/b] in the address bar of Firefox.

b) Selenium must request higher privileges which can be handled in
different places. To allow typing into file fields you can include this
call:
[b]netscape.security.PrivilegeManager.enablePrivilege("UniversalFileRead");[/b]
You can put this as the first line of the doType method in [b]selenium-api.js[/b].  If your Selenium is also used by IE, you might want to use a try/catch block or check your browser before executing this line.

Good Luck,
Marc
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=1724&messageID=5236#5236

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: uploading a file during a test in IE

GW-5
thanks for that

just 1 more thing - now whn i open selenium and try to run a test the'The error message is: 'netscape' is undefined' error apears.

by default the browser is Mozzila so why isn't it working?

thanks
Alex
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=1724&messageID=5238#5238

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: uploading a file during a test in IE

GW-5
I only got the error you mentioned when running with IE, but in any case it went away when I surrounded that line with a try/catch block:

try { netscape.security.PrivilegeManager.enablePrivilege("UniversalFileRead");
     } catch (err) {
     }

You may, of course, want to do something more when you catch the error.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=1724&messageID=5239#5239

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: uploading a file during a test in IE

GW-5
this is probaly i stupid question but how can i tell if selenium is running in FireFox?

and what syntax do i use to type to an input type='file' text box?

thanks
Alex
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=1724&messageID=5253#5253

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]