/***
         * Sets a dynaTrace Marker on the current timestamp
         * @param marker
         */

        public override void addMark(String marker)
        {
            try
            {
                if (marker != null)
                {
                    defaultSelenium.RunScript("try { _dt_addMark('" + marker + "') } catch(e) { }");
                }
            }
            catch (Selenium.SeleniumException)
            {
                // The exception "Current window or frame is closed!" can happen.
                // If this exception occurs, the js-call might have happened too soon (before selenium.open() was called).
                // In these cases the timer will get set as soon as selenium.open() gets called, as we override this
                // method and send the timer name with each url.
                if (--failedJSAttempts == 0)
                {
                    dynaTraceAgentActive = false;
                    Console.WriteLine("dynaTrace Browser Agent not active!");
                }
            }
        }