/* PICTURE */ public IWebDriver Picture(IWebDriver webDriver, Utilities utils, UserData usrData, ref int passCount, ref int failCount) { string imagePath = Directory.GetCurrentDirectory() + "\\assets\\dot.jpg"; string imgText = "Blue.jpg"; utils.RandomPause(1.5); webDriver.FindElement(By.CssSelector("li.cc-user-widget")).Click(); utils.RandomPause(1.2); webDriver.FindElement(By.ClassName("cc-image-uploader-save-btn")).Click(); utils.RandomPause(1.2); webDriver.FindElement(By.CssSelector(".cc-file-input-container > label:nth-child(2)")).Click(); utils.RandomPause(1); AutoItX.WinWaitActive("Open"); AutoItX.ControlGetFocus("Open", "Edit1"); AutoItX.Send("Blue.jpg"); AutoItX.ControlGetFocus("Open", "Button1"); // Button1 AutoItX.Send("{ENTER}"); return(webDriver); }
public IWebDriver UploadAFile(IWebDriver webDriver, Utilities utils, UserData usrData, ref int passCount, ref int failCount) { string fileTooBeeUpLoaded = "FuzzyBunny.zip"; string XP = "//*[@id='app-content']/div/div/div/div[2]/div[1]/div[2]/ul/li/button"; // Open the upload test webDriver.FindElement(By.XPath(XP)).Click(); // Browse to file utils.RandomPause(); XP = "//*[@id='app-content']/div/div/div[2]/div/div/div/div[3]"; webDriver.FindElement(By.XPath(XP)).Click(); AutoItX.WinWaitActive("Open"); AutoItX.ControlGetFocus("Open", "Edit1"); AutoItX.Send(fileTooBeeUpLoaded); AutoItX.ControlGetFocus("Open", "Button1"); // Button1 AutoItX.Send("{ENTER}"); // Save return(webDriver); }
public string ControlGetFocus(string title = "", string text = "", int maxLen = 65535) { return(AutoItX.ControlGetFocus(title = "", text = "", maxLen)); }
public string ControlGetFocus(IntPtr winHandle, int maxLen = 65535) { return(AutoItX.ControlGetFocus(thiswindowHandle, maxLen)); }