Set objFSO=CreateObject("Scripting.FileSystemObject")
Set objTFile=objFSO.CreateTextFile("C:\test\Test.txt")
SystemUtil.Run "C:\test\Test.txt"
Window("Notepad").Activate
Window("Notepad").Type micCtrlDwn + "v" + micCtrlUp
wait 3
Window("Notepad").Type micCtrlDwn + "s" + micCtrlUp
systemUtil.CloseProcessByName "C:\test\Test.txt"
Set objfileToread=objFSO.OpenTextFile("C:\test\Test.txt",1)
fileText=objfileToread.ReadAll()
............................................... ...................................................
我收到以下错误消息:
此服务由“ Window(“ Notepad”)”中的另一个服务访问。键入micCtrlDwn +“ s” + micCtrlUp“步骤。 但是,当我运行以下代码时,它会成功执行: ................................................... ..............................................
Set objFSO=CreateObject("Scripting.FileSystemObject")
SystemUtil.Run "C:\test\Test.txt"
Window("Notepad").Activate
Window("Notepad").Type micCtrlDwn + "v" + micCtrlUp
wait 3
Window("Notepad").Type micCtrlDwn + "s" + micCtrlUp
systemUtil.CloseProcessByName "C:\test\Test.txt"
Set objfileToread=objFSO.OpenTextFile("C:\test\Test.txt",1)
fileText=objfileToread.ReadAll()
............................................... ...................................................
所有脚本都在UFT中。