i want to upload a gif file in my application using selenium codes in firefox, i have the following file input type:
<input id="file" type="file" size="27" value="Attach document" onclick="javascript:return processAttachment();" name="file">
i have tried this code:
driver.findElementByName("file").sendKeys("E:/plus.GIF");
driver.findElementByName("file").click();
but its is not working, instead开发者_如何学Python a file upload window is opening, can any one help me getting out of it.please
thank you
With this line driver.findElementByName("file").click(); you are "trying" to click the field , where you typed the text.It should be driver.findElementByName("NAME OF THE SUBMIT BUTTON").click();
精彩评论