public SyncWebElement FindElementByIdEndsWithOrDefault(string id)
        {
            SyncWebElement res  = null;
            var            mRes = new ManualResetEventSlim(true);

            mRes.Reset();
            Exception exception = null;

            Task.Run(async() =>
            {
                try
                {
                    var r = await AsyncElement.FindElementByIdEndsWithOrDefault(id).ConfigureAwait(false);
                    if (r is AsyncWebElement)
                    {
                        res = new SyncWebElement(r as AsyncWebElement);
                    }
                }
                catch (Exception ex)
                {
                    exception = ex;
                }

                mRes.Set();
            }

                     );
            mRes.Wait();
            if (exception != null)
            {
                throw exception;
            }
            return(res);
        }
        protected SyncWebElement FindElement(string mechanism, string value)
        {
            SyncWebElement res  = null;
            var            mRes = new ManualResetEventSlim(true);

            mRes.Reset();
            Exception exception = null;

            Task.Run(async() =>
            {
                try
                {
                    var r = await AsyncElement.FindElement(mechanism, value).ConfigureAwait(false);
                    if (r is AsyncWebElement)
                    {
                        res = new SyncWebElement(r as AsyncWebElement);
                    }
                }
                catch (Exception ex)
                {
                    exception = ex;
                }

                mRes.Set();
            }

                     );
            mRes.Wait();
            if (exception != null)
            {
                throw exception;
            }
            return(res);
        }
        //public SyncRemoteTargetLocator(ITargetLocator targetLocator)
        //{
        //    this.targetLocator = targetLocator;
        //}
        public SyncWebElement ActiveElement()
        {
            SyncWebElement res  = null;
            var            mRes = new ManualResetEventSlim(true);

            mRes.Reset();
            Exception exception = null;

            Task.Run(async() =>
            {
                try
                {
                    var r = await locator.ActiveElement().ConfigureAwait(false);
                    if (r is AsyncWebElement)
                    {
                        res = new SyncWebElement(r as AsyncWebElement);
                    }
                }
                catch (Exception ex)
                {
                    exception = ex;
                }

                mRes.Set();
            }

                     );
            mRes.Wait();
            if (exception != null)
            {
                throw exception;
            }
            return(res);
        }
        public SyncWebDriver Frame(SyncWebElement frameElement)
        {
            SyncWebDriver res  = null;
            var           mRes = new ManualResetEventSlim(true);

            mRes.Reset();
            Exception exception = null;

            Task.Run(async() =>
            {
                try
                {
                    var r = await locator.Frame(frameElement.AsyncElement).ConfigureAwait(false);
                    if (r is WebDriver)
                    {
                        res = new SyncWebDriver(r as WebDriver);
                    }
                }
                catch (Exception ex)
                {
                    exception = ex;
                }

                mRes.Set();
            }

                     );
            mRes.Wait();
            if (exception != null)
            {
                throw exception;
            }
            return(res);
        }
        protected SyncWebElement FindElement(string mechanism, string value)
        {
            SyncWebElement res  = null;
            var            mRes = new ManualResetEventSlim(true);

            mRes.Reset();
            Task.Run(async() =>
            {
                var r = await AsyncElement.FindElement(mechanism, value);
                if (r is AsyncWebElement)
                {
                    res = new SyncWebElement(r as AsyncWebElement);
                }
                mRes.Set();
            });
            mRes.Wait();
            return(res);
        }
        public SyncWebElement FindElementByCssSelector(string cssSelector)
        {
            SyncWebElement res  = null;
            var            mRes = new ManualResetEventSlim(true);

            mRes.Reset();
            Task.Run(async() =>
            {
                var r = await AsyncElement.FindElementByCssSelector(cssSelector);
                if (r is AsyncWebElement)
                {
                    res = new SyncWebElement(r as AsyncWebElement);
                }
                mRes.Set();
            });
            mRes.Wait();
            return(res);
        }
        public SyncWebElement FindElementByPartialLinkText(string partialLinkText)
        {
            SyncWebElement res  = null;
            var            mRes = new ManualResetEventSlim(true);

            mRes.Reset();
            Task.Run(async() =>
            {
                var r = await AsyncElement.FindElementByPartialLinkText(partialLinkText);
                if (r is AsyncWebElement)
                {
                    res = new SyncWebElement(r as AsyncWebElement);
                }
                mRes.Set();
            });
            mRes.Wait();
            return(res);
        }
        public SyncWebElement FindElementByIdStartsWith(string id)
        {
            SyncWebElement res  = null;
            var            mRes = new ManualResetEventSlim(true);

            mRes.Reset();
            Task.Run(async() =>
            {
                var r = await AsyncElement.FindElementByIdStartsWith(id);
                if (r is AsyncWebElement)
                {
                    res = new SyncWebElement(r as AsyncWebElement);
                }
                mRes.Set();
            });
            mRes.Wait();
            return(res);
        }
        public SyncWebElement ActiveElement()
        {
            SyncWebElement res  = null;
            var            mRes = new ManualResetEventSlim(true);

            mRes.Reset();
            Task.Run(async() =>
            {
                var r = await locator.ActiveElement();
                if (r is AsyncWebElement)
                {
                    res = new SyncWebElement(r as AsyncWebElement);
                }
                mRes.Set();
            });
            mRes.Wait();
            return(res);
        }
        public SyncWebElement FindElement(By by)
        {
            SyncWebElement res  = null;
            var            mRes = new ManualResetEventSlim(true);

            mRes.Reset();
            Task.Run(async() =>
            {
                var r = await AsyncElement.FindElement(by).ConfigureAwait(false);
                if (r is AsyncWebElement)
                {
                    res = new SyncWebElement(r as AsyncWebElement);
                }
                mRes.Set();
            }

                     );
            mRes.Wait();
            return(res);
        }