Forum Discussion

nisgupta's avatar
nisgupta
Valued Contributor
7 years ago

How testcomplete handle jquery plugin notify.js

Our web application has notification implemented using jquery plugin notify.js which is customisable notification. Once can The details of the plugin can be found in  https://notifyjs.com/

 

How does TestComplete handle this ? I am not able to do object spy as they appear and then hide under notification icon and so not able to record.

 

Please update 

 

Thanks

NG

 

 

 

3 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    The primary area of TestComplete is to access UI objects and interact with them like the human user does.

    From this point of view, any jscript library is irrelevant to the test because all interaction goes through the UI that is added to web page by this or that library.

    In case it is not possible to reliably identify and interact with the UI of web page, personally I consider this to be a flaw in application's design and implementation.

    However, TestComplete also can search for the native html elements on web page using XPath/CSS selectors and use the found elements. While this obviously deviates from the principle of end user's actions emulation, sometimes this may be the only way to interact with the elements of the poorly designed web pages.

    • nisgupta's avatar
      nisgupta
      Valued Contributor

      The issue that notification come for very few seconds and go away . By the time I try to do object spy that notification panel go away.

       

      The notification panel is based jquery plugin  notify.js

       

      you can find the details https://notifyjs.com

       

      then go to the statements

      $.notify("Hello World");

       

      and click on the Hello World . you will see "Hello World notification appear on top right corner for few seconds and then it go away. How do you handle object spy in this case

       

      Thanks

      NG

       

       

      • dganov's avatar
        dganov
        Staff

        You can just disable auto hide of notifications on the web page:

         

        $.notify.defaults( { autoHide: false, clickToHide: true } )

        To do it using TestComplete call something like this:

        Sys.Browser().Page("*").contentDocument.Script.eval("$.notify.defaults( { autoHide: false, clickToHide: true } )")