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

Sendkeys question

Expand Messages
  • neesha1_99_99
    Hi, Following is my script. It runs the program quake3.exe but then it does not pass key enter to it. What it supposed to do is when it enters it will play
    Message 1 of 6 , Jan 19, 2004
    • 0 Attachment
      Hi,

      Following is my script. It runs the program quake3.exe but then it
      does not pass key 'enter' to it. What it supposed to do is when it
      enters it will play the game/ Am I doing anything wrong?


      use Win32::GuiTest
      chdir("C:\\Program\ Files\\Quake\ III\ Arena");
      system("quake3.exe");
      Win32::GuiTest::SetForegroundWindow("Quake 3: Arena");
      Win32::GuiTest::SendKeys("{ENTER}");
    • noel.peterson@amd.com
      Should look something like this: use Win32::GuiTest chdir( C: Program Files Quake III Arena ); system( quake3.exe ); SetForegroundWindow( Quake 3:
      Message 2 of 6 , Jan 22, 2004
      • 0 Attachment
        Should look something like this:



        use Win32::GuiTest
        chdir("C:\\Program\ Files\\Quake\ III\ Arena");
        system("quake3.exe");
        SetForegroundWindow("Quake 3: Arena");
        SendKeys("{ENTER}");





        _____

        From: neesha1_99_99 [mailto:neesha1_99_99@...]
        Sent: Monday, January 19, 2004 7:48 PM
        To: perlguitest@yahoogroups.com
        Subject: [perlguitest] Sendkeys question



        Hi,

        Following is my script. It runs the program quake3.exe but then it
        does not pass key 'enter' to it. What it supposed to do is when it
        enters it will play the game/ Am I doing anything wrong?


        use Win32::GuiTest
        chdir("C:\\Program\ Files\\Quake\ III\ Arena");
        system("quake3.exe");
        Win32::GuiTest::SetForegroundWindow("Quake 3: Arena");
        Win32::GuiTest::SendKeys("{ENTER}");






        _____

        Yahoo! Groups Links

        * To visit your group on the web, go to:
        http://groups.yahoo.com/group/perlguitest/ <http://groups.yahoo.com/group/perlguitest/>

        * To unsubscribe from this group, send an email to:
        perlguitest-unsubscribe@yahoogroups.com <mailto:perlguitest-unsubscribe@yahoogroups.com?subject=Unsubscribe>

        * Your use of Yahoo! Groups is subject to the Yahoo! <http://docs.yahoo.com/info/terms/> Terms of Service.



        [Non-text portions of this message have been removed]
      • Dennis K. Paulsen
        Hello, One other thing you might need; which is utilized throughout Win32::GuiTest s example scripts, is the use of start.exe (example below). Without this,
        Message 3 of 6 , Jan 22, 2004
        • 0 Attachment
          Hello,
          One other thing you might need; which is utilized throughout
          Win32::GuiTest's example scripts, is the use of start.exe (example
          below). Without this, the system call will not return until Quake3
          is exited.


          use Win32::GuiTest qw/
          SetForegroundWindow
          SendKeys
          /;

          chdir("C:\\Program\ Files\\Quake\ III\ Arena");
          system("start quake3.exe"); # Use start.exe to call quake3.exe
          ## Note: You might have to add a WaitWindow or sleep
          ## statement here.
          SetForegroundWindow("Quake 3: Arena");
          SendKeys("{ENTER}");


          Regards,
          Dennis K. Paulsen

          --- In perlguitest@yahoogroups.com, noel.peterson@a... wrote:
          > Should look something like this:
          >
          >
          >
          > use Win32::GuiTest
          > chdir("C:\\Program\ Files\\Quake\ III\ Arena");
          > system("quake3.exe");
          > SetForegroundWindow("Quake 3: Arena");
          > SendKeys("{ENTER}");
          >
          >
          >
          >
          >
          > _____
          >
          > From: neesha1_99_99 [mailto:neesha1_99_99@y...]
          > Sent: Monday, January 19, 2004 7:48 PM
          > To: perlguitest@yahoogroups.com
          > Subject: [perlguitest] Sendkeys question
          >
          >
          >
          > Hi,
          >
          > Following is my script. It runs the program quake3.exe but then it
          > does not pass key 'enter' to it. What it supposed to do is when it
          > enters it will play the game/ Am I doing anything wrong?
          >
          >
          > use Win32::GuiTest
          > chdir("C:\\Program\ Files\\Quake\ III\ Arena");
          > system("quake3.exe");
          > Win32::GuiTest::SetForegroundWindow("Quake 3: Arena");
          > Win32::GuiTest::SendKeys("{ENTER}");
          >
          >
          >
          >
          >
          >
          > _____
          >
          > Yahoo! Groups Links
          >
          > * To visit your group on the web, go to:
          > http://groups.yahoo.com/group/perlguitest/
          <http://groups.yahoo.com/group/perlguitest/>
          >
          > * To unsubscribe from this group, send an email to:
          > perlguitest-unsubscribe@yahoogroups.com
          <mailto:perlguitest-unsubscribe@yahoogroups.com?subject=Unsubscribe>
          >
          > * Your use of Yahoo! Groups is subject to the Yahoo!
          <http://docs.yahoo.com/info/terms/> Terms of Service.
          >
          >
          >
          > [Non-text portions of this message have been removed]
        • neesha1_99_99
          Thanks, problem was that I should be using winodow handle (get using FindWindowlike()) and not the text of window name. I figured necessity of using sleep, but
          Message 4 of 6 , Jan 23, 2004
          • 0 Attachment
            Thanks, problem was that I should be using winodow handle (get using
            FindWindowlike()) and not the text of window name.

            I figured necessity of using sleep, but have not figured why we have
            to do so? Any idea?


            --- In perlguitest@yahoogroups.com, "Dennis K. Paulsen"
            <ctrondlpaulsden@y...> wrote:
            > Hello,
            > One other thing you might need; which is utilized throughout
            > Win32::GuiTest's example scripts, is the use of start.exe (example
            > below). Without this, the system call will not return until
            Quake3
            > is exited.
            >
            >
            > use Win32::GuiTest qw/
            > SetForegroundWindow
            > SendKeys
            > /;
            >
            > chdir("C:\\Program\ Files\\Quake\ III\ Arena");
            > system("start quake3.exe"); # Use start.exe to call quake3.exe
            > ## Note: You might have to add a WaitWindow or sleep
            > ## statement here.
            > SetForegroundWindow("Quake 3: Arena");
            > SendKeys("{ENTER}");
            >
            >
            > Regards,
            > Dennis K. Paulsen
            >
            > --- In perlguitest@yahoogroups.com, noel.peterson@a... wrote:
            > > Should look something like this:
            > >
            > >
            > >
            > > use Win32::GuiTest
            > > chdir("C:\\Program\ Files\\Quake\ III\ Arena");
            > > system("quake3.exe");
            > > SetForegroundWindow("Quake 3: Arena");
            > > SendKeys("{ENTER}");
            > >
            > >
            > >
            > >
            > >
            > > _____
            > >
            > > From: neesha1_99_99 [mailto:neesha1_99_99@y...]
            > > Sent: Monday, January 19, 2004 7:48 PM
            > > To: perlguitest@yahoogroups.com
            > > Subject: [perlguitest] Sendkeys question
            > >
            > >
            > >
            > > Hi,
            > >
            > > Following is my script. It runs the program quake3.exe but then
            it
            > > does not pass key 'enter' to it. What it supposed to do is when
            it
            > > enters it will play the game/ Am I doing anything wrong?
            > >
            > >
            > > use Win32::GuiTest
            > > chdir("C:\\Program\ Files\\Quake\ III\ Arena");
            > > system("quake3.exe");
            > > Win32::GuiTest::SetForegroundWindow("Quake 3: Arena");
            > > Win32::GuiTest::SendKeys("{ENTER}");
            > >
            > >
            > >
            > >
            > >
            > >
            > > _____
            > >
            > > Yahoo! Groups Links
            > >
            > > * To visit your group on the web, go to:
            > > http://groups.yahoo.com/group/perlguitest/
            > <http://groups.yahoo.com/group/perlguitest/>
            > >
            > > * To unsubscribe from this group, send an email to:
            > > perlguitest-unsubscribe@yahoogroups.com
            > <mailto:perlguitest-unsubscribe@yahoogroups.com?
            subject=Unsubscribe>
            > >
            > > * Your use of Yahoo! Groups is subject to the Yahoo!
            > <http://docs.yahoo.com/info/terms/> Terms of Service.
            > >
            > >
            > >
            > > [Non-text portions of this message have been removed]
          • Dennis K. Paulsen
            Hello, The most common scenario is to allow time for the application (GUI) to become ready for interaction/user input. Without a WaitWindow or sleep in the
            Message 5 of 6 , Jan 26, 2004
            • 0 Attachment
              Hello,
              The most common scenario is to allow time for the application (GUI)
              to become ready for interaction/user input. Without a WaitWindow or
              sleep in the script your using, its highly possible that
              SetForegroundWindows and SendKeys will get called before the
              application is finished loading up.


              Regards,
              D

              --- In perlguitest@yahoogroups.com, "neesha1_99_99"
              <neesha1_99_99@y...> wrote:
              > Thanks, problem was that I should be using winodow handle (get
              using
              > FindWindowlike()) and not the text of window name.
              >
              > I figured necessity of using sleep, but have not figured why we
              have
              > to do so? Any idea?
              >
              >
              > --- In perlguitest@yahoogroups.com, "Dennis K. Paulsen"
              > <ctrondlpaulsden@y...> wrote:
              > > Hello,
              > > One other thing you might need; which is utilized throughout
              > > Win32::GuiTest's example scripts, is the use of start.exe
              (example
              > > below). Without this, the system call will not return until
              > Quake3
              > > is exited.
              > >
              > >
              > > use Win32::GuiTest qw/
              > > SetForegroundWindow
              > > SendKeys
              > > /;
              > >
              > > chdir("C:\\Program\ Files\\Quake\ III\ Arena");
              > > system("start quake3.exe"); # Use start.exe to call quake3.exe
              > > ## Note: You might have to add a WaitWindow or sleep
              > > ## statement here.
              > > SetForegroundWindow("Quake 3: Arena");
              > > SendKeys("{ENTER}");
              > >
              > >
              > > Regards,
              > > Dennis K. Paulsen
              > >
              > > --- In perlguitest@yahoogroups.com, noel.peterson@a... wrote:
              > > > Should look something like this:
              > > >
              > > >
              > > >
              > > > use Win32::GuiTest
              > > > chdir("C:\\Program\ Files\\Quake\ III\ Arena");
              > > > system("quake3.exe");
              > > > SetForegroundWindow("Quake 3: Arena");
              > > > SendKeys("{ENTER}");
              > > >
              > > >
              > > >
              > > >
              > > >
              > > > _____
              > > >
              > > > From: neesha1_99_99 [mailto:neesha1_99_99@y...]
              > > > Sent: Monday, January 19, 2004 7:48 PM
              > > > To: perlguitest@yahoogroups.com
              > > > Subject: [perlguitest] Sendkeys question
              > > >
              > > >
              > > >
              > > > Hi,
              > > >
              > > > Following is my script. It runs the program quake3.exe but
              then
              > it
              > > > does not pass key 'enter' to it. What it supposed to do is
              when
              > it
              > > > enters it will play the game/ Am I doing anything wrong?
              > > >
              > > >
              > > > use Win32::GuiTest
              > > > chdir("C:\\Program\ Files\\Quake\ III\ Arena");
              > > > system("quake3.exe");
              > > > Win32::GuiTest::SetForegroundWindow("Quake 3: Arena");
              > > > Win32::GuiTest::SendKeys("{ENTER}");
              > > >
              > > >
              > > >
              > > >
              > > >
              > > >
              > > > _____
              > > >
              > > > Yahoo! Groups Links
              > > >
              > > > * To visit your group on the web, go to:
              > > > http://groups.yahoo.com/group/perlguitest/
              > > <http://groups.yahoo.com/group/perlguitest/>
              > > >
              > > > * To unsubscribe from this group, send an email to:
              > > > perlguitest-unsubscribe@yahoogroups.com
              > > <mailto:perlguitest-unsubscribe@yahoogroups.com?
              > subject=Unsubscribe>
              > > >
              > > > * Your use of Yahoo! Groups is subject to the Yahoo!
              > > <http://docs.yahoo.com/info/terms/> Terms of Service.
              > > >
              > > >
              > > >
              > > > [Non-text portions of this message have been removed]
            • Rahul Chauhan
              I am not a regular user of this module but had once studied the feasibility of using this module. Its a pretty good work and very useful for automation. some
              Message 6 of 6 , Jan 27, 2004
              • 0 Attachment
                I am not a regular user of this module but had once studied the feasibility
                of using this module.
                Its a pretty good work and very useful for automation.

                some comments on the points raised in this conversation ...
                1. wrong way of starting an application from perl. Paul explained the use of
                start.I would also suggest
                a humrous mix of process module also.
                2. setting the focus on to a window. The api from windows
                does not work fine with win2000 and brings in portablility issues of the
                perl script. I recommed using
                the alt-tab sequence as the workaround. The most recent window is
                leftmost on the alt-tab
                sequence.
                3. use of waitwindow when some event takes a rather long time to complete or
                load.


                -----Original Message-----
                From: Dennis K. Paulsen [mailto:ctrondlpaulsden@...]
                Sent: Tuesday, January 27, 2004 4:02 AM
                To: perlguitest@yahoogroups.com
                Subject: [perlguitest] Re: Sendkeys question


                Hello,
                The most common scenario is to allow time for the application (GUI)
                to become ready for interaction/user input. Without a WaitWindow or
                sleep in the script your using, its highly possible that
                SetForegroundWindows and SendKeys will get called before the
                application is finished loading up.


                Regards,
                D

                --- In perlguitest@yahoogroups.com, "neesha1_99_99"
                <neesha1_99_99@y...> wrote:
                > Thanks, problem was that I should be using winodow handle (get
                using
                > FindWindowlike()) and not the text of window name.
                >
                > I figured necessity of using sleep, but have not figured why we
                have
                > to do so? Any idea?
                >
                >
                > --- In perlguitest@yahoogroups.com, "Dennis K. Paulsen"
                > <ctrondlpaulsden@y...> wrote:
                > > Hello,
                > > One other thing you might need; which is utilized throughout
                > > Win32::GuiTest's example scripts, is the use of start.exe
                (example
                > > below). Without this, the system call will not return until
                > Quake3
                > > is exited.
                > >
                > >
                > > use Win32::GuiTest qw/
                > > SetForegroundWindow
                > > SendKeys
                > > /;
                > >
                > > chdir("C:\\Program\ Files\\Quake\ III\ Arena");
                > > system("start quake3.exe"); # Use start.exe to call quake3.exe
                > > ## Note: You might have to add a WaitWindow or sleep
                > > ## statement here.
                > > SetForegroundWindow("Quake 3: Arena");
                > > SendKeys("{ENTER}");
                > >
                > >
                > > Regards,
                > > Dennis K. Paulsen
                > >
                > > --- In perlguitest@yahoogroups.com, noel.peterson@a... wrote:
                > > > Should look something like this:
                > > >
                > > >
                > > >
                > > > use Win32::GuiTest
                > > > chdir("C:\\Program\ Files\\Quake\ III\ Arena");
                > > > system("quake3.exe");
                > > > SetForegroundWindow("Quake 3: Arena");
                > > > SendKeys("{ENTER}");
                > > >
                > > >
                > > >
                > > >
                > > >
                > > > _____
                > > >
                > > > From: neesha1_99_99 [mailto:neesha1_99_99@y...]
                > > > Sent: Monday, January 19, 2004 7:48 PM
                > > > To: perlguitest@yahoogroups.com
                > > > Subject: [perlguitest] Sendkeys question
                > > >
                > > >
                > > >
                > > > Hi,
                > > >
                > > > Following is my script. It runs the program quake3.exe but
                then
                > it
                > > > does not pass key 'enter' to it. What it supposed to do is
                when
                > it
                > > > enters it will play the game/ Am I doing anything wrong?
                > > >
                > > >
                > > > use Win32::GuiTest
                > > > chdir("C:\\Program\ Files\\Quake\ III\ Arena");
                > > > system("quake3.exe");
                > > > Win32::GuiTest::SetForegroundWindow("Quake 3: Arena");
                > > > Win32::GuiTest::SendKeys("{ENTER}");
                > > >
                > > >
                > > >
                > > >
                > > >
                > > >
                > > > _____
                > > >
                > > > Yahoo! Groups Links
                > > >
                > > > * To visit your group on the web, go to:
                > > > http://groups.yahoo.com/group/perlguitest/
                <http://groups.yahoo.com/group/perlguitest/>
                > > < http://groups.yahoo.com/group/perlguitest/
                <http://groups.yahoo.com/group/perlguitest/> >
                > > >
                > > > * To unsubscribe from this group, send an email to:
                > > > perlguitest-unsubscribe@yahoogroups.com
                > > <mailto:perlguitest-unsubscribe@yahoogroups.com?
                > subject=Unsubscribe>
                > > >
                > > > * Your use of Yahoo! Groups is subject to the Yahoo!
                > > < http://docs.yahoo.com/info/terms/ <http://docs.yahoo.com/info/terms/>
                > Terms of Service.
                > > >
                > > >
                > > >
                > > > [Non-text portions of this message have been removed]



                _____

                Yahoo! Groups Links


                * To visit your group on the web, go to:
                http://groups.yahoo.com/group/perlguitest/
                <http://groups.yahoo.com/group/perlguitest/>


                * To unsubscribe from this group, send an email to:
                perlguitest-unsubscribe@yahoogroups.com
                <mailto:perlguitest-unsubscribe@yahoogroups.com?subject=Unsubscribe>


                * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
                <http://docs.yahoo.com/info/terms/> .




                **********************************************************************
                The information contained in this email and any attachments
                is likely to be confidential and legally privileged, and is for the
                intended recipient named above only. Any copying,
                dissemination, disclosure of or use of this email or its
                attachments unless authorised by us is prohibited, except
                that you may forward this email and/or attachments to a third
                party on a strict "need to know" basis.

                If you have received this email in error, please notify us
                immediately by replying to the email or by calling
                +91-80-2297030. Please then delete this email and any full
                or partial copies of it.

                You as the intended recipient must be aware and accept
                that emailis not a totally secure communications medium.

                Although we have taken all reasonable steps to make
                sure this email and any attachments are free from viruses,
                we do not (to the extent permitted by law) accept any liability
                whatsoever for any virus infection and/or compromise of
                security caused by this email and any attachment.

                No contract may be formed or documents served by you
                on or with us by this email or any attachments unless
                expressly agreed otherwise by us.

                Any views expressed in this email or attachments by
                an individual are not necessarily those of UbiNetics
                India (Private) Limited.

                **********************************************************************



                [Non-text portions of this message have been removed]
              Your message has been successfully submitted and would be delivered to recipients shortly.