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!


In reply to Perl code is unable to identify Page objects by KIASohc

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.