Ejemplo n.º 1
0
        public void Intercept(IInvocation invocation)
        {
            if (isSetLast(invocation))
            {
                DoOnMethodsRequiringToSetLastAction(invocation.Method.Name, invocation.Arguments);
            }

            dataExchangeEntryHelper.ResetStartTime();

            try
            {
                invocation.Proceed();

                object returnedValue = invocation.ReturnValue;
                invocation.ReturnValue = EUEElementProxifier.proxifyIfRequired(returnedValue, driver, dataExchangeEntryHelper, conf);
            } catch (Exception e)
            {
                if (isOnException(invocation) || isAlwaysSent(invocation))
                {
                    dataExchangeEntryHelper.SendEntryThrow(WebDrivers.GetURL(driver), WebDrivers.GetTitle(driver), wrapIfRequired(e), invocation.Method.Name, WebDrivers.GetAdvancedValues(driver, conf));
                }
                throw e;
            }

            if (isAlwaysSent(invocation))
            {
                dataExchangeEntryHelper.SendEntry(WebDrivers.GetURL(driver), WebDrivers.GetTitle(driver), invocation.Method.Name, WebDrivers.GetAdvancedValues(driver, conf));
            }
        }