Forum Discussion

kevin_kapell's avatar
kevin_kapell
Frequent Contributor
7 years ago

Cannot tell when a web page is not present

Using Firefox there is a new page that is sometimes displayed during my testing. When it is present there are no problems. When it is not I need to click a link to display the page. The problem is t...
  • tristaanogre's avatar
    tristaanogre
    7 years ago

    My bad.. I'm not used to C#Script syntax...

    Should be as follows:

    function AddSomething() {
    
      var browser = Sys.Browser("*");
     
      if( browser["WaitPage"]("https://somepage.com/*",  0, 20000)["Exists"] == false)
      {
        Aliases["MyLink"]["Click"]();
      }
    
      var Mypage = browser.Page("https://someplace.com/*");
     
      Mypage .Wait();
    
      do stuff ....
    
    }