/// <summary> /// This selects a frame on a page such as the SSO widget to access the inner elements /// </summary> /// <param name="frameid">the frame string such as "gauth-widget-frame"</param> public void SelectFrame(string frameid) { counter++; try { selenium.SelectFrame(frameid); test.passedcheck++; } catch// (Exception) { test.failedcheck++; ErrorReport(frameid, CheckType.Window); } }
/// <summary> /// Uploads a file using the maual/browse option /// </summary> /// <param name="quality">instance of qualitycheck</param> /// <param name="filepath">where the file is located</param> /// <param name="gotodetails">if you want the method to go to the file details</param> public void UploadFile(string filepath) { System.IO.FileStream stream; try { stream = new FileStream(filepath, FileMode.Open); } catch { MessageBox.Show(filepath + " was not found on this computer. Process will not continue and fail without it."); } if (true) { quality.Click("link=Upload"); selenium.WaitForPageToLoad("30000"); Thread.Sleep(3000); quality.Click("link=Manual Upload"); Thread.Sleep(5000); selenium.SelectFrame("browseComputerElementContents"); quality.Type("id=data", filepath); Thread.Sleep(1000); //selenium.AttachFile("id=data", filepath); quality.Click("id=uploadFromFileButton"); selenium.WaitForPageToLoad("30000"); //Thread.Sleep(10000); quality.Click("link=View details"); selenium.WaitForPageToLoad("30000"); quality.IsTextPresent("Untitled"); selenium.Refresh(); } }