5 Replies Latest reply on Jan 20, 2015 9:35 AM by Dan Egner

    evaluating "Browser-Driven Web Monitoring Functions" return values



      Wondering if anyone can help us out? We are attempting to walk a website via AJAX. We would like future "Browserclick" functions to stop executing (I.E. stop the script) if something in the script fails. For instance, We are walking an eCommerce solution we do not want to attempt to "checkout" if we are unable to "Add something to the cart"


      I noticed in the "Browser-driven Web Monitoring Functions" section of the TMART workbench help that each of the functions returns a value. For instance (Below) :


      My question is: How can we evaluate the "return value" after a Browser click(or other function) so that we may do X if true or Y if the function returns false


      For instance:

      BrowserClick("//INPUT[@id='autoquote:e-mail']", BUTTON_Left);

      if return value = False

           Stop script




      Or is there another approach that achieves similar results? 




      BrowserClick( uTestObject : in union, nButton     : in number optional, sTimer      : in string optional ): boolean;
      Parameter Description
      uTestObject Either a locator that identifies the DOM element or a handle to a previously found DOM element. Throws an error if an invalid handle is used or if the locator cannot be resolved.
      nButton Optional: The mouse button with which the DOM element is to be clicked. Specify BUTTON_LEFT to use the left mouse button (default), or BUTTON_RIGHT to use the right mouse button.
      sTimer Optional: Name of the timer used for page measurements. If this parameter is omitted, no measurements are performed.


      Return value

      • true if successful 
      • false otherwise 

      Browser-Driven Web Monitoring Functions