SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 7 of 7
  1. #1
    Super Member
    Join Date
    Dec 2005
    Location
    USA
    Posts
    1,407
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    allow and disable popups blocker

    Hi,

    I have to write scripts to enable and disable the pop-up windows(pop-up blocker) in IE.

    I have searched the forum but could not find.

    if any one have come up with this scenarios then post the solution.

    I have come up with a script but it is not reliable.

    <font class="small">Code:</font><hr /><pre>
    popupwindow("enable")
    popupwindow("disable")

    Function popupwindow(status)
    SystemUtil.Run "Control.exe","inetcpl.cpl"
    Set objShell = CreateObject("Wscript.Shell")
    Do Until Success = True
    Success = objShell.AppActivate("Internet Properties")
    Wait(1)
    Loop
    'MsgBox Success
    objShell.Sendkeys "^{TAB}"
    Wait(1)
    objShell.Sendkeys "^{TAB}"
    Wait(1)
    objShell.Sendkeys "{TAB}"
    Wait(1)
    objShell.Sendkeys "{TAB}"
    Wait(1)
    objShell.Sendkeys "{TAB}"
    Wait(1)
    objShell.Sendkeys "{TAB}"
    Wait(1)
    objShell.Sendkeys "{TAB}"
    Wait(1)
    If status="enable" Then
    objShell.Sendkeys "b"
    Wait(1)
    objShell.Sendkeys "{TAB}"
    Wait(1)
    objShell.Sendkeys "{TAB}"
    Wait(1)
    objShell.Sendkeys "{ENTER}"
    Else
    objShell.Sendkeys "b"
    Wait(1)
    objShell.Sendkeys "{TAB}"
    Wait(1)
    objShell.Sendkeys "{ENTER}"
    End If
    End Function
    </pre><hr />
    ------------
    Chikki
    when things gets harder ,the harder gets going

  2. #2
    Advanced Member
    Join Date
    Sep 2007
    Location
    Chennai, Tamil nadu, India
    Posts
    999
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: allow and disable popups blocker

    Take a look on below URL [img]/images/graemlins/wink.gif[/img]

    http://www.microsoft.com/technet/scr...g0605.mspx#E1B
    i have never seen bugs sleeping

  3. #3
    Super Member
    Join Date
    Dec 2005
    Location
    USA
    Posts
    1,407
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: allow and disable popups blocker

    QTP is not supporting the method objRegistry.SetStringValue

    how do i convert this to QTP readable format

    <font class="small">Code:</font><hr /><pre>
    Function popupwindow()
    Const HKEY_CURRENT_USER ="&amp;H80000001"
    strComputer = "."
    Set objRegistry=GetObject("winmgmts:\\" &amp; strComputer &amp; "\root\default:StdRegProv")
    strKeyPath = "Software\Microsoft\Internet Explorer\New Windows"
    strValueName = "PopupMgr"
    strValue = "yes"
    objRegistry.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue
    End Function
    </pre><hr />
    ------------
    Chikki
    when things gets harder ,the harder gets going

  4. #4
    Super Member
    Join Date
    Dec 2005
    Location
    USA
    Posts
    1,407
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: allow and disable popups blocker

    any idea tarun!.. please throw some light on which direction i need to go.
    ------------
    Chikki
    when things gets harder ,the harder gets going

  5. #5
    Super Member
    Join Date
    Dec 2005
    Location
    USA
    Posts
    1,407
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: allow and disable popups blocker

    I found the solution in the below post.

    http://www.sqaforums.com/showflat.php?Number=466459
    ------------
    Chikki
    when things gets harder ,the harder gets going

  6. #6
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: allow and disable popups blocker

    The issue with your code was

    Const HKEY_CURRENT_USER ="&amp;H80000001"

    should be

    Const HKEY_CURRENT_USER =&amp;H80000001

    Also in services.msc

    "Windows Management Instrumentation" service should be started

  7. #7
    Super Member
    Join Date
    Dec 2005
    Location
    USA
    Posts
    1,407
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: allow and disable popups blocker

    thanks tarun, this forum is awesome. always helps at times of needs.
    ------------
    Chikki
    when things gets harder ,the harder gets going

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 03:51 AM.

Copyright BetaSoft Inc.