コード例 #1
0
 public void First()
 {
     RunInAllBrowsers(browser =>
     {
         browser.NavigateToUrl("TemporarySelector.aspx");
         browser.SelectMethod = s => SelectBy.CssSelector(s, "[data-ui='{0}']");
         AssertUI.CheckIfTextEquals(browser.First("p", By.TagName), "p");
         AssertUI.CheckIfTextEquals(browser.First("id", By.Id), "id");
         AssertUI.CheckIfTextEquals(browser.First("id"), "data");
     });
 }
コード例 #2
0
 public void ElementSelection_First_SelectBy()
 {
     this.RunInAllBrowsers(browser =>
     {
         browser.NavigateToUrl("/test/TemporarySelector");
         browser.SelectMethod = s => SelectBy.CssSelector(s, "[data-ui='{0}']");
         browser.First("p", By.TagName).CheckIfTextEquals("p");
         browser.First("id", By.Id).CheckIfTextEquals("id");
         browser.First("id").CheckIfTextEquals("data");
     });
 }
コード例 #3
0
        private static void UploadFileByA(IElementWrapper element, string fullFileName)
        {
            element.BrowserWrapper.GetJavaScriptExecutor()
            .ExecuteScript("dotvvm.fileUpload.createUploadId(arguments[0])", element.WebElement);

            var iframe = element.ParentElement.ParentElement.First("iframe", SelectBy.CssSelector).WebElement;

            element.BrowserWrapper.Driver.SwitchTo().Frame(iframe);

            var fileInput = element.BrowserWrapper._GetInternalWebDriver()
                            .FindElement(SelectBy.CssSelector("input[type=file]"));

            fileInput.SendKeys(fullFileName);

            element.Wait(element.ActionWaitTime);
            element.ActivateScope();
        }
コード例 #4
0
 public By SelectByDataUi(string selector)
 => SelectBy.CssSelector($"[data-ui='{selector}']");