I've a webpage which has 2 text boxes. When i open the webpage cursor points to the first textbox. I need to fill these two textboxes and click on submit. I've written the code, but not working. I don't know the textboxes names as its on the server controlled by the company and no access to me. I would require something like a fill a text box then do a tab fill anther text box do a tab and then click submit button. Any help?
#! /usr/local/bin/perl
use LWP::UserAgent;
use WWW::Mechanize;
my $agent = WWW::Mechanize->new(autocheck => [1]);
my $url = 'http://example.com/pages/editpage.action?pageId=197431143';
$agent->get($url);
$agent->submit_form(
fields => {
username => $username,
password => $password,
},
button => 'Log In'
);
Host
confluence.broadcom.com
is NXDOMAIN, so I am not able to verify your or my code. I think the mistake is that you picked the wrong variant ofsubmit_form
, it should look rather thus: