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

Re: How to click on a button

Expand Messages
  • mkjain15
    Thank you Lee !!! Cheers!!! Manish HELP EVER,HURT NEVER ... to interact with dialog box
    Message 1 of 4 , Aug 21, 2006
    • 0 Attachment
      Thank you Lee !!!

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


      --- In perlguitest@yahoogroups.com, Lee Marlin <lmarlin@...> wrote:
      >
      > Here are two solutions that DO work
      >
      >
      > one is via Win32::GuiTest; the other is with Win32::IEAutomation
      >
      > after you start IE and enter http://www.google.com,
      > do a View -> Source
      > it's actually javascript so that "button" is not what it seems
      >
      > =========================
      > use Win32::OLE;
      > use Win32::GuiTest qw(:ALL :SW);
      > my $URL = "http://www.google.com";
      > my $IE = Win32::OLE->new("InternetExplorer.Application")
      > || die "Could not start Internet Explorer.Application\n";
      > $IE->{visible} = 1;
      > $IE->Navigate($URL);
      >
      > sleep 5;
      > SendKeys("Perl");
      > SendKeys ("{TAB}");
      > sleep 1;
      > SendKeys("{ENTER}");
      >
      > # PushButton ("Google Search");
      >
      > ===============================================================
      > 2nd alternative
      > ===============================================================
      > use Win32;
      > # These modules are available from CPAN
      > use Win32::IEAutomation;
      > use Win32::IEAutomation::WinClicker; # this will provide methods
      to interact with dialog box
      >
      > my $ie = Win32::IEAutomation->new( );
      > $ie->gotoURL('http://www.google.com');
      > my $clicker = Win32::IEAutomation::WinClicker->new();
      > $ie->{visible} = 1;
      > $variable ="Perl";
      > $ie->getTextBox('name:', "q")->SetValue($variable);
      > $ie->getButton('caption:',"Google Search")->Click();
      >
      > Lee Marlin
      >
      > mkjain15 <mkjain76@...> wrote:
      > Hi All,
      >
      > I have a query as following:
      >
      > 1: Want to invoke Interner explorer
      > 2: Then navigate to www.google.com
      > 3: Enter any text say "perl" in search text area,
      > 4: Click on google search button;
      >
      > I am able to invoke the IE and able to navigate to www.google.com
      > page.
      > But not able enter a text and click on "Google Search" Button.
      >
      > use Win32::OLE;
      > use Win32::GuiTest qw(:ALL);
      > my $URL = "www.google.com";
      > my $IE = Win32::OLE->new("InternetExplorer.Application")
      > || die "Could not start Internet Explorer.Application\n";
      >
      > $IE->{visible} = 1;
      >
      > $IE->Navigate($URL);
      >
      > sleep 5;
      > PushButton "^Google Search"
      >
      > Please advise me any solution.
      >
      > Thanks in advance,
      >
      > Cheers!!!
      > Manish
      > "HELP EVER, HURT NEVER"
      >
      >
      >
      >
      >
      >
      > ---------------------------------
      > Do you Yahoo!?
      > Everyone is raving about the all-new Yahoo! Mail Beta.
      >
      > [Non-text portions of this message have been removed]
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.