public void Test6() { TFrame.Driver.Navigate().GoToUrl("https://www.ilovepdf.com/ru/word_to_pdf"); By selectorInputFile = By.XPath("//input[@type='file']"); IWebElement elementInputFile = FunctionsTests.WaitElementIsExist(TFrame.Driver, selectorInputFile, 30); elementInputFile.SendKeys(@"C:\source\repos\fdf.docx"); By selectorOutputFileName = By.XPath("//span[@class='file__info__name']"); IWebElement elementOutputFileName = FunctionsTests.WaitElementIsExistVisible(TFrame.Driver, selectorOutputFileName, 30); Assert.AreEqual(elementOutputFileName.Text, "fdf.docx"); }
public void Test8() { TFrame.Driver.Navigate().GoToUrl("https://www.smplayer.info"); By selectorIFrameBox = By.XPath("/html/body/div[4]/div[5]/div[2]/p"); IWebElement elementIFrameBox = FunctionsTests.WaitElementIsExist(TFrame.Driver, selectorIFrameBox, 60); string js = string.Format("window.scroll(0, {0});", elementIFrameBox.Location.Y); ((IJavaScriptExecutor)(TFrame.Driver)).ExecuteScript(js); By selectorIFrame = By.XPath("//iframe[@width='560']"); IWebElement elementIFrame = FunctionsTests.WaitElementIsExist(TFrame.Driver, selectorIFrame, 60); TFrame.Driver.SwitchTo().Frame(elementIFrame); By selectorVideo = By.XPath("//video[@class='video-stream html5-main-video']"); IWebElement elementVideo = FunctionsTests.WaitElementIsExist(TFrame.Driver, selectorVideo, 60); ((IJavaScriptExecutor)(TFrame.Driver)).ExecuteScript("arguments[0].click();", elementVideo); Thread.Sleep(10000); }