Class WebDriverLogEnricher

  • All Implemented Interfaces:
    org.openqa.selenium.support.events.WebDriverEventListener

    public class WebDriverLogEnricher
    extends Object
    implements org.openqa.selenium.support.events.WebDriverEventListener
    Fetches logs from the WebDriver (server) and attaches them to the current (client) log.

    logTypes can be configured in justtestlah.properties:

    e.g. additionalLogTypes=server,logcat

    For Appium, this requires the server to be started with `appium --relaxed-security`.

    • Constructor Detail

      • WebDriverLogEnricher

        public WebDriverLogEnricher()
    • Method Detail

      • beforeAlertAccept

        public void beforeAlertAccept​(org.openqa.selenium.WebDriver driver)
        Specified by:
        beforeAlertAccept in interface org.openqa.selenium.support.events.WebDriverEventListener
      • afterAlertAccept

        public void afterAlertAccept​(org.openqa.selenium.WebDriver driver)
        Specified by:
        afterAlertAccept in interface org.openqa.selenium.support.events.WebDriverEventListener
      • afterAlertDismiss

        public void afterAlertDismiss​(org.openqa.selenium.WebDriver driver)
        Specified by:
        afterAlertDismiss in interface org.openqa.selenium.support.events.WebDriverEventListener
      • beforeAlertDismiss

        public void beforeAlertDismiss​(org.openqa.selenium.WebDriver driver)
        Specified by:
        beforeAlertDismiss in interface org.openqa.selenium.support.events.WebDriverEventListener
      • beforeNavigateTo

        public void beforeNavigateTo​(String url,
                                     org.openqa.selenium.WebDriver driver)
        Specified by:
        beforeNavigateTo in interface org.openqa.selenium.support.events.WebDriverEventListener
      • afterNavigateTo

        public void afterNavigateTo​(String url,
                                    org.openqa.selenium.WebDriver driver)
        Specified by:
        afterNavigateTo in interface org.openqa.selenium.support.events.WebDriverEventListener
      • beforeNavigateBack

        public void beforeNavigateBack​(org.openqa.selenium.WebDriver driver)
        Specified by:
        beforeNavigateBack in interface org.openqa.selenium.support.events.WebDriverEventListener
      • afterNavigateBack

        public void afterNavigateBack​(org.openqa.selenium.WebDriver driver)
        Specified by:
        afterNavigateBack in interface org.openqa.selenium.support.events.WebDriverEventListener
      • beforeNavigateForward

        public void beforeNavigateForward​(org.openqa.selenium.WebDriver driver)
        Specified by:
        beforeNavigateForward in interface org.openqa.selenium.support.events.WebDriverEventListener
      • afterNavigateForward

        public void afterNavigateForward​(org.openqa.selenium.WebDriver driver)
        Specified by:
        afterNavigateForward in interface org.openqa.selenium.support.events.WebDriverEventListener
      • beforeNavigateRefresh

        public void beforeNavigateRefresh​(org.openqa.selenium.WebDriver driver)
        Specified by:
        beforeNavigateRefresh in interface org.openqa.selenium.support.events.WebDriverEventListener
      • afterNavigateRefresh

        public void afterNavigateRefresh​(org.openqa.selenium.WebDriver driver)
        Specified by:
        afterNavigateRefresh in interface org.openqa.selenium.support.events.WebDriverEventListener
      • beforeFindBy

        public void beforeFindBy​(org.openqa.selenium.By by,
                                 org.openqa.selenium.WebElement element,
                                 org.openqa.selenium.WebDriver driver)
        Specified by:
        beforeFindBy in interface org.openqa.selenium.support.events.WebDriverEventListener
      • afterFindBy

        public void afterFindBy​(org.openqa.selenium.By by,
                                org.openqa.selenium.WebElement element,
                                org.openqa.selenium.WebDriver driver)
        Specified by:
        afterFindBy in interface org.openqa.selenium.support.events.WebDriverEventListener
      • beforeClickOn

        public void beforeClickOn​(org.openqa.selenium.WebElement element,
                                  org.openqa.selenium.WebDriver driver)
        Specified by:
        beforeClickOn in interface org.openqa.selenium.support.events.WebDriverEventListener
      • afterClickOn

        public void afterClickOn​(org.openqa.selenium.WebElement element,
                                 org.openqa.selenium.WebDriver driver)
        Specified by:
        afterClickOn in interface org.openqa.selenium.support.events.WebDriverEventListener
      • beforeChangeValueOf

        public void beforeChangeValueOf​(org.openqa.selenium.WebElement element,
                                        org.openqa.selenium.WebDriver driver,
                                        CharSequence[] keysToSend)
        Specified by:
        beforeChangeValueOf in interface org.openqa.selenium.support.events.WebDriverEventListener
      • afterChangeValueOf

        public void afterChangeValueOf​(org.openqa.selenium.WebElement element,
                                       org.openqa.selenium.WebDriver driver,
                                       CharSequence[] keysToSend)
        Specified by:
        afterChangeValueOf in interface org.openqa.selenium.support.events.WebDriverEventListener
      • beforeScript

        public void beforeScript​(String script,
                                 org.openqa.selenium.WebDriver driver)
        Specified by:
        beforeScript in interface org.openqa.selenium.support.events.WebDriverEventListener
      • afterScript

        public void afterScript​(String script,
                                org.openqa.selenium.WebDriver driver)
        Specified by:
        afterScript in interface org.openqa.selenium.support.events.WebDriverEventListener
      • beforeSwitchToWindow

        public void beforeSwitchToWindow​(String windowName,
                                         org.openqa.selenium.WebDriver driver)
        Specified by:
        beforeSwitchToWindow in interface org.openqa.selenium.support.events.WebDriverEventListener
      • afterSwitchToWindow

        public void afterSwitchToWindow​(String windowName,
                                        org.openqa.selenium.WebDriver driver)
        Specified by:
        afterSwitchToWindow in interface org.openqa.selenium.support.events.WebDriverEventListener
      • onException

        public void onException​(Throwable throwable,
                                org.openqa.selenium.WebDriver driver)
        Specified by:
        onException in interface org.openqa.selenium.support.events.WebDriverEventListener
      • beforeGetScreenshotAs

        public <X> void beforeGetScreenshotAs​(org.openqa.selenium.OutputType<X> target)
        Specified by:
        beforeGetScreenshotAs in interface org.openqa.selenium.support.events.WebDriverEventListener
      • afterGetScreenshotAs

        public <X> void afterGetScreenshotAs​(org.openqa.selenium.OutputType<X> target,
                                             X screenshot)
        Specified by:
        afterGetScreenshotAs in interface org.openqa.selenium.support.events.WebDriverEventListener
      • beforeGetText

        public void beforeGetText​(org.openqa.selenium.WebElement element,
                                  org.openqa.selenium.WebDriver driver)
        Specified by:
        beforeGetText in interface org.openqa.selenium.support.events.WebDriverEventListener
      • afterGetText

        public void afterGetText​(org.openqa.selenium.WebElement element,
                                 org.openqa.selenium.WebDriver driver,
                                 String text)
        Specified by:
        afterGetText in interface org.openqa.selenium.support.events.WebDriverEventListener