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

Is it possible to click on a button based on button's name in the UI?

Expand Messages
  • kumar21yash
    Hi, im trying to click on a button called Go. i could able do this with the following code... use Win32::GuiTest qw ( :ALL); use warnings; use strict; system
    Message 1 of 6 , Oct 6, 2006
      Hi,
      im trying to click on a button called Go. i could able do this with
      the following code...

      use Win32::GuiTest qw ( :ALL);
      use warnings;

      use strict;
      system "start http://www.Mynewplace.com";
      sleep(1);
      my @mnp = FindWindowLike(undef,'MyNewPlace');

      if (!@mnp)
      {
      die "cann't open the mynewplace page\n";
      }
      else
      {
      printf ("Mynewplace handle control id is %x\n ", $mnp[0]);
      }

      SetForegroundWindow($mnp[0]);

      MouseMoveAbsPix(480,300);
      SendKeys( 'New york');
      SendMouse("{LeftClick}");

      *******is there any other way to click on Go button?

      *******and also after clicking Go button i want my code to wait for
      sometime so that it uploads all the images...etc....

      Thanks...
      yash
    • kumar21yash
      Take a screen shot and paste it in the mspaint. Point the Button or anything using mouse and find the co ordinates in the progress bar....... But we need to
      Message 2 of 6 , Oct 12, 2006
        Take a screen shot and paste it in the mspaint.
        Point the Button or anything using mouse and find the co ordinates
        in the progress bar.......

        But we need to find a general solution for this.......

        KEep posting......

        Thanks......
        Yash....










        --- In perlguitest@yahoogroups.com, "kumar21yash" <kumar21yash@...>
        wrote:
        >
        > Hi,
        > im trying to click on a button called Go. i could able do this
        with
        > the following code...
        >
        > use Win32::GuiTest qw ( :ALL);
        > use warnings;
        >
        > use strict;
        > system "start http://www.Mynewplace.com";
        > sleep(1);
        > my @mnp = FindWindowLike(undef,'MyNewPlace');
        >
        > if (!@mnp)
        > {
        > die "cann't open the mynewplace page\n";
        > }
        > else
        > {
        > printf ("Mynewplace handle control id is %x\n ", $mnp[0]);
        > }
        >
        > SetForegroundWindow($mnp[0]);
        >
        > MouseMoveAbsPix(480,300);
        > SendKeys( 'New york');
        > SendMouse("{LeftClick}");
        >
        > *******is there any other way to click on Go button?
        >
        > *******and also after clicking Go button i want my code to wait
        for
        > sometime so that it uploads all the images...etc....
        >
        > Thanks...
        > yash
        >
      • baiyang1
        Just use sendkeys function. That is OK? #!/usr/bin/perl -w use Win32::GuiTest qw ( :ALL); use warnings; use strict; system start http://www.Mynewplace.com ;
        Message 3 of 6 , Oct 13, 2006
          Just use sendkeys function. That is OK?

          #!/usr/bin/perl -w
          use Win32::GuiTest qw ( :ALL);
          use warnings;

          use strict;
          system "start http://www.Mynewplace.com";
          sleep(1);
          my @mnp = FindWindowLike(undef,'MyNewPlace');

          if (!@mnp)
          {
          die "cann't open the mynewplace page\n";
          }
          else
          {
          printf ("Mynewplace handle control id is %x\n ", $mnp[0]);
          }

          SetForegroundWindow($mnp[0]);

          #MouseMoveAbsPix(480,300);
          SendKeys( 'New york');
          SendKeys( "{TAB}~");
          sleep 10; # "10" is the time you want waiting for loading image,and
          you can change it.
          #SendMouse("{LeftClick}");


          --- In perlguitest@yahoogroups.com, "kumar21yash" <kumar21yash@...>
          wrote:
          >
          > Hi,
          > im trying to click on a button called Go. i could able do this with
          > the following code...
          >
          > use Win32::GuiTest qw ( :ALL);
          > use warnings;
          >
          > use strict;
          > system "start http://www.Mynewplace.com";
          > sleep(1);
          > my @mnp = FindWindowLike(undef,'MyNewPlace');
          >
          > if (!@mnp)
          > {
          > die "cann't open the mynewplace page\n";
          > }
          > else
          > {
          > printf ("Mynewplace handle control id is %x\n ", $mnp[0]);
          > }
          >
          > SetForegroundWindow($mnp[0]);
          >
          > MouseMoveAbsPix(480,300);
          > SendKeys( 'New york');
          > SendMouse("{LeftClick}");
          >
          > *******is there any other way to click on Go button?
          >
          > *******and also after clicking Go button i want my code to wait for
          > sometime so that it uploads all the images...etc....
          >
          > Thanks...
          > yash
          >
        • baiyang1
          Is it your want? #!/usr/bin/perl -w use Win32::GuiTest qw ( :ALL); use warnings; use strict; system start http://www.Mynewplace.com ; sleep(1); my @mnp =
          Message 4 of 6 , Oct 13, 2006
            Is it your want?

            #!/usr/bin/perl -w
            use Win32::GuiTest qw ( :ALL);
            use warnings;

            use strict;
            system "start http://www.Mynewplace.com";
            sleep(1);
            my @mnp = FindWindowLike(undef,'MyNewPlace');

            if (!@mnp)
            {
            die "cann't open the mynewplace page\n";
            }
            else
            {
            printf ("Mynewplace handle control id is %x\n ", $mnp[0]);
            }

            SetForegroundWindow($mnp[0]);

            #MouseMoveAbsPix(480,300);
            SendKeys( 'New york');
            SendKeys( "{TAB}~");
            sleep 10; # "10" is the time you want waiting for loading image,and
            you can change it.
            #SendMouse("{LeftClick}");

            --- In perlguitest@yahoogroups.com, "kumar21yash" <kumar21yash@...>
            wrote:
            >
            > Take a screen shot and paste it in the mspaint.
            > Point the Button or anything using mouse and find the co ordinates
            > in the progress bar.......
            >
            > But we need to find a general solution for this.......
            >
            > KEep posting......
            >
            > Thanks......
            > Yash....
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            > --- In perlguitest@yahoogroups.com, "kumar21yash" <kumar21yash@>
            > wrote:
            > >
            > > Hi,
            > > im trying to click on a button called Go. i could able do this
            > with
            > > the following code...
            > >
            > > use Win32::GuiTest qw ( :ALL);
            > > use warnings;
            > >
            > > use strict;
            > > system "start http://www.Mynewplace.com";
            > > sleep(1);
            > > my @mnp = FindWindowLike(undef,'MyNewPlace');
            > >
            > > if (!@mnp)
            > > {
            > > die "cann't open the mynewplace page\n";
            > > }
            > > else
            > > {
            > > printf ("Mynewplace handle control id is %x\n ", $mnp[0]);
            > > }
            > >
            > > SetForegroundWindow($mnp[0]);
            > >
            > > MouseMoveAbsPix(480,300);
            > > SendKeys( 'New york');
            > > SendMouse("{LeftClick}");
            > >
            > > *******is there any other way to click on Go button?
            > >
            > > *******and also after clicking Go button i want my code to wait
            > for
            > > sometime so that it uploads all the images...etc....
            > >
            > > Thanks...
            > > yash
            > >
            >
          • swayam_fly
            Hi , is there any way if u can capture the control id of Go button and send a mouse click to that button ???if this is possible then we don t have to give the
            Message 5 of 6 , Oct 16, 2006
              Hi ,

              is there any way if u can capture the control id of Go
              button and send a mouse click to that button ???if this is possible
              then we don't have to give the X, Y co-ordinate or {TAB} directly
              by knowing the control id we can send our command .

              Thanks
              Swayam



              --- In perlguitest@yahoogroups.com, "baiyang1" <baiyang1@...> wrote:
              >
              > Is it your want?
              >
              > #!/usr/bin/perl -w
              > use Win32::GuiTest qw ( :ALL);
              > use warnings;
              >
              > use strict;
              > system "start http://www.Mynewplace.com";
              > sleep(1);
              > my @mnp = FindWindowLike(undef,'MyNewPlace');
              >
              > if (!@mnp)
              > {
              > die "cann't open the mynewplace page\n";
              > }
              > else
              > {
              > printf ("Mynewplace handle control id is %x\n ", $mnp[0]);
              > }
              >
              > SetForegroundWindow($mnp[0]);
              >
              > #MouseMoveAbsPix(480,300);
              > SendKeys( 'New york');
              > SendKeys( "{TAB}~");
              > sleep 10; # "10" is the time you want waiting for loading
              image,and
              > you can change it.
              > #SendMouse("{LeftClick}");
              >
              > --- In perlguitest@yahoogroups.com, "kumar21yash" <kumar21yash@>
              > wrote:
              > >
              > > Take a screen shot and paste it in the mspaint.
              > > Point the Button or anything using mouse and find the co
              ordinates
              > > in the progress bar.......
              > >
              > > But we need to find a general solution for this.......
              > >
              > > KEep posting......
              > >
              > > Thanks......
              > > Yash....
              > >
              > >
              > >
              > >
              > >
              > >
              > >
              > >
              > >
              > >
              > > --- In perlguitest@yahoogroups.com, "kumar21yash" <kumar21yash@>
              > > wrote:
              > > >
              > > > Hi,
              > > > im trying to click on a button called Go. i could able do this
              > > with
              > > > the following code...
              > > >
              > > > use Win32::GuiTest qw ( :ALL);
              > > > use warnings;
              > > >
              > > > use strict;
              > > > system "start http://www.Mynewplace.com";
              > > > sleep(1);
              > > > my @mnp = FindWindowLike(undef,'MyNewPlace');
              > > >
              > > > if (!@mnp)
              > > > {
              > > > die "cann't open the mynewplace page\n";
              > > > }
              > > > else
              > > > {
              > > > printf ("Mynewplace handle control id is %x\n ", $mnp[0]);
              > > > }
              > > >
              > > > SetForegroundWindow($mnp[0]);
              > > >
              > > > MouseMoveAbsPix(480,300);
              > > > SendKeys( 'New york');
              > > > SendMouse("{LeftClick}");
              > > >
              > > > *******is there any other way to click on Go button?
              > > >
              > > > *******and also after clicking Go button i want my code to
              wait
              > > for
              > > > sometime so that it uploads all the images...etc....
              > > >
              > > > Thanks...
              > > > yash
              > > >
              > >
              >
            • yaswanth kumar
              Hi nice to ur reply... may be ur not clear about what i wanted... let me give an example.. i have search screen with buttons.....go....clear....enter.....some
              Message 6 of 6 , Oct 16, 2006
                Hi nice to ur reply...
                may be ur not clear about what i wanted...
                let me give an example..
                i have search screen with buttons.....go....clear....enter.....some buttons.....etc...
                now i want to click on enter button without using tab functionality.....
                Hope ur clear now....
                Please let me know........if u have a solution...
                thanks....

                baiyang1 <baiyang1@...> wrote:
                Is it your want?

                #!/usr/bin/perl -w
                use Win32::GuiTest qw ( :ALL);
                use warnings;

                use strict;
                system "start http://www.Mynewplace.com";
                sleep(1);
                my @mnp = FindWindowLike(undef,'MyNewPlace');

                if (!@mnp)
                {
                die "cann't open the mynewplace page\n";
                }
                else
                {
                printf ("Mynewplace handle control id is %x\n ", $mnp[0]);
                }

                SetForegroundWindow($mnp[0]);

                #MouseMoveAbsPix(480,300);
                SendKeys( 'New york');
                SendKeys( "{TAB}~");
                sleep 10; # "10" is the time you want waiting for loading image,and
                you can change it.
                #SendMouse("{LeftClick}");

                --- In perlguitest@yahoogroups.com, "kumar21yash" <kumar21yash@...>
                wrote:
                >
                > Take a screen shot and paste it in the mspaint.
                > Point the Button or anything using mouse and find the co ordinates
                > in the progress bar.......
                >
                > But we need to find a general solution for this.......
                >
                > KEep posting......
                >
                > Thanks......
                > Yash....
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                > --- In perlguitest@yahoogroups.com, "kumar21yash" <kumar21yash@>
                > wrote:
                > >
                > > Hi,
                > > im trying to click on a button called Go. i could able do this
                > with
                > > the following code...
                > >
                > > use Win32::GuiTest qw ( :ALL);
                > > use warnings;
                > >
                > > use strict;
                > > system "start http://www.Mynewplace.com";
                > > sleep(1);
                > > my @mnp = FindWindowLike(undef,'MyNewPlace');
                > >
                > > if (!@mnp)
                > > {
                > > die "cann't open the mynewplace page\n";
                > > }
                > > else
                > > {
                > > printf ("Mynewplace handle control id is %x\n ", $mnp[0]);
                > > }
                > >
                > > SetForegroundWindow($mnp[0]);
                > >
                > > MouseMoveAbsPix(480,300);
                > > SendKeys( 'New york');
                > > SendMouse("{LeftClick}");
                > >
                > > *******is there any other way to click on Go button?
                > >
                > > *******and also after clicking Go button i want my code to wait
                > for
                > > sometime so that it uploads all the images...etc....
                > >
                > > Thanks...
                > > yash
                > >
                >






                Yaswanth Kumar T


                ---------------------------------
                Find out what India is talking about on - Yahoo! Answers India
                Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW

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