Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not able to record qtp from vb.NET
#1
Solved: 11 Years, 4 Months, 3 Weeks ago
Hi,

I am creating an application using vb.net which will launch and start recording qtp.

code snippet is below

Code:
qtpApp = CreateObject("QuickTest.Application")

            qtpApp.Launch()
            qtpApp.Visible = False

            'qtpApp.WindowState = "Minimized"
            qtpApp.ActivateView("ExpertView")
            qtpApp.Visible = False

            ' qtpApp.New()

            WScript.Sleep(1000)

            qtpApp.ActivateView("ExpertView")
            'qtApp.Visible = True
            WshShell = CreateObject("Wscript.Shell")
            WScript.Sleep(10000)
            qtpApp.Visible = True
            qtpApp.WindowState = "Maximized"
            WScript.Sleep(500)
            WshShell.SendKeys("{F3}")
            WScript.Sleep(100)
            WshShell.SendKeys("{enter}")

            qtpApp.WindowState = "Minimized"
            qtpApp.Visible = False

            WScript.Sleep(800)

            _blQTPLaunched = True

It is launching qtp, but sendkey is not working. What am i doing wrong here?
Reply
#2
Solved: 11 Years, 4 Months, 3 Weeks ago
Try using this:
Code:
Set qtpApp = CreateObject("QuickTest.Application")
qtpApp.Launch()
qtpApp.Visible = False
'qtpApp.WindowState = "Minimized"
qtpApp.ActivateView("ExpertView")
qtpApp.Visible = False
' qtpApp.New()
WScript.Sleep(1000)
qtpApp.ActivateView("ExpertView")
'qtApp.Visible = True
Set WshShell = CreateObject("Wscript.Shell")
WScript.Sleep(10000)
qtpApp.Visible = True
qtpApp.WindowState = "Maximized"
WScript.Sleep(500)
WshShell.SendKeys("{F3}")
WScript.Sleep(100)
WshShell.SendKeys("{enter}")
qtpApp.WindowState = "Minimized"
qtpApp.Visible = False
WScript.Sleep(800)
Reply
#3
Solved: 11 Years, 4 Months, 3 Weeks ago
Ans:

Hi,

You have missed Set Keyword i,e
Code:
Set WshShell = CreateObject("Wscript.Shell")
should be used.

Thanks
Reply
#4
Solved: 11 Years, 4 Months, 3 Weeks ago
Thanks for the reply

It says Let and Set are no longer supported. I am developing WPF application in Visual studio 2010.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  QTP 11.0 does not record web application shipu 6 7,337 08-03-2014, 01:47 AM
Last Post: riverdiego
  QTP does not record anything on a page developed using AJAX shayk1985 2 2,365 05-21-2014, 04:56 AM
Last Post: shayk1985
  Handling .NET framework menu in webpage using QTP 10 vishnu1067 0 2,350 05-15-2014, 05:30 PM
Last Post: vishnu1067
  QTP 9.0 supports WPF based .NET desktop application. nagarajkv 1 2,684 02-27-2014, 03:48 PM
Last Post: hiregoudar
  QTP Automation testing steps for .net web applications? Ramadas 0 2,546 10-30-2013, 12:54 PM
Last Post: Ramadas

Forum Jump:


Users browsing this thread: 1 Guest(s)