首页 > 技术文章 > 文件上传

ai594ai 2020-05-21 13:44 原文

1、安装pythonwin32

在下载地址:http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/找到对应自己python的pythonwin32版本,下载并安装pythonwin32。

安装成功的验证:在cmd中输入pip list,会查看到pywin32,表示安装成功 

2、安装AutoItLibrary

>pip3 install robotframework-autoitlibrary -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

 

3、安装AutoIt_V3

下载地址:https://www.autoitscript.com/site/autoit/downloads/

 

 

大致思路:

1、将AutoLibrary导入到RobotFramework中

 

 2、启动AutoIt,获取属性

 

 

 

 获取windows对象属性(Summary标签下的(ClassNN或者Advanced(Class)))后面的值

 

   Control Send    文件上传    ${EMPTY}    [CLASS:Edit; INSTANCE:1]    111.xlsx
    Sleep    2
    Control Click    文件上传    ${EMPTY}    Button1
    Sleep    3
    Page Should Not Contain Element    css=.el-message__content    文件上传失败    INFO

 

推荐阅读