Не удалось запустить тест автоматизации в Windows 10 Edge, похоже, что селектор jquery не работает

Я пытаюсь запустить свои тесты автоматизации на краю Windows 10, и на данный момент он не может создать элемент jquery и вернуть элемент, чтобы я мог выполнять над ним некоторые действия (например, отправить ключи или щелкнуть по нему и т. д.) ниже это некоторый образец потока моего теста. в основном мы проверяем, существует ли Jquery или нет, если мы не вводим http://code.jquery.com/jquery-1.10.1.min.js из последнего блока кода, который я включил сюда.

if (localDriver.Equals("internetexplorer"))
                    {                  

                       EdgeOptions options = new EdgeOptions();
                        options.PageLoadStrategy = EdgePageLoadStrategy.Eager;
                        driver = new EdgeDriver("C:\\Program Files (x86)\\Microsoft Web Driver", options);
                        driver.Url = UrlHelper.HomeUrl;
                        driver.Navigate().GoToUrl("javascript:document.getElementById('overridelink').click()");
                    }
 this._context.Driver.Manage().Window.Maximize();
if (this.DeleteAllCookies)                            this._context.Driver.Manage().Cookies.DeleteAllCookies();
driver.UserNameTextField.Clear(); --- this statement has to use below statement and create the web element
 internal WebControl TicketIdTextField { get { return this.CreateControl("#TicketId"); } }
 #region Create Control
        public WebControl CreateControl(string jQuerySelector)
        {
            return this.CreateControl<WebControl>(jQuerySelector);
        }

        public T CreateControl<T>(string jQuerySelector) where T : WebControl
        {
            return this.CreateControl<T>(WebControl.SearchNames.JQuerySelector, jQuerySelector);
        }

        public new T CreateControl<T>(params string[] nameValuePairs) where T : WebControl
        {
            return base.CreateControl<T>(nameValuePairs);
        }

        public new T CreateControl<T>(IEnumerable<SearchProperty> searchProperties) where T : WebControl
        {
            return base.CreateControl<T>(searchProperties);
        }
        #endregion

 #region Create Control
        public T CreateControl<T>(params string[] nameValuePairs) where T : Control
        {
            if ((nameValuePairs.Length % 2) != 0)
            {
                throw new ArgumentException("CreateControl needs to have even number of pairs. (Mod 2)", "nameValuePairs");
            }
            var searchProperties = new List<SearchProperty>();
            for (int i = 0; i < nameValuePairs.Length; i = (int)(i + 2))
            {
                searchProperties.Add(new SearchProperty(nameValuePairs[i], nameValuePairs[i + 1]));
            }

            return this.CreateControl<T>(searchProperties);
        }
public virtual T CreateControl<T>(IEnumerable<SearchProperty> searchProperties) where T : Control
        {
            var control = Control.CreateInstance<T>(this.Context, this);
            control.SearchProperties.AddRange(searchProperties);
            return control;
        }
        #endregion

  #region RawControl
        private object _rawControl;

        public object RawControl
        {
            get
            {
                /* Always Search Feature
                 * --------------------- 
                 * 
                 * If there is a property in the search properties 
                 * set for "Always Search" then it must always call this.Find()
                 * 
                 * If the global property is set for always search, then 
                 * it must call this.Find()
                 * 
                 */

                var alwaysSearch = this.SearchProperties.Any(x => x.Name == Control.SearchNames.AlwaysSearch);
                if (this._rawControl == null || (this._isHightlighting == false && (Playback.AlwaysSearch || alwaysSearch)))
                {
                    this.Find();
                }

                return this._rawControl;
            }
        } 

public object ExecuteScript(string script, params object[] args)
        {
            var javaScriptExecutor = (IJavaScriptExecutor)this.Driver;

            if(CheckjQueryExists)
            {
                var timeout = TimeSpan.FromSeconds(60);
                var timeoutThreshold = DateTime.UtcNow.Add(timeout);

                var isJQueryUndefined = new Func<bool>(() => (bool)javaScriptExecutor.ExecuteScript("return (typeof $ === 'undefined')"));
                if (isJQueryUndefined())
                {
                    javaScriptExecutor.ExecuteScript(@"
                        var scheme =  window.location.protocol;
                        if(scheme != 'https:')
                            scheme = 'http:';

                        var script = document.createElement('script');
                        script.type = 'text/javascript';
                        script.src = scheme + '//code.jquery.com/jquery-1.10.1.min.js'; 
                        document.getElementsByTagName('head')[0].appendChild(script);
                    ");

                    while (isJQueryUndefined())
                    {
                        System.Threading.Thread.Sleep(200);

                        //Don't test forever.. bomb out after a bit.
                        if (DateTime.UtcNow > timeoutThreshold)
                            throw new TimeoutException(string.Format("Checking jQuery exists timed out after {0} seconds.", timeout.TotalSeconds));
                    }
                }
            }

            return javaScriptExecutor.ExecuteScript(script, args);
        }
driver.username="someuser";

person user3401353    schedule 26.09.2015    source источник
comment
какой у Вас вопрос   -  person Patrick    schedule 28.09.2015
comment
Возможный дубликат Браузер Webdriver MS Edge не получает URL-адрес   -  person Paul Sweatte    schedule 31.08.2016