internal void FillTheDataAndDownload() { log.Info("Filling data on client case page"); JobtTitle.SendKeys(Helper.RandomString(10)); FirstName.SendKeys(Helper.RandomString(10)); LastName.SendKeys(Helper.RandomString(10)); EmailAddress.SendKeys(Helper.RandomString(10) + "@wp.pl"); BusinessPhone.SendKeys("435345"); CompanyName.SendKeys(Helper.RandomString(10)); new SelectElement(Country).SelectByIndex(3); CheckBox.Click(); Padlock.Click(); ButtonSubmit.Click(); String downloadPath = DownloadCustomerCase.GetAttribute("href"); string[] tokens = downloadPath.Split(new[] { "%2f" }, StringSplitOptions.None); DownloadCustomerCase.Click(); string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, tokens[tokens.Length - 1]); log.Info("Downloading file to : " + filePath); Thread.Sleep(2300); Assert.True(File.Exists(filePath)); log.Info("Deleteing file : " + tokens[tokens.Length - 1]); File.Delete(filePath); }
public void Login(string email, string passwd) { TxtEmail.SendKeys(email); TxtPassword.SendKeys(passwd); ButtonSubmit.Click(); }