0

我是 Helium Scripts 的新手。我正在尝试使用 Helium 的 API 文档中提到的 attach_file 选项。但它没有附加文件。

我正在使用的语法: attach_file("C:\xxx/xxx.csv", to="File name:")

请指导我。谢谢

SP

4

2 回答 2

2

那么您尝试附加文件的方式不正确。正确的方法应该遵循

attachFile("c:/test.txt", to("Please select a file:"));

所以在上面的语法中attach_file这应该是attachFile ( "C:\xxx/xxx.csv",按照C:/xxx/xxx.csv格式 为="文件名:"这里应该是 String, WebElement而不是文件名, HTMLElement 或 Point )

所以最终的发现是语法attaching file is attachFile("file path from where you want to attach", to("WebElement, HTMLElement or Point" where you want to submit))

于 2016-10-10T09:10:46.460 回答
0

如果有人现在需要它来使用 Python。这是氦文档字符串的摘录:

attach_file("c:/test.txt", to="Please select a file:")
于 2020-10-19T13:10:46.480 回答