Loading ...
Sorry, an error occurred while loading the content.

Help for Launch Application

Expand Messages
  • aparna73
    Hi all, I am trying to launch an QTP from the perl code, using win32- GuiTest. It s launches but not focusing? Please tell what s wrong with my code. use
    Message 1 of 3 , May 3 1:04 PM
    • 0 Attachment
      Hi all,
      I am trying to launch an QTP from the perl code, using win32-
      GuiTest. It's launches but not focusing? Please tell what's wrong
      with my code.

      use Win32::GuiTest qw(:ALL);
      system ("C:\\Program Files\\Mercury Interactive\\QuickTest
      Professional\\bin\\QtPro.exe");

      my @windows = FindWindowLike (0,"^QuickTest Professional- Add-in
      Manager");
      $win32::GuiTest::debug = 1;
      print @windows;
      for(@windows){
      $title = GetWindowsText($_);
      if($title = "QuickTest Professional - Add-in Manager"){
      SetForegroundWindow($_);
      Win32::GuiTest::SetFocus("^QuickTest Professional - Add-in
      Manager");
      SendKeys("{Enter}");
      }
      }
    • pkaluski
      Hi, SetFocus expects window handle not a window caption -Piotr
      Message 2 of 3 , May 3 1:45 PM
      • 0 Attachment
        Hi,
        SetFocus expects window handle not a window caption
        -Piotr


        --- In perlguitest@yahoogroups.com, "aparna73" <aparnashastry@h...> wrote:
        > Hi all,
        > I am trying to launch an QTP from the perl code, using win32-
        > GuiTest. It's launches but not focusing? Please tell what's wrong
        > with my code.
        >
        > use Win32::GuiTest qw(:ALL);
        > system ("C:\\Program Files\\Mercury Interactive\\QuickTest
        > Professional\\bin\\QtPro.exe");
        >
        > my @windows = FindWindowLike (0,"^QuickTest Professional- Add-in
        > Manager");
        > $win32::GuiTest::debug = 1;
        > print @windows;
        > for(@windows){
        > $title = GetWindowsText($_);
        > if($title = "QuickTest Professional - Add-in Manager"){
        > SetForegroundWindow($_);
        > Win32::GuiTest::SetFocus("^QuickTest Professional - Add-in
        > Manager");
        > SendKeys("{Enter}");
        > }
        > }
      • Dennis K. Paulsen
        Also, you ll want to use GetWindowText instead of GetWindowsText, as the latter doesn t exist. ... wrong
        Message 3 of 3 , May 4 9:53 AM
        • 0 Attachment
          Also, you'll want to use GetWindowText instead of GetWindowsText, as
          the latter doesn't exist.


          --- In perlguitest@yahoogroups.com, "pkaluski" <pkaluski@p...> wrote:
          > Hi,
          > SetFocus expects window handle not a window caption
          > -Piotr
          >
          >
          > --- In perlguitest@yahoogroups.com, "aparna73"
          <aparnashastry@h...> wrote:
          > > Hi all,
          > > I am trying to launch an QTP from the perl code, using win32-
          > > GuiTest. It's launches but not focusing? Please tell what's
          wrong
          > > with my code.
          > >
          > > use Win32::GuiTest qw(:ALL);
          > > system ("C:\\Program Files\\Mercury Interactive\\QuickTest
          > > Professional\\bin\\QtPro.exe");
          > >
          > > my @windows = FindWindowLike (0,"^QuickTest Professional- Add-in
          > > Manager");
          > > $win32::GuiTest::debug = 1;
          > > print @windows;
          > > for(@windows){
          > > $title = GetWindowsText($_);
          > > if($title = "QuickTest Professional - Add-in Manager"){
          > > SetForegroundWindow($_);
          > > Win32::GuiTest::SetFocus("^QuickTest Professional - Add-in
          > > Manager");
          > > SendKeys("{Enter}");
          > > }
          > > }
        Your message has been successfully submitted and would be delivered to recipients shortly.