<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: File Uploads with Selenium</title>
	<atom:link href="http://www.opensourceconnections.com/2007/06/06/file-uploads-with-selenium/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.opensourceconnections.com/2007/06/06/file-uploads-with-selenium/</link>
	<description>Automating the Science to Enable the Art</description>
	<lastBuildDate>Mon, 30 Aug 2010 21:13:30 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Prakash</title>
		<link>http://www.opensourceconnections.com/2007/06/06/file-uploads-with-selenium/comment-page-1/#comment-14355</link>
		<dc:creator>Prakash</dc:creator>
		<pubDate>Wed, 17 Mar 2010 12:12:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.opensourceconnections.com/2007/06/06/file-uploads-with-selenium/#comment-14355</guid>
		<description>Uploading Files using Selenium RC in C#&lt;br&gt;After googling all around to overcome the Selenium incapability of handling File Upload control finally I could write a simple function in C# which will do my job. In the function given below _selObj is the object of DefaultSelenium class.&lt;br&gt;&lt;br&gt;public bool TypeIntoFileUpload(string controlId, string filePath)&lt;br&gt;{&lt;br&gt;    try&lt;br&gt;    {&lt;br&gt;        string newFilePath = filePath.Replace(&#039;\&#039;, &#039;/&#039;);&lt;br&gt;         _selObj.WindowFocus();&lt;br&gt;         _selObj.Focus(controlId);&lt;br&gt;        string jscript=&quot;&quot;;&lt;br&gt;        jscript += &quot;if(selenium.browserbot.getCurrentWindow().clipboardData){window.clipboardData.setData(&#039;Text&#039;,&#039;&quot; + newFilePath + &quot;&#039;);}&quot;;&lt;br&gt;         _selObj.GetEval(jscript);&lt;br&gt;        byte VK_CONTROL = 0x11;&lt;br&gt;        byte VK_V = 0x56;&lt;br&gt;        _selObj.KeyDownNative(Convert.ToString(VK_CONTROL));&lt;br&gt;        _selObj.KeyPressNative(Convert.ToString(VK_V));&lt;br&gt;        _selObj.KeyUpNative(Convert.ToString(VK_CONTROL));&lt;br&gt;&lt;br&gt;        return true;&lt;br&gt;    }&lt;br&gt;    catch (Exception exc)&lt;br&gt;    {&lt;br&gt;        return false;&lt;br&gt;    }&lt;br&gt;}</description>
		<content:encoded><![CDATA[<p>Uploading Files using Selenium RC in C#<br />After googling all around to overcome the Selenium incapability of handling File Upload control finally I could write a simple function in C# which will do my job. In the function given below _selObj is the object of DefaultSelenium class.</p>
<p>public bool TypeIntoFileUpload(string controlId, string filePath)<br />{<br />    try<br />    {<br />        string newFilePath = filePath.Replace(&#39;\&#39;, &#39;/&#39;);<br />         _selObj.WindowFocus();<br />         _selObj.Focus(controlId);<br />        string jscript=&#8221;";<br />        jscript += &#8220;if(selenium.browserbot.getCurrentWindow().clipboardData){window.clipboardData.setData(&#39;Text&#39;,&#39;&#8221; + newFilePath + &#8220;&#39;);}&#8221;;<br />         _selObj.GetEval(jscript);<br />        byte VK_CONTROL = 0&#215;11;<br />        byte VK_V = 0&#215;56;<br />        _selObj.KeyDownNative(Convert.ToString(VK_CONTROL));<br />        _selObj.KeyPressNative(Convert.ToString(VK_V));<br />        _selObj.KeyUpNative(Convert.ToString(VK_CONTROL));</p>
<p>        return true;<br />    }<br />    catch (Exception exc)<br />    {<br />        return false;<br />    }<br />}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: selenuimuser</title>
		<link>http://www.opensourceconnections.com/2007/06/06/file-uploads-with-selenium/comment-page-1/#comment-14280</link>
		<dc:creator>selenuimuser</dc:creator>
		<pubDate>Mon, 23 Nov 2009 04:49:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.opensourceconnections.com/2007/06/06/file-uploads-with-selenium/#comment-14280</guid>
		<description>Hi,&lt;br&gt;&lt;br&gt;I&#039;m new to selenium and i want to know how to write selenium test case for file upload in firefox.If any body know this please help me.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I&#39;m new to selenium and i want to know how to write selenium test case for file upload in firefox.If any body know this please help me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amit Vibhuti</title>
		<link>http://www.opensourceconnections.com/2007/06/06/file-uploads-with-selenium/comment-page-1/#comment-14033</link>
		<dc:creator>Amit Vibhuti</dc:creator>
		<pubDate>Sat, 30 May 2009 10:10:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.opensourceconnections.com/2007/06/06/file-uploads-with-selenium/#comment-14033</guid>
		<description>This works :)

http://seleniumdeal.blogspot.com/2009/05/uploading-files-using-selenium-with-c.html</description>
		<content:encoded><![CDATA[<p>This works <img src='http://www.opensourceconnections.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://seleniumdeal.blogspot.com/2009/05/uploading-files-using-selenium-with-c.html">http://seleniumdeal.blogspot.com/2009/05/uploading-files-using-selenium-with-c.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bogdan</title>
		<link>http://www.opensourceconnections.com/2007/06/06/file-uploads-with-selenium/comment-page-1/#comment-13968</link>
		<dc:creator>Bogdan</dc:creator>
		<pubDate>Mon, 04 May 2009 15:14:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.opensourceconnections.com/2007/06/06/file-uploads-with-selenium/#comment-13968</guid>
		<description>Good solution in Java described here:
http://gusiev.com/?p=3
Works for all browsers.</description>
		<content:encoded><![CDATA[<p>Good solution in Java described here:<br />
<a href="http://gusiev.com/?p=3">http://gusiev.com/?p=3</a><br />
Works for all browsers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous Coward</title>
		<link>http://www.opensourceconnections.com/2007/06/06/file-uploads-with-selenium/comment-page-1/#comment-13295</link>
		<dc:creator>Anonymous Coward</dc:creator>
		<pubDate>Wed, 23 Jul 2008 16:27:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.opensourceconnections.com/2007/06/06/file-uploads-with-selenium/#comment-13295</guid>
		<description>I&#039;m still stuck with a model form that gets validated, for instance, if i want to force a user to upload a picture on account creation, i still would have to adjust my production code in order to be able to test it...

@Eric: Sure, this could be possible, but requires extra setup with the machines. And I hope your Server won&#039;t do anything with \\ URLs unless its not a Windows Server, which i hope even more less :P</description>
		<content:encoded><![CDATA[<p>I&#8217;m still stuck with a model form that gets validated, for instance, if i want to force a user to upload a picture on account creation, i still would have to adjust my production code in order to be able to test it&#8230;</p>
<p>@Eric: Sure, this could be possible, but requires extra setup with the machines. And I hope your Server won&#8217;t do anything with \\ URLs unless its not a Windows Server, which i hope even more less <img src='http://www.opensourceconnections.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric</title>
		<link>http://www.opensourceconnections.com/2007/06/06/file-uploads-with-selenium/comment-page-1/#comment-2228</link>
		<dc:creator>Eric</dc:creator>
		<pubDate>Thu, 16 Aug 2007 20:34:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.opensourceconnections.com/2007/06/06/file-uploads-with-selenium/#comment-2228</guid>
		<description>Well, can you hack around it?  In other words, can your remote server do something like \\someip\mydesktop\testfile.txt?   You are right that it&#039;s not a perfect solution, and adds a lot of brittleness.  

I would argue however that your Selenium tests if they are being run in any sort of regular way should be using the same file over and over, and not relying on your local desktop anyway!   If you are running Selenium under any kind of Continous Integration environment, having a dependency on a local file will cause all sorts of nightmares!</description>
		<content:encoded><![CDATA[<p>Well, can you hack around it?  In other words, can your remote server do something like \\someip\mydesktop\testfile.txt?   You are right that it&#8217;s not a perfect solution, and adds a lot of brittleness.  </p>
<p>I would argue however that your Selenium tests if they are being run in any sort of regular way should be using the same file over and over, and not relying on your local desktop anyway!   If you are running Selenium under any kind of Continous Integration environment, having a dependency on a local file will cause all sorts of nightmares!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Holger Wahlen</title>
		<link>http://www.opensourceconnections.com/2007/06/06/file-uploads-with-selenium/comment-page-1/#comment-2196</link>
		<dc:creator>Holger Wahlen</dc:creator>
		<pubDate>Wed, 15 Aug 2007 12:44:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.opensourceconnections.com/2007/06/06/file-uploads-with-selenium/#comment-2196</guid>
		<description>This only works if you have the server running on the same machine where the file lies, though, doesn&#039;t it? If I want to upload a local file to a remote server under test, such a helper action doesn&#039;t work because it can&#039;t access the file.</description>
		<content:encoded><![CDATA[<p>This only works if you have the server running on the same machine where the file lies, though, doesn&#8217;t it? If I want to upload a local file to a remote server under test, such a helper action doesn&#8217;t work because it can&#8217;t access the file.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Disco Blog &#187; Blog Archive &#187; The weekly bag&#8211; June 15</title>
		<link>http://www.opensourceconnections.com/2007/06/06/file-uploads-with-selenium/comment-page-1/#comment-786</link>
		<dc:creator>The Disco Blog &#187; Blog Archive &#187; The weekly bag&#8211; June 15</dc:creator>
		<pubDate>Fri, 15 Jun 2007 14:34:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.opensourceconnections.com/2007/06/06/file-uploads-with-selenium/#comment-786</guid>
		<description>[...] File Uploads with Selenium- Eric&#8217;s got some copasetic advice here! [...]</description>
		<content:encoded><![CDATA[<p>[...] File Uploads with Selenium- Eric&#8217;s got some copasetic advice here! [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
