


We can do this by two ways, which ever is needed for our project. We also need to provide implementation for the events. Now firstly we have to initialize 'EventFiringWebDriver' by passing webdriver instance and then we need to register event listener for EventFiringWebDriver instance. Let us now look into example by taking the help of class " EventFiringWebDriver" - which is a wrapper around an arbitrary WebDriver instance which supports registering of a WebDriverEventListener for logging purposes. We can also when ever there is an exception using 'onException'. When ever we develop test scripts we can write our own implementation for handling events during the execution.įor example, we can count the number of clicks that we have performed in the script by adding logic to count clicks after each click 'afterClickOn'.

Selenium webdriver has ability to track different events such as 'beforeNavigateTo', 'afterNavigateTo', 'beforeClickOn', 'afterClickOn', 'onException' and so on. It also plays an important role in analyzing results and helps us in debugging issues if we encounter any. Render a set of data console.Webdriver events are helpful to view the events triggered by webdriver. Compile the source code const compiledFunction = pug. - template.pug p #'s Pug source code! const pug = require( 'pug') The compiled function can be re-used, and called with different sets of data. Call that resultant function with your data, and voilà!, it will return a string of HTML rendered with your data.

pug.compile() will compile the Pug source code into a JavaScript function that takes a data object (called “ locals”) as an argument. The general rendering process of Pug is simple. Pug is available via npm: $ npm install pug Sponsors coin news Getting Started Installation ¶
