51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 1500|回复: 6

ROBOT如何实现非标准控件上传

[复制链接]
  • TA的每日心情
    无聊
    11 小时前
  • 签到天数: 385 天

    连续签到: 4 天

    [LV.9]测试副司令

    发表于 2020-11-24 11:46:41 | 显示全部楼层 |阅读模式
    1测试积点
    1.我使用关键字select frame 总是报找不到iframe ,但是html代码中的确是存在的,在这个动作之前我也加了sleep,还是没效果,如下图



    4.我想的先切换到这个iframe,定位到元素后,在用autoItLibrary来实现上传附件,可以现在都没切换到这个浮层弹窗

    附件: 您需要 登录 才可以下载或查看,没有帐号?(注-册)加入51Testing
    回复

    使用道具 举报

  • TA的每日心情

    2020-12-9 10:21
  • 签到天数: 7 天

    连续签到: 1 天

    [LV.3]测试连长

    发表于 2020-11-24 15:23:30 | 显示全部楼层
    建议尝试一下这个方法:
    目前Selenium2Library没有可以利用index进行定位的,所以需要自己新增个方法进行定位,在Python 2.7版本下面,打开C:\Python27\Lib\site-packages\SeleniumLibrary\keywords,找到frames.py文件,在select_frame方法下面新增一个方法:
    @keyword
        def select_frame_by_index(self, locator, index):
            """Sets frame identified by 'locator' as current frame ,
            if 'locator' is not unique, use index Key attributes for frames are 'id' and 'name'.
            See 'introduction' for details about locating elements.

            Example:
            | select_frame_by_index | tag=iframe | 1 |
            """
            self.info("Selecting frame '%s'." % locator)
            elements = self.find_elements(locator)
            element = elements[int(index)]
            self.driver.switch_to.frame(element)
    此时在RobotFramework可以通过如下方式选择frame
    select frame by index
    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    2024-3-11 11:36
  • 签到天数: 999 天

    连续签到: 2 天

    [LV.10]测试总司令

    发表于 2020-11-25 10:13:16 | 显示全部楼层
    可以结合这篇帖子看看,http://ask.testfan.cn/question/192
    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    12 小时前
  • 签到天数: 1647 天

    连续签到: 4 天

    [LV.Master]测试大本营

    发表于 2020-11-25 11:27:26 | 显示全部楼层
    回复

    使用道具 举报

  • TA的每日心情
    慵懒
    10 小时前
  • 签到天数: 1367 天

    连续签到: 4 天

    [LV.10]测试总司令

    发表于 2020-11-25 11:30:03 | 显示全部楼层
    不用id试试呢
    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    13 小时前
  • 签到天数: 2636 天

    连续签到: 4 天

    [LV.Master]测试大本营

    发表于 2020-11-25 13:22:33 | 显示全部楼层
    试试其他的方式吧
    回复

    使用道具 举报

  • TA的每日心情
    擦汗
    2024-3-11 10:55
  • 签到天数: 643 天

    连续签到: 1 天

    [LV.9]测试副司令

    发表于 2020-11-25 14:34:44 | 显示全部楼层
    看看,这个链接吧http://ask.testfan.cn/question/192
    回复

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-3-28 21:03 , Processed in 0.064902 second(s), 22 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表