如何在 Robot Framework 中处理文件上传 [英] How to handle File Upload in Robot Framework

查看:40
本文介绍了如何在 Robot Framework 中处理文件上传的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我单击上传"按钮时,我的应用程序中有 excel 导入器,我将看到一个带有文件上传屏幕的弹出窗口,我可以在其中从指定路径中选择 excel.如何在 Robot Framework 中处理这个问题?谁能帮我处理这个案子?

I have excel importer in my application when I click on the "Upload" button I will get a pop up window with file upload screen where I can select the excel from the specified path. How to handle this in Robot Framework? Can any one help me how to handle the case?

推荐答案

Selenium2Library 提供 Choose File 关键字相同.

Selenium2Library provides Choose File keyword for the same.

它有两个参数,第一个是按钮的定位器,第二个是需要上传的文件的路径.

It takes two arguments, first is locator for the button and second is path to the file which needs to be uploaded.

例如

Choose File xpath=.//div/input  ${TEMPDIR}${/}file_pa.csv

这篇关于如何在 Robot Framework 中处理文件上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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