1_QTP_开始测试_使用IE打开51网站
上一篇 /
下一篇 2013-12-21 18:57:31
/ 个人分类:QTP follow me
刚刚写了一遍,点错了按钮,呵呵......
再来一遍,1 2 3 走起~
做
自动化测试啦
第一步干啥呢
想想手工怎么测试来着?
打开网站啊~
对,现在让
QTP自动打开网站吧
怎么打开呢?
使用SystemUtil对象吧
1、用IE打开51testing网站
SystemUtil.Run"C:\Program Files\Internet Explorer\IEXPLORE.EXE","http://www.51testing.com"语法:SystemUtil.Run 参数1,参数2
具体使用在QTP中选中SystemUtil点击F1看看吧
注意:第一个参数一定是你的IE安装目录哈~
打开了51testing网站,干啥啊~
咱把它关了吧~行~
哈哈~
把房子扒了捉蛐蛐,就是个玩!
那么怎么关呢?
看看任务管理器
原来打开IE浏览器,后台就会多一个iexplore.exe进程
好嘞~
关了它
2、关闭IE进程
SystemUtil.CloseProcessByName "iexplore.exe"
注意:我们是根据进程名字关闭进程滴~看看英文CloseProcessByName
那么SystemUntil对象还能干啥?
看看F1怎么说~
他说还能打开个记事本
我们44?!
1、打开记事本
SystemUtil.Run "D:\test\temp.txt"注意:你一定要在D盘路径下有这个记事本文件哈~
看看任务管理器
呦~多了个notepad.exe进程
老套路,关了呗
2、关闭记事本
SystemUtil.CloseProcessByName "notepad.exe"
这次先写到这里
代码:
SystemUtil.Run"C:\Program Files\Internet Explorer\IEXPLORE.EXE","http://www.51testing.com"
Wait 3
SystemUtil.CloseProcessByName "iexplore.exe"
SystemUtil.Run "D:\test\temp.txt"
Wait 3
SystemUtil.CloseProcessByName "notepad.exe"
收藏
举报
TAG: