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。