Exemplo n.º 1
0
 public void deleteCookies()
 {
     driver.UnderlyingWebDriver.Manage().Cookies.DeleteAllCookies();
     driver.Refresh();
     //searchInputText = driver.UnderlyingWebDriver.FindElement(
     // By.XPath("//div[@id='search']//input[@name='keyWords']"));
     // searchButton = driver.UnderlyingWebDriver.FindElement(
     //   By.XPath("//div[@id='search']//input[@value='search']"));
     //  wishlistLink = driver.UnderlyingWebDriver.FindElement(By.LinkText("wish list"));
     //categoryDiv = driver.UnderlyingWebDriver.FindElement(By.Id("wrapper"));
 }
Exemplo n.º 2
0
        /// <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();
            }
        }