Blog to understand automation concepts in QTP, Selenium Webdriver and Manual Testing concepts

VBScript Code to close the IE browsers and Internet Explorer not responding window


  • VBScript Code to close the IE browsers and Internet Explorer not responding window

Set WShell = CreateObject("WScript.Shell")
''This will close all the instances of task iexplore.exe.
''Parameter /f kills the process forcefully
WShell.Exec("taskkill /fi ""imagename eq iexplore.exe"" /f")
WScript.Sleep 100
''At time Internet explorer is not responding error is displayed
''The task has window title as internet explorer not responding.
''We can close the task based on window title with regular expression as Internet *
WShell.Exec("taskkill /fi ""WINDOWTITLE eq Internet*"" /f")
WScript.Sleep 100
''Once the window is closed, another window appear with similar title
'' which needs to be closed
WShell.Exec("taskkill /fi ""WINDOWTITLE eq Internet*"" /f")

  • VBScript Code to save the list of running tasks and save it in file abc.txt


''Below command will return the service for the process and save it in file abc.txt
  Set WShell = CreateObject("WScript.Shell")
''This will close all the instances of task iexplore.exe.
''Parameter /f kills the process forcefully
WShell.Exec("tasklist /fi /svc>test.txt")

ReConnecting to Remote sessions using group policy edit

In QTP/UFT automation suite execution,we may require to connect remotely to multiple machines through remote desktop connection for monitoring test execution, We may face issue in remote connection being disconnected due to network issues/remote sessions. 


ReConnecting to Remote sessions using group policy edit
To allow smooth test execution, we should reconnect to the remote sessions in case of any network disconnect. In this post, I will share what we can do to reconnect remote connection in case of session disconnect due to network issues and failures.

  • Using experience in Remote Desktop Connection

    • Go to Run>mstsc
    • In Remote Desktop connection window, Go to Experience Panel.
    • Select checkbox "Reconnect if the connection is dropped"
By default, a maximum  of twenty reconnection attempts are made at five second intervals.


  • Defining Group policy for Remote Desktop connection

    • Navigate to group policy for the machine

      • Navigate to run> gpedit.msc
      • Local group Policy editor Window is displayed.
      • Click on Administrative Templates\Windows Components\Remote desktop Services\Remote Desktop Session Host\Connections
ReConnecting to Remote sessions using group policy edit

  • Policy Settings

ReConnecting to Remote sessions using group policy edit

    • Automatic Reconnection- If policy setting is enabled, automatic reconnection is attempted for all clients running Remote Desktop Connection whenever their network connection is lost.
    • Configure keep-alive connection interval - This policy setting allows you to enter a keep-alive interval to ensure that the session state on the RD Session Host server is consistent with the client state. If you enable this policy setting, you must enter a keep-alive interval. The keep-alive interval determines how often, in minutes, the server checks the session state. The range of values you can enter is 1 to 999,999.