public void CheckMenuChargers() { Actions actions = new Actions(Browser.GetDriver()); actions.MoveToElement(MenuAccesories.GetElement()).Build().Perform(); new WebDriverWait(Browser.GetDriver(), TimeSpan.FromSeconds(10)); actions.MoveToElement(MenuAccesories.GetElement()).MoveToElement(MenuChargers.GetElement()).Click().Build().Perform(); /* * Actions builder = new Actions(Browser.GetDriver()); * new WebDriverWait(Browser.GetDriver(), TimeSpan.FromSeconds(10)); * * Actions acc = builder.MoveToElement(MenuAccesories.GetElement()).Click() * .MoveToElement(MenuChargers.GetElement()).Click(); * * acc.Build().Perform(); * * * * /* * Actions charg = builder.MoveByOffset(200, -100).Click(); * charg.Build().Perform(); */ //Browser.NavigateTo("http://hotline.ua/mobile/zaryadnye-ustrojstva-dlya-mobilnyh-telefonov/"); }
/// <summary> /// Gets values of form fields /// </summary> /// <returns>Message model</returns> public MessageData GetDraftData() { new WebDriverWait(Browser.Browser.GetDriver(), TimeSpan.FromSeconds(Browser.Browser.TimeoutForElement)) .Until( condition => { try { var text = ((IJavaScriptExecutor)Browser.Browser.GetDriver()).ExecuteScript( "return arguments[0].value;", TopicField.GetElement()).ToString(); return(text != ""); } catch (StaleElementReferenceException) { return(false); } catch (NoSuchElementException) { return(false); } }); var topic = ((IJavaScriptExecutor)Browser.Browser.GetDriver()).ExecuteScript( "return arguments[0].value;", TopicField.GetElement()).ToString(); return(new MessageData() { To = new ElementWithLogger(new Element(By.CssSelector("div.oL.aDm.az9 span"), "to field")).GetText(), Topic = topic, Message = MessageArea.GetText() }); }
public void GoToSignInPage() { signIn.WaitForIsVisible(); signIn.GetElement().Click(); Thread.Sleep(3000); Browser.GetDriver().SwitchTo().Frame(loginFrame.GetElement()); loginTextField.WaitForIsVisible(); }
public void DragEmailToTrashBin(string subject) => new BaseElement(By.XPath(String.Format(sentEmailLblTemplate, subject))).DragAndDrop(recycleBinMenuItem.GetElement());
public void ClickSubmitButtonOnFrame() { submitButtonOnFrame.WaitForIsVisible(); submitButtonOnFrame.GetElement().Click(); Browser.GetDriver().SwitchTo().DefaultContent(); }
public void TypeLogin(string login) { loginTextField.WaitForIsVisible(); loginTextField.GetElement().SendKeys(login); }
public void TypePassword(string password) { passwordTextField.WaitForIsVisible(); passwordTextField.GetElement().SendKeys(password); }