Forum Discussion

royd's avatar
royd
Regular Contributor
8 years ago
Solved

FindChild method error - "Object doesn't support this property or method"

 

Hallo All

 

Am accessing email from Malinator.com. Never had issues before, but this morning I am getting an error when I try the following:

var page = "https://www.mailinator.com/inbox2.jsp*";
page.FindChild("contentText", "Important Information from THC", 20).Click();

I am using TestComplete 12, IE11 and JScript. It is worth mentioning that I have checked that all my Web extensions are enabled (I had a situation here few of them were unchecked!).

 

P.S.: Just noticed that, while typing "page.FindChild("contentText", "Important Information from THC", 20).Cli ...", autocomplete is not popping up!

 

Appreciate any help.

 

Thanks

 

Dave.


  • royd wrote:

     

    Am accessing email from Malinator.com. Never had issues before, but this morning I am getting an error when I try the following:

    var page = "https://www.mailinator.com/inbox2.jsp*";
    page.FindChild("contentText", "Important Information from THC", 20).Click();

    I am using TestComplete 12, IE11 and JScript. It is worth mentioning that I have checked that all my Web extensions are enabled (I had a situation here few of them were unchecked!).

     

    P.S.: Just noticed that, while typing "page.FindChild("contentText", "Important Information from THC", 20).Cli ...", autocomplete is not popping up!


    Hi Dave,

     

    The problem is that page is a string, it should be a Page object:

    var url = "https://www.mailinator.com/inbox2.jsp*";
    var page = Sys.Browser().Page(url);
    page.FindChild("contentText", "Important Information from THC", 20).Click();

    or if using Name Mapping/Aliases:

    Aliases.browser.pageMailinator.FindChild("contentText", "Important Information from THC", 20).Click();

10 Replies

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)

    royd wrote:

     

    Am accessing email from Malinator.com. Never had issues before, but this morning I am getting an error when I try the following:

    var page = "https://www.mailinator.com/inbox2.jsp*";
    page.FindChild("contentText", "Important Information from THC", 20).Click();

    I am using TestComplete 12, IE11 and JScript. It is worth mentioning that I have checked that all my Web extensions are enabled (I had a situation here few of them were unchecked!).

     

    P.S.: Just noticed that, while typing "page.FindChild("contentText", "Important Information from THC", 20).Cli ...", autocomplete is not popping up!


    Hi Dave,

     

    The problem is that page is a string, it should be a Page object:

    var url = "https://www.mailinator.com/inbox2.jsp*";
    var page = Sys.Browser().Page(url);
    page.FindChild("contentText", "Important Information from THC", 20).Click();

    or if using Name Mapping/Aliases:

    Aliases.browser.pageMailinator.FindChild("contentText", "Important Information from THC", 20).Click();
    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      HKosova wrote:

      Hi Dave,

       

      The problem is that page is a string, it should be a Page object:

      var url = "https://www.mailinator.com/inbox2.jsp*";
      var page = Sys.Browser().Page(url);
      page.FindChild("contentText", "Important Information from THC", 20).Click();

      or if using Name Mapping/Aliases:

      Aliases.browser.pageMailinator.FindChild("contentText", "Important Information from THC", 20).Click();

      What she said... dang it, but I should have caught that... this is why she's a paid SmartBear employee and I'm not. ;)

      • royd's avatar
        royd
        Regular Contributor

        Hi Robert

         

        I am such a newb, and throw such wacky problems at you guys! Understandably, you are scratching your head trying to help me! But these are all valuable lessons learned at your (and the community at large) expense!

         

        Thank you all! :) 

    • royd's avatar
      royd
      Regular Contributor

      Thanks, Helen! Sometimes I get all these mixed up! Thank you for pointing out my mistake. 

  • shankar_r's avatar
    shankar_r
    Community Hero

    Are you able to access the page object in your code [as you mentioned in our P.S when object is not available in the screen it will not display auto complete].

     

    Please check whether page object has any object property changes in AUT.

    • royd's avatar
      royd
      Regular Contributor

      Hi Shankar

       

      I am using Mailinator, I double checked the structure of the page has not changed as far as I can tell. Besides, the only property I am using is "contentText", in Object Spy once I target the subject line, click the "Highlight" button, it does highlight.

       

      Take a look here: https://www.mailinator.com/inbox2.jsp?public_to=testing#/#public_maildirdiv

       

      and here is what I have in this example:

       

      page = https://www.mailinator.com
      
      page.FndChild("contentText", "How to Turn a Stopover in Qatar into a Bonus Vacation", 20).Click();

      Thanks

      • shankar_r's avatar
        shankar_r
        Community Hero

        Could please share the page properties in Name mapping? I'm thinking identifying page object has the issue