码迷,mamicode.com
首页 > 其他好文 > 详细

计算器一位加法计算,并将实际值,测试结果输出,最终导入到本地

时间:2016-06-26 09:08:08      阅读:192      评论:0      收藏:0      [点我收藏+]

标签:

‘计算器一位加法计算,并将实际值,测试结果输出,最终导入到本地

Dim i

Dim input

Dim expertvalue,actualvalue

datatable.ImportSheet  "C:\Users\Administrator\Desktop\UFT活动讲课资料\加法运算case.xlsx","Sheet1","Action1"

‘wait 3

systemutil.Run"C:\Windows\System32\calc.exe"

For i To datatable.GetSheet("Action1").GetRowCount 

    input =datatable.Value("input","Action1")

    Window("计算器").WinButton("C").Click

    Window("计算器").WinButton(input).Click

    Window("计算器").WinButton("+").Click

    Window("计算器").WinButton("2").Click

    Window("计算器").WinButton("=").Click

    expertvalue=datatable.Value("expertvalue","Action1")

    actualvalue= Window("计算器").Static("9").GetROProperty("text")

    If expertvalue=actualvalue Then

        reporter.ReportEvent micPass,"一位数相加结果","成功"

        datatable.Value("actualvalue","Action1")=actualvalue

        datatable.Value("status","Action1"="pass"

    else

        reporter.ReportEvent micFail,"一位数相加结果","失败"

        datatable.Value("actualvalue","Action1")=actualvalue

        datatable.Value("status","Action1"="fail"    

    End If

    datatable.GetSheet("Action1").SetNextRow

Next

Window("计算器").Close

datatable.ExportSheet "C:\Users\Administrator\Desktop\UFT活动讲课资料\加法运算case.xlsx","Action1"

计算器一位加法计算,并将实际值,测试结果输出,最终导入到本地

标签:

原文地址:http://www.cnblogs.com/aliceluo/p/5617367.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!