コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: Default.aspx.cs プロジェクト: Fillah/Titan
        protected void Page_Load(object sender, EventArgs e)
        {
            string value = DropDownProfession.SelectedValue.ToString();

            if (value == "0")
            {
                LabelSpots.Visible = false;
            }
            else
            {
                LabelSpots.Visible = true;
                LabelSpots.Text    = value + " spot(s) left";
            }

            if (!IsPostBack)
            {
                //DO NOTHING
            }

            else
            {
                ButtonSubmit.Focus();
                Page.MaintainScrollPositionOnPostBack = true;
            }

            Page.LoadComplete += new EventHandler(Page_LoadComplete);
        }
コード例 #3
0
 public void Login(string email, string passwd)
 {
     TxtEmail.SendKeys(email);
     TxtPassword.SendKeys(passwd);
     ButtonSubmit.Click();
 }
        void ReleaseDesignerOutlets()
        {
            if (ButtonSubmit != null)
            {
                ButtonSubmit.Dispose();
                ButtonSubmit = null;
            }

            if (LabelEighth != null)
            {
                LabelEighth.Dispose();
                LabelEighth = null;
            }

            if (LabelFifth != null)
            {
                LabelFifth.Dispose();
                LabelFifth = null;
            }

            if (LabelFirst != null)
            {
                LabelFirst.Dispose();
                LabelFirst = null;
            }

            if (LabelFourth != null)
            {
                LabelFourth.Dispose();
                LabelFourth = null;
            }

            if (LabelMessage != null)
            {
                LabelMessage.Dispose();
                LabelMessage = null;
            }

            if (LabelSecond != null)
            {
                LabelSecond.Dispose();
                LabelSecond = null;
            }

            if (LabelSeventh != null)
            {
                LabelSeventh.Dispose();
                LabelSeventh = null;
            }

            if (LabelSixth != null)
            {
                LabelSixth.Dispose();
                LabelSixth = null;
            }

            if (LabelThird != null)
            {
                LabelThird.Dispose();
                LabelThird = null;
            }

            if (TextFieldEighth != null)
            {
                TextFieldEighth.Dispose();
                TextFieldEighth = null;
            }

            if (TextFieldFifth != null)
            {
                TextFieldFifth.Dispose();
                TextFieldFifth = null;
            }

            if (TextFieldFirst != null)
            {
                TextFieldFirst.Dispose();
                TextFieldFirst = null;
            }

            if (TextFieldFourth != null)
            {
                TextFieldFourth.Dispose();
                TextFieldFourth = null;
            }

            if (TextFieldSecond != null)
            {
                TextFieldSecond.Dispose();
                TextFieldSecond = null;
            }

            if (TextFieldSeventh != null)
            {
                TextFieldSeventh.Dispose();
                TextFieldSeventh = null;
            }

            if (TextFieldSixth != null)
            {
                TextFieldSixth.Dispose();
                TextFieldSixth = null;
            }

            if (TextFieldThird != null)
            {
                TextFieldThird.Dispose();
                TextFieldThird = null;
            }
        }