I recently came across a situation where I had a Browser object embedded in an Excel File. I was able to identify it only as a WinObject… Read more “How to Automate Embedded Browser with QTP”
Sometimes QTP doesn’t recognize a dialog in Firefox. These types of Dialogs are not caught by the Object Spy and it seems difficult to handle it if… Read more “How to Handle “Dialogs” in Firefox (using QTP)”
I got into a tricky situation when I was required to invoke an Application through the Windows System Tray. The usual way of using SystemUtil.Run or WShell.Run… Read more “How to Invoke an Application in the System Tray”
Today, I will talk about the different ways to validate picture: 1) Using QTP Bitmap checkpoint: Using QTP Bitmap CheckPoint, picture can be verified against the previously… Read more “How to extract text from picture/images using QTP?”
This is Part 1 of the Series where I’ll be explaining how to Automate MSExcel using QTP. First of all, one needs to understand the Excel Object… Read more “Automating Microsoft Excel – Part 1 – How to Create an Excel Object, Enter and Retrieve Values from it.”
Automating any Microsoft Office Application can be a big challenge in itself. Purely because any Office Application(Excel/Word/PowerPoint/Outlook) can’t be directly automated with QTP’s object identification mechanism. During… Read more “How to Automate any MSOffice Application”
This time I am writing after a long time. I was debugging a script during which I was stuck in an issue due to which I got… Read more “How to overcome the limitation of MsgBox?”
People say “Necessity is the Mother of Invention”, I think “Google Search is the Mother of all Inventions”…purely because a Software Engineer is incomplete without it. So… Read more “How to Kill a Process using VBScript/QTP”
I am back with an Exciting feature of QTP. Sometimes, there are certain settings that you wish that can be configured automatically before running a Test. It also doesn’t make sense to record “activities configuring those settings”. Moreover, if you configure those settings manually in one machine, then you have configure those settings again in other machine if you plan to run test in some other machine.
For example: You want to disable pop up blocker before executing Tests as some pop up windows are getting opened in some of those tests.
To do this automatically using QTP, there is only one requirement: we just have to find out the registry setting that affects the feature that you want to change..
We will take the example of pop up blocker in this case
So, to disable pop up blocker, we just need to change the following registry key to No
“HKCU\Software\Microsoft\Internet Explorer\New Windows\PopupMgr”
We have to create “Windows Shell” object and then access its inbuilt RegRead and RegWrite functions.
As the name suggests, RegRead method allows you to read the value of the specified Registry path and RegWrite allows you to modify the value of the specified registry.
Now, lets do some action:
Dim objShell, RegLocate <blockquote>'create windows shell object Set objshell =CreateObject("WScript.Shell") 'disable pop up blocker in IE if enabled RegLocate ="HKCU\Software\Microsoft\Internet Explorer\New Windows\PopupMgr" msgbox objshell.RegRead (RegLocate) If (objshell.RegRead (RegLocate)="Yes" OR objshell.RegRead (RegLocate)="yes") Then objShell.RegWrite RegLocate,"No","REG_SZ" End If Set objshell = Nothing
As you see in the above example, value of the specified registry is displayed using RegRead function and then if pop up blocker is enabled, then it is disabled by modifying the value of corresponding registry key.
Similarly, to configure any other setting (before running test) in any browser, MS office or any other any software, you just need to know the registry setting that affects that particular activity and you are done…