Forum Discussion

royd's avatar
royd
Regular Contributor
6 years ago
Solved

aqObject.CheckProperty, url - cmpContains troubles!

Hi everyone

 

I am trying to verify patr of the url with the following -

 

aqObject.CheckProperty(Browsers.Item(Project.Variables.webBrowser).Window(0), "URL", cmpContains, "Login.aspx");

... but I am getting "TypeError: Browsers.Item(...).Window is not a function" error. I am probably making some silly mistake, but have no clue what that would be!

Help is deeply appreciated.

 

Dave

  • royd's avatar
    royd
    6 years ago

    Hi Alex

     

    Figured it out, hope this helps anyone in my situation. Following works -

     

    aqObject.CheckProperty(Sys.Browser(Project.Variables.webBrowser).Page("*"), "url", cmpContains, "Login.aspx");

     

5 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi Dave,

     

    What is the value of the Project.Variables.webBrowser variable?

     

    • royd's avatar
      royd
      Regular Contributor

      Hi Alex, currently it is iexplore.

       

      I should also mention that I have defined Project Variable 'url' as well.

       

      Thanks.

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Dave,

     

    I think that the problem occurs because Browsers.Item() returns a BrowserInfo object that does not contain the .Window property while it is the Process object that contains the .Window property.

    So you need to find the most suitable way for you of how to match the returned BrowserInfo object to the correct Process one.

     

    • royd's avatar
      royd
      Regular Contributor

      Hi Alex

       

      Figured it out, hope this helps anyone in my situation. Following works -

       

      aqObject.CheckProperty(Sys.Browser(Project.Variables.webBrowser).Page("*"), "url", cmpContains, "Login.aspx");

       

    • royd's avatar
      royd
      Regular Contributor

      Thanks, Alex, I will keep trying and let you know if I can make it work.

       

      Dave