User interface 如何使用空手道UI自动化上传PDF文件?
相关问题:,请您帮助我创建用于上传excel PDF的空手道用户界面代码,此结构为:User interface 如何使用空手道UI自动化上传PDF文件?,user-interface,karate,User Interface,Karate,相关问题:,请您帮助我创建用于上传excel PDF的空手道用户界面代码,此结构为: <div class="col-sm-6"> <div class="form-group shiny-input-container"> <label>Faça o upload do seu arquivo</label>
<div class="col-sm-6">
<div class="form-group shiny-input-container">
<label>Faça o upload do seu arquivo</label>
<div class="input-group">
<label class="input-group-btn">
<span class="btn btn-default btn-file">
Browse...
<input id="file_input" name="file_input" type="file" style="display: none;" data-shinyjs-resettable-id="file_input" data-shinyjs-resettable-type="File" data-shinyjs-resettable-value="" class="shinyjs-resettable shiny-bound-input">
</span>
</label>
<input type="text" class="form-control" placeholder="No file selected" readonly="readonly">
</div>
<div id="file_input_progress" class="progress progress-striped active shiny-file-input-progress">
<div class="progress-bar"></div>
</div>
</div>
</div>
编辑:首先阅读此答案:-因为Chrome本机集成支持0.9.6.RC4中提供的
driver.inputFile()
文件上传是浏览器自动化中一个众所周知的难题。我们需要社区的一些贡献,但这里有一个演示,我刚刚用空手道机器人进行了实验:
您可以在此处看到执行的视频:
我能想到的其他选择是:
a) 使用空手道的API测试功能执行多部分文件上传:-在大多数情况下,这实际上足以“完成”您拥有的流程。例如,对于您在上面看到的完全相同的流,它看起来如下所示:
* url 'http://the-internet.herokuapp.com/upload'
* multipart file file = { read: 'billie.png', filename: 'billie.png', contentType: 'image/png' }
* method post
通常,您可能需要添加一两个cookie,您可以轻松地从传递到
b) 另一个选项是我还没有尝试过的,你可以“伪造”用户界面中上传文件的部分,并用其他东西替换它,如果它能让你在流程中前进的话。请参阅:编辑:首先阅读此答案:-因为Chrome本机集成支持0.9.6.RC4中提供的driver.inputFile()
文件上传是浏览器自动化中一个众所周知的难题。我们需要社区的一些贡献,但这里有一个演示,我刚刚用空手道机器人进行了实验:
您可以在此处看到执行的视频:
我能想到的其他选择是:
a) 使用空手道的API测试功能执行多部分文件上传:-在大多数情况下,这实际上足以“完成”您拥有的流程。例如,对于您在上面看到的完全相同的流,它看起来如下所示:
* url 'http://the-internet.herokuapp.com/upload'
* multipart file file = { read: 'billie.png', filename: 'billie.png', contentType: 'image/png' }
* method post
通常,您可能需要添加一两个cookie,您可以轻松地从传递到
b) 另一个选项是我还没有尝试过的,你可以“伪造”用户界面中上传文件的部分,并用其他东西替换它,如果它能让你在流程中前进的话。请参阅:
* url 'http://the-internet.herokuapp.com/upload'
* multipart file file = { read: 'billie.png', filename: 'billie.png', contentType: 'image/png' }
* method post