Skip to main content

Posts

Showing posts with the label STF

Automatic JS error detection with STF and WebDriver

If you followed my post on Catching java script errors with WebDriver then you already know how browser console logs can be used to catch javascript errors. But a problem which surfaces is that javascript error check has to be added on each test step where java script error check is to be done. This would result in lots of boilerplate code. A better approach would be to automate this check. This is what STF 4.0.14 does. It introduces CustomEventListener class which catches SEVERE errors on browser console. But before delving into CustomEventListener , let’s understand two classes available from webdriver API - EventFiringWebDriver EventFiringWebDriver implements WebDriver interface besides other interfaces. It supports registering WebDriverEventListener which can be used for logging purpose. For example get() method to open application URL looks as following in EventFiringWebDriver - public void get(String url) { dispatcher .beforeNavigateTo(url, driver ); d...

Marionette Web driver and STF

If you were also stuck with Firefox 47 and Selenium 2.53 issue then this is right time to start experimenting with Marionette.   But Before delving into Marionette, let’s see what a web browser engine is. Web browser engine is a program which renders markup content (i.e. html, xml, images etc) and the format information (i.e. css, xsl etc). It is also known as layout or rendering engine. In simple words, web browser engine is responsible for how you are able to see a web page in a browser, email client or e-book reader. Some of the most popular web browser engines are - Webkit which is used in safari and chrome browsers Gecko used in Firefox, Thunderbird email client Marionette is WebDriver version for Mozilla’s Gecko engine. It can control both the browser (menu, function etc) also known as chrome (don’t confuse with google chrome browser ;-)) and the content within the browser (something which is of immense value for test automation). Marionette also follow...