1.1. 用代码来启动浏览器
方法1. Browser1 = "IE"
StartURL = "www.51testing.com"
IF Browser1 = "IE" THEN
set IE = CreateObject("InternetExplorer.Application")
IE.Visible = true
IE.Navigate StartURL
方法2.
SystemUtil.Run "C:\Program Files\Internet Explorer\iexplore.exe",www.163.com
方法3.
SystemUtil.Run "C:\Program Files\Internet Explorer\iexplore.exe"
Browser("title:=about:blank").Sync
Browser("title:=about:blank").Navigate www.tom.com
1.2. change sysdate
Dim oShell
Set oShell = CreateObject ("WSCript.shell")
oShell.run "cmd /K date 07-10-03"
Set oShell = Nothing
systemutil.CloseProcessByName("cmd.exe")
msgbox(date) ‘输出是7/10/2003
1.3. 模拟键盘操作
Set shell=Createobject("WScript.Shell")
shell.sendkeys "CAPSLOCK" ‘点击capslock
具体键位请参照QTP帮助,关键字:sendkeys
浙公网安备 33010602011771号