01-18-2011, 03:20 PM
Hi guys,
I'm trying to disable cookies in IE8 using QTP 10.
The manual way is:
- Go to Tools/Developer Tools
- In Developer Tools window, choose Cache/Disable Cookies
When capturing interface for the tool bar, I got it as WinToolbar. Search for the methods of this object i found only 2 methods to use:
- Object.Press "Tools" and Object.Type "Tools"
I tried using this way
1. Object.Press "Tools"
2. Object.Type "{F12}"
It works for me but not stable. I would like to have a stable solution for this situation.
Rightnow, I'm using the sendkey method which is quite stable for me, but this solution is still not stable. This is my code:
Thankful for any solution.
Ngoc Vo
I'm trying to disable cookies in IE8 using QTP 10.
The manual way is:
- Go to Tools/Developer Tools
- In Developer Tools window, choose Cache/Disable Cookies
When capturing interface for the tool bar, I got it as WinToolbar. Search for the methods of this object i found only 2 methods to use:
- Object.Press "Tools" and Object.Type "Tools"
I tried using this way
1. Object.Press "Tools"
2. Object.Type "{F12}"
It works for me but not stable. I would like to have a stable solution for this situation.
Rightnow, I'm using the sendkey method which is quite stable for me, but this solution is still not stable. This is my code:
Code:
Set WshShell = CreateObject("WScript.Shell")
While Window("Developer Tools").Exist(2) = False
Browser("micclass:=Browser").Page("micclass:=Page").SetTOProperty "focus", True
WshShell.AppActivate "Internet Explorer"
WshShell.SendKeys("{F12}")
Wait(2)
Wend
WshShell.AppActivate "Developer Tools"
WshShell.SendKeys("%c")
Wait(2)
WshShell.SendKeys("c")
Wait(2)
WshShell.SendKeys("{F12}")
Ngoc Vo