开发者

how to upload a file using firefoxdriver in selenium testing

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();

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜