How to work with Pop Up in IE with QTP

    0
    117
    Spread the love
    • 1
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
      1
      Share

    While doing automation testing , I have seen there are cases where there is requirement to check if a certain POP UP is coming or not. Generally those commercial websites which throws a lot of POP up during navigation needs such testing.

    Again the traditional websites do not like the POP Up to be flashed during navigation.
    So, we, the automation Test Engineers need to have a set of code which will set-reset this POP up functionality of IE.

    The code to work with POP UP is below written:
    ‘to disable pop up blocker
    Call Popup_switch(“no”)
    ‘to enable pop up blocker
    Call Popup_switch(“yes”)

    Function Popup_switch(param1)
    Set WshShell=CreateObject(“WScript.shell”)
    ‘the below line is to work with Registry
    editregpath=”HKCUSoftwareMicrosoftInternet ExplorerNew WindowsPopupMgr”
    ‘to disable pop up blocker
    if param1=”no” then
    WshShell.RegWrite editregpath,”no”,”REG_SZ”
     ‘to enable pop up blocker
    elseif param1=”yes” then
     WshShell.RegWrite editregpath,”yes”,”REG_SZ”
    end if
    End Function

    Don't miss out!
    Subscribe To Newsletter

    Receive top technical news, lesson ideas, travel tips and more!

    Invalid email address
    Give it a try. You can unsubscribe at any time.

    Spread the love
    • 1
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
      1
      Share

    LEAVE A REPLY

    Please enter your comment!
    Please enter your name here