TA的每日心情 | 无聊 2018-9-27 10:05 |
---|
签到天数: 36 天 连续签到: 1 天 [LV.5]测试团长
|
回复 1# 42780419
给你随手写了一段,没有调试,你调试一下:- Dim CheckReturn
- CheckReturn = Browser("xxxx").Page("xxxx").WebElement("xxx").CheckProperty "Value", "123"
- Call QTP_Write_Excel("D:\test.xls","Sheet1",1,1,CheckReturn)
- Public Function QTP_Write_Excel(pathway,sheetname,x,y,content)
- Dim srcData,srcDoc,sp1,sp2,num,use,a1,a2,a3
- set srcData = CreateObject("Excel.Application")
- srcData.Visible = False
- set srcDoc = srcData.Workbooks.Open(pathway)
- srcDoc.Worksheets(sheetname).Activate
- srcDoc.Worksheets(sheetname).Cells(x,y).value = content
- wait(1)
- srcDoc.Save
- srcData.Workbooks.Close
- Set srcDoc = nothing
- Window("text:=Microsoft Excel").Close
- End Function
复制代码 |
|