您可以使用实习生Leadfoot上传远程文件吗 [英] Can you upload remote files with intern leadfoot

查看:100
本文介绍了您可以使用实习生Leadfoot上传远程文件吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在测试文件上传功能,并尝试上传远程文件(例如 https://s3. amazonaws.com/some_dir/some_file ).使用type()会引发错误,指出路径不是绝对的.实习生支持吗?如果是,该怎么办?

I'm testing a file upload feature and trying to upload remote files(e.g. https://s3.amazonaws.com/some_dir/some_file). Using type() throws an error stating the path is not absolute. Is this supported by intern? If yes, how should it be done?

推荐答案

Leadfoot处理文件上传是这样的:

Leadfoot handles file uploads like this:

  1. 该测试使用文件的本地(到Intern)路径在文件输入元素上调用type.该文件必须在运行Intern的系统上存在.您可以使用require.toUrl(例如,element.type(require.toUrl('./someFile.txt')))获得指向它的绝对路径.
  2. Leadfoot静默将文件上传到远程Selenium/WebDriver服务器,并确定其在远程系统上的路径.
  3. Leadfoot使用远程服务器上新上传的文件的路径在输入元素上调用sendKeys.
  1. The test calls type on a file input element with the local (to Intern) path of a file. This file must exist on the system running Intern. You can get an absolute path to it by using require.toUrl (e.g., element.type(require.toUrl('./someFile.txt'))).
  2. Leadfoot silently uploads the file to the remote Selenium/WebDriver server and determines its path on the remote system.
  3. Leadfoot calls sendKeys on the input element using the path of the newly uploaded file on the remote server.

最终目标是使远程浏览器能够为输入的文件选择一个文件并将其发送到某个地方.为此,该文件必须存在于远程系统(运行正在测试的浏览器的文件)上.

The end goal is for the remote browser to be able to select a file for a file input and send it somewhere. For that to work, the file must exist on the remote system (the one running the browser being tested).

这篇关于您可以使用实习生Leadfoot上传远程文件吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆