SilkTest入门快打2-编写脚本测试

2018年02月14日 ⁄ 综合 ⁄ 共 1836字 ⁄ 字号 评论关闭

[+] PushButton N52
[+] multitag "?[5]"
[ ] "\$90"
[+] PushButton N92
[+] multitag "?[9]"
[ ] "\$91"
[+] PushButton PushButton20
[+] multitag "-"
[ ] "\$93"
[+] PushButton PushButton26
[+] multitag "+"
[ ] "\$92"
[+] PushButton PushButton27
[+] multitag "="
[ ] "\$112"

[+] PushButton Div
[+] multitag "?[5]"
[ ] "\$90"
[+] PushButton Mul
[+] multitag "?[9]"
[ ] "\$91"
[+] PushButton Dec
[+] multitag "-"
[ ] "\$93"
[+] PushButton Plus
[+] multitag "+"
[ ] "\$92"
[+] PushButton Equal
[+] multitag "="
[ ] "\$112"

[+] TextField TextField1
[ ] tag "\$403"

[+] TextField CalResult
[ ] tag "\$403"

[-] testcase Cal123Plus()   //1

[ ] 计算器.SetActive ()  //2

[ ] 计算器.C.Click ()    //3

[ ] 计算器.N1.Click ()  //4

[ ] 计算器.N2.Click ()  //5

[ ] 计算器.N3.Click ()  //6

[ ] 计算器.Plus.Click () //7

[ ] 计算器.N1.Click ()  //8

[ ] 计算器.N2.Click () //9

[ ] 计算器.N3.Click () //10

[ ] 计算器.Equal.Click () //11

[ ] String sResultValue = 计算器.CalResult.GetText() //12

[-] if(val(sResultValue) == 246)  //13

[ ] Print("Passed: Expect 123+123=246, actually it is {sResultValue}") //14

[-] else //15

[ ] raise 1, "Failed: Expect 123+123=246, actually it is {sResultValue}" //16