Thread

Posted on Mon Aug 8 21:13:59 2005 by volksman
Examples?
Hey All! New to IE-Mechanize. Just installed and started playing with it today. Are there any good examples of code in use doing various tasks? For example I have it calling a page with a form, populating the form and submitting. But then I'm stuck. How do I tell it to populate a form on the next page that is loaded after the initial form? Any help/examples/posts-that-read-"RTFM"-with-links-included would be very much appreciated. :)
Direct Responses: 855 | Write a response
Posted on Tue Aug 9 00:15:29 2005 by abeltje in response to 853
Re: Examples?
Hi,

Manpages are here http://search.cpan.org/dist/Win32-IE-Mechanize/lib/Win32/IE/Mechanize.pm and they can also be accessed with perldoc Win32::IE::Mechanize on your own system.

HTH
-- Abe.
Direct Responses: 856 | Write a response
Posted on Tue Aug 9 00:19:48 2005 by volksman in response to 855
Re: Examples?
Yeah I already read through all that jazz...I was really just looking for snipets of code. In my playing today I have been able to follow_links and then fill out a form and submit it...but it's weird I can use set_fields on some forms and others I have to set_visible to get them to populate. I know its me but I want to see how others get things accomplished with this mod....
Direct Responses: 857 | Write a response
Posted on Tue Aug 9 00:50:34 2005 by abeltje in response to 856
Re: Examples?
Ah, okay; sorry
For functional testing I mostly use follow_link() and submit_form() (these are also the methods I use for automating tasks).
As I try to keep the interface as close to WWW::Mechanize as possiblbe, you might find digging there useful.
Sorry I cannot offer you more help.
-- Abe.
Direct Responses: 865 | Write a response
Posted on Wed Aug 10 00:24:16 2005 by volksman in response to 857
Re: Examples?
Hey Abe! I'm trying for the life of me why the form I can reference by name can't be filled out. I've tried to fill out the form with:
$ie->set_fields( dsn => 'dsn', database => 'database', user => 'user'); or $ie->set_visible( 'dsn', 'database', 'user');
But it dies on the last one....If I remove 'user' from being set the form fills in nicely. With it though it generates an error regarding:
Win32::OLE(0.1403) error 0x80070005: "Access is denied" in METHOD/PROPERTYGET "all" at C:/Perl/site/lib/Win32/IE/Form.pm line 150 Can't call method "tagName" on an undefined value at C:/Perl/site/lib/Win32/IE/F orm.pm line 150.
So I'm wondering if there is a way to spit out what the module sees as input field names so I can see if the script just isn't getting the right info or if it's HTML issues on the page or something...I'm grasping at straws at this point.... Any help would be appreciated.
Direct Responses: 866 | Write a response
Posted on Wed Aug 10 01:02:23 2005 by abeltje in response to 865
Re: Examples?
Hi,

dieing is *not* good!
I see room for improvement in that part of Win32::IE::Form::inputs(), but it looks like there is something fishy with the form.
Can you isolate the form from the page and reproduce the problem with it? If so can you send both the html and a small test program that shows this behaviour to http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Win32::IE::Mechanize (just so it is on the record).

TIA,
-- Abe.
Direct Responses: 869 | Write a response
Posted on Wed Aug 10 18:49:31 2005 by volksman in response to 866
Re: Examples?
In isolating the form I realized that it isn't w3 compliant. How important is that to IE::Mechanize? It is missing the </form> tag to close the form. I'm going to run some tests on it isolated and see what that turns up.
Write a response