【发布时间】:2014-05-14 18:47:53
【问题描述】:
谁能告诉我如何使用 selenium RC/Webdriver 在 Gmail/Yahoo 邮件中添加附件。
请在这种情况下帮助我。
提前致谢。
【问题讨论】:
-
您可以使用 AutoIT 工具来处理窗口 gui 并附加文件。访问 www.autoitscript.com
标签: selenium gmail selenium-rc selenium-webdriver yahoo
谁能告诉我如何使用 selenium RC/Webdriver 在 Gmail/Yahoo 邮件中添加附件。
请在这种情况下帮助我。
提前致谢。
【问题讨论】:
标签: selenium gmail selenium-rc selenium-webdriver yahoo
在您的机器上安装 Autoit。 编写如下所示的 AutoIT 脚本。
WinWaitActive("Choose file") \\specify the name of the choose window
Send("C:\attach\samplefile.txt") \\location of the file you want to attach
Send("{ENTER}")
编写代码后,将文件另存为attach.exe 将以下行添加到您的 selenium 代码中(如果使用 java)
Runtime.getRuntime().exec("c:\\path\\attach.exe");
以上内容将有助于添加附件。希望对您有所帮助!
【讨论】:
我使用机器人 api 找到了这个问题的答案。感谢回答这个问题的人。
【讨论】: