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

Not able to click on a button

Expand Messages
  • mkjain15
    Hi All; I am facing a issue with click on a button...I am able to invoke the page but not able to click on button. In view source the description about the
    Message 1 of 3 , Aug 24, 2006
    • 0 Attachment
      Hi All;

      I am facing a issue with click on a button...I am able to invoke the
      page but not able to click on button.

      In view source the description about the button is as following:
      <a href="javascript:redirect('create_user_page');">login</a>

      My code is as following:

      use Win32;
      use Win32::GuiTest qw(:ALL);
      use Win32::IEAutomation;
      use Win32::IEAutomation::WinClicker;

      my $ie = Win32::IEAutomation->new( );
      $ie->gotoURL('http://xyz.com');
      sleep 5;
      #PushButton ('login');
      $ie->getButton('caption:',"login")->Click();

      I am not able to click on login button.

      Please help me.

      Thanks in advance.

      Cheers!!!
      Manish
      "Help Ever, Hurt Never"
    • Lee Marlin
      Manish, Look at the next to the last line of the example below. Try something like this: use strict; use Win32; use Win32::GuiTest qw (:ALL :SW); use
      Message 2 of 3 , Aug 24, 2006
      • 0 Attachment
        Manish,

        Look at the next to the last line of the example below. Try something like this:

        use strict;
        use Win32;
        use Win32::GuiTest qw (:ALL :SW);

        use Win32::IEAutomation;
        use Win32::IEAutomation::WinClicker; # this will provide methods to interact with dialog box


        my $ie = Win32::IEAutomation->new();
        $ie->gotoURL('http://mail.yahoo.com/');

        my $login='YOURLOGINIDHERE';
        my $password = 'YOURPASSWORDHERE';
        my $clicker = Win32::IEAutomation::WinClicker->new();

        $ie->getSelectList('id:' , 'username');
        $ie->getTextBox('id:', 'username')->SetValue($login);

        $ie->getSelectList('id:' , 'passwd:');
        $ie->getTextBox('id:', 'passwd')->SetValue($password);
        $ie->getButton('caption:', "Sign In")-> Click();
        $ie->WaitforDone; # we will wait here for complete loading document

        Lee
        mkjain15 <mkjain76@...> wrote:
        Hi All;

        I am facing a issue with click on a button...I am able to invoke the
        page but not able to click on button.

        In view source the description about the button is as following:
        <a href="javascript:redirect('create_user_page');">login</a>

        My code is as following:

        use Win32;
        use Win32::GuiTest qw(:ALL);
        use Win32::IEAutomation;
        use Win32::IEAutomation::WinClicker;

        my $ie = Win32::IEAutomation->new( );
        $ie->gotoURL('http://xyz.com');
        sleep 5;
        #PushButton ('login');
        $ie->getButton('caption:',"login")->Click();

        I am not able to click on login button.

        Please help me.

        Thanks in advance.

        Cheers!!!
        Manish
        "Help Ever, Hurt Never"






        ---------------------------------
        Stay in the know. Pulse on the new Yahoo.com. Check it out.

        [Non-text portions of this message have been removed]
      • mkjain15
        Hi Lee, Thanks for suggestion however it didnt work. As you advised that we can do it through following way $ie- getButton( caption: , Sign In )- Click();
        Message 3 of 3 , Aug 27, 2006
        • 0 Attachment
          Hi Lee,
          Thanks for suggestion however it didnt work.
          As you advised that we can do it through following way
          $ie->getButton('caption:', "Sign In")-> Click();
          But in my code (when i do view source ) login button has been
          mentioned as follow:
          <a href="javascript:redirect('create_user_page');">login</a>

          I have already tried with
          $ie->getButton('caption:',"login")->Click();

          I am getting a doubt we are using getButton method but in code the
          button has been put as a link.

          Are we doing it right way?

          Please have a look once again and advise me.

          Cheers !!!
          Manish
          "HELP EVER, HURT NEVER"


          --- In perlguitest@yahoogroups.com, Lee Marlin <lmarlin@...> wrote:
          >
          > Manish,
          >
          > Look at the next to the last line of the example below. Try
          something like this:
          >
          > use strict;
          > use Win32;
          > use Win32::GuiTest qw (:ALL :SW);
          >
          > use Win32::IEAutomation;
          > use Win32::IEAutomation::WinClicker; # this will provide methods
          to interact with dialog box
          >
          >
          > my $ie = Win32::IEAutomation->new();
          > $ie->gotoURL('http://mail.yahoo.com/');
          >
          > my $login='YOURLOGINIDHERE';
          > my $password = 'YOURPASSWORDHERE';
          > my $clicker = Win32::IEAutomation::WinClicker->new();
          >
          > $ie->getSelectList('id:' , 'username');
          > $ie->getTextBox('id:', 'username')->SetValue($login);
          >
          > $ie->getSelectList('id:' , 'passwd:');
          > $ie->getTextBox('id:', 'passwd')->SetValue($password);
          > $ie->getButton('caption:', "Sign In")-> Click();
          > $ie->WaitforDone; # we will wait here for complete loading
          document
          >
          > Lee
          > mkjain15 <mkjain76@...> wrote:
          > Hi All;
          >
          > I am facing a issue with click on a button...I am able to invoke
          the
          > page but not able to click on button.
          >
          > In view source the description about the button is as following:
          > <a href="javascript:redirect('create_user_page');">login</a>
          >
          > My code is as following:
          >
          > use Win32;
          > use Win32::GuiTest qw(:ALL);
          > use Win32::IEAutomation;
          > use Win32::IEAutomation::WinClicker;
          >
          > my $ie = Win32::IEAutomation->new( );
          > $ie->gotoURL('http://xyz.com');
          > sleep 5;
          > #PushButton ('login');
          > $ie->getButton('caption:',"login")->Click();
          >
          > I am not able to click on login button.
          >
          > Please help me.
          >
          > Thanks in advance.
          >
          > Cheers!!!
          > Manish
          > "Help Ever, Hurt Never"
          >
          >
          >
          >
          >
          >
          > ---------------------------------
          > Stay in the know. Pulse on the new Yahoo.com. Check it out.
          >
          > [Non-text portions of this message have been removed]
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.