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"); }); }
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"); }); }
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(); }
public By SelectByDataUi(string selector) => SelectBy.CssSelector($"[data-ui='{selector}']");