首页 > 其他分享 >uibot 获取excel大范围数据然后对应的填入各个web框中

uibot 获取excel大范围数据然后对应的填入各个web框中

时间:2023-02-24 10:36:31浏览次数:35  
标签:web 200 title Chrome excel WidgetWin True 框中 cls

  • uibot 获取excel大范围数据然后对应的填入各个web框中
  • Dim bRet = ""
    Dim objRet = ""
    Dim arrSet = ""
    Dim arrayRet = ""
    Dim objExcelWorkBook = ""
    objExcelWorkBook = Excel.OpenExcel('''C:\Users\Asus\Documents\Tencent Files\1778296894\FileRecv\合并3.xlsx''',False,"WPS","","")
    objRet = Excel.ReadCell(objExcelWorkBook,"sheet1","A20151:A30000")//A16322:A30000、、A19659
    //A18362
    //arrayRet = Excel.ReadRange(objExcelWorkBook,"Sheet1","D2:D96")
    //arrayRet = Excel.ReadColumn(objExcelWorkBook,"Sheet1","D9")
    
    Excel.CloseExcel(objExcelWorkBook,True)
    arrSet = Set.ToArray(objRet)
    
    For Each id_no In arrSet
        If id_no = ""
            Continue
        Else
            
            #icon("@res:piuqo5gi-1vu1-moc0-9k5o-3m07us5kf22k.png")
            Keyboard.InputText({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"INPUT","id":"c4_wlno"}]},id_no,True,20,10000,{"bContinueOnError":True,"iDelayAfter":300,"iDelayBefore":500,"bSetForeground":True,"sSimulate":"message","bValidate":True,"bClickBeforeInput":True})
            #icon("@res:b2dlcs8v-m66h-p9tf-s6ca-mm3609mj6o80.png")
            UiElement.SetSelect({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"SELECT"}]},"所有","text",{"bContinueOnError":True,"iDelayAfter":300,"iDelayBefore":200})
            #icon("@res:jjjp4ipl-lci5-ujri-risl-0bopeeh30gk5.png")
            Mouse.Action({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"BUTTON","parentid":"filterMoreDiv"}]},"left","click",10000,{"bContinueOnError":True,"iDelayAfter":300,"iDelayBefore":400,"bSetForeground":True,"sCursorPosition":"Center","iCursorOffsetX":0,"iCursorOffsetY":0,"sKeyModifiers":[],"sSimulate":"simulate","bMoveSmoothly":False})
            Delay(5000)
            #icon("@res:i8tqf393-ff8h-1bof-arhc-08u532i88nqe.png")
            bRet = UiElement.Exists({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"A","parentid":"dwData","aaname":"编辑","tableRow":"2"}]},{"bContinueOnError":True,"iDelayAfter":300,"iDelayBefore":200})
            If bRet = True
                
                TracePrint("11修改成功~~~~:"&id_no)
                #icon("@res:juoaoona-28j5-59pf-ajo2-veastu3ivnft.png")
                Mouse.Action({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"A","parentid":"dwData","aaname":"编辑","tableRow":"2"}]},"left","click",5000,{"bContinueOnError":True,"iDelayAfter":200,"iDelayBefore":200,"bSetForeground":True,"sCursorPosition":"Center","iCursorOffsetX":0,"iCursorOffsetY":0,"sKeyModifiers":[],"sSimulate":"simulate","bMoveSmoothly":False})
                #icon("@res:pv30l4hu-eg79-g12u-50nu-sh7bad825umr.png")
                bRet1 = UiElement.Exists({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"BUTTON","parentid":"c1main","aaname":"完成"}]},{"bContinueOnError":True,"iDelayAfter":200,"iDelayBefore":200})
                If bRet1 = True
                    #icon("@res:a7dfde5i-h2al-e28f-rbnb-8ir8hht37ccu.png")
                    Mouse.Action({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"BUTTON","parentid":"c1main","aaname":"完成"}]},"left","click",5000,{"bContinueOnError":True,"iDelayAfter":200,"iDelayBefore":200,"bSetForeground":True,"sCursorPosition":"Center","iCursorOffsetX":0,"iCursorOffsetY":0,"sKeyModifiers":[],"sSimulate":"simulate","bMoveSmoothly":False})
                    #icon("@res:dcoonj88-fde3-pbkp-ulev-7699f2sorgp1.png")
                    Keyboard.InputText({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"TEXTAREA"}]},"您的公交卡已制作完毕。",True,20,6000,{"bContinueOnError":True,"iDelayAfter":200,"iDelayBefore":200,"bSetForeground":True,"sSimulate":"message","bValidate":False,"bClickBeforeInput":False})
                    
                    
                    // dim count = 0
                    // #icon("@res:9bujp12u-6sna-o33f-5amf-u9dkvtca9ors.png")
                    // bRet2 = UiElement.Exists({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"A","aaname":"确定完成"}]},{"bContinueOnError":False,"iDelayAfter":300,"iDelayBefore":200})
                    // If bRet2 = true                
                    #icon("@res:k23ajud4-fnoh-4v89-s542-255ch9hig1id.png")
                    Mouse.Action({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"A","aaname":"确定完成"}]},"left","click",10000,{"bContinueOnError":True,"iDelayAfter":300,"iDelayBefore":200,"bSetForeground":True,"sCursorPosition":"Center","iCursorOffsetX":0,"iCursorOffsetY":0,"sKeyModifiers":[],"sSimulate":"simulate","bMoveSmoothly":False})
                    //end if
                    
                    TracePrint("22修改成功~~~~:"&id_no)
                    Delay(13000)
                    #icon("@res:s2tep3an-ngdr-33bt-ulu7-pfq1sfp96hmh.png")
                    Mouse.Action({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"BUTTON","parentid":"filterMoreDiv"}]},"left","click",10000,{"bContinueOnError":True,"iDelayAfter":300,"iDelayBefore":200,"bSetForeground":True,"sCursorPosition":"Center","iCursorOffsetX":0,"iCursorOffsetY":0,"sKeyModifiers":[],"sSimulate":"simulate","bMoveSmoothly":False})
                    Delay(4000)
                Else
                    TracePrint("33原本是已经点击完成状态!!:"&id_no)
                    #icon("@res:ueqrsmgd-r8g1-33ov-dqtk-pp8gif7iricu.png")
                    Mouse.Action({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"BUTTON","parentid":"c1main","aaname":"关闭"}]},"left","click",10000,{"bContinueOnError":True,"iDelayAfter":300,"iDelayBefore":200,"bSetForeground":True,"sCursorPosition":"Center","iCursorOffsetX":0,"iCursorOffsetY":0,"sKeyModifiers":[],"sSimulate":"simulate","bMoveSmoothly":False})
                    Continue
                End If
            Else
                TracePrint("44原本就是修改成功的~~~~:"&id_no)
                Delay(2000)
                Continue
            End If
        End If
        
    Next
    CollectGarbage

     

标签:web,200,title,Chrome,excel,WidgetWin,True,框中,cls
From: https://www.cnblogs.com/springcloud/p/17150395.html

相关文章

  • php 导入excel 表格里时间 进行处理
    /***[excelTimedescription]*@Author:XuXianGang*@Method:excel转换时间*@DateTime:2022-06-06T09:36:37+0800*@param[type]$days......
  • websocket接口自动化集成pytest测试框架
    每天进步一点点,关注我们哦,每天分享测试技术文章本文章出自【码同学软件测试】码同学公众号:自动化软件测试,领取资料可加:magetest码同学抖音号:小码哥聊软件测试 01web......
  • Python:Excel自动化实践入门篇 甲【留言点赞领图书门票】
    *以下内容为本人的学习笔记,如需要转载,请声明原文链接微信公众号「englyf」https://mp.weixin.qq.com/s?__biz=MzUxMTgxMzExNQ==&mid=2247485524&idx=1&sn=7af7790002e0e60......
  • 2月23日javaweb之Maven
    Maven常用命令compile:编译clean:清理test:测试package:打包install:安装Maven生命周期Maven对项目构建的生命周期描述是一次构建过程经历了多少个时间。Maven对项目的......
  • Jenkins 添加节点 java web方式
    启用代理端口可以自己指定添加节点参数说明:Name(名称):即节点名称Description(描述):介绍该节点的作用,如Docker构建ofexecutors(并发构建数):定义该节点可以执行多少......
  • 2.23 Javaweb 总结
    今日不报错了,但是页面一直404,目前没找到问题在哪AddServletpackagecom;importjavax.servlet.ServletException;importjavax.servlet.annotation.WebServlet;imp......
  • Web项目中关于返回结果类和泛型以及vue中await的问题
    今天在学习web项目的时候发现需要自定义一个返回结果类用于处理前后端之间可能发生的各种情况。publicclassR<T>{privateIntegercode;//编码:1成功,0和其它数......
  • JAVAWEB-NOTE01-初识mysql
    目录JAVAWEB介绍数据库相关概念数据库数据库管理系统SQL常见的关系型数据库管理系统MySQL数据库安装配置登录、退出卸载数据模型JAVAWEB介绍数据库相关概念数据库数......
  • asp.net core webapi之创建项目后切换http/https
    在项目调试过程中如果选择了https则会出现下面问题这时的解决方案为:项目-右键-属性-调试,把原先的https后的s删除即可  ......
  • Asp.NET Core 导出数据到 Excel 文件
    在Asp.NetCore开发中,使用NPOI将数据导出到Excel文件中,并返回给前端。service层代码:///<summary>///将数据导出到excel///</summary>......