KIASohc has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, Good day to all of you. This is my very first post here. I am new to Perl and my coding background is a bit limited. I am trying to automate a checking of a page to verify that users are able to login successfully and click on objects within the page after logging in. So far, I was successfull in automating the user login using Win32::IEAutomation. I was able to make Perl identify the objects in the login page and login eventually. The problem I am encountering is after login where Perl is unable to identify the objects in the main page. Objects like Tabs, links and text boxes. I already tried using $ie->getLink, $ie->getTextBox and $ie_getImage but Perl is not able to identify the objects. Please note that I also used these same methods for my login page and it worked. Please see below a snippet of the login code which is working...

if ($userlabel = $ie->getTextBox ('aftertext:', "User Name:")) { $ie->getTextBox ('aftertext:', "User Name:")->SetValue("USER1"); print MYFILE "PASSED\n"; } else{ print MYFILE "FAILED\n"; print "\n"; }

Below is a snippet of the code which needs to identify a tab labeled as "TAB1" and click on it. But it's not working...

if ($TAB1 = $ie->getLink('linktext:', "TAB1")) { print MYFILE "PASSED\n"; } else{ print MYFILE "FAILED\n"; }

I am quite confused why a similar code is working for the login page but is not working on the main page. I even tried using the $ie->getImage method thinking that the object is an image but was still unable to identify it. Hope you could shed some light on this as I am stuck at this point. Thanks in advance and have a great day Monks!

Replies are listed 'Best First'.
Re: Perl code is unable to identify Page objects (Win32 OLE IEXPLORER IEAutomation )
by Anonymous Monk on Jan 21, 2014 at 04:13 UTC

    All Win32::IEAutomation does is add a little sugar to Win32::OLE for ... for getting the internetexplorer object, and gettig the internetexplorer document object model

    all the interesting documentation is on msdn, so start at Re: Win32::IEAutomation click link help and follow deep