Click() public method

Click the link.
public Click ( ) : void
return void
Exemplo n.º 1
0
        public void TestMultipleForms_WhenBadAspId()
        {
            WebFormTester form1 = new WebFormTester("badId", Browser);
            LinkButtonTester one = new LinkButtonTester("one", form1);

            Browser.GetPage(TestUrl);
            one.Click();
        }
Exemplo n.º 2
0
		public void TestGoToPage2ViaLinkButton() 
		{ 
			// First, instantiate "Tester" objects: 
			ButtonTester buttonLogin = new ButtonTester("ButtonLogin", CurrentWebForm); 
			LinkButtonTester link = new LinkButtonTester("LinkToPage2", CurrentWebForm); 
			LabelTester labelTester = new LabelTester("LabelPreviousView", CurrentWebForm);

			// Second, visit the page being tested: 
			Browser.GetPage("http://localhost/Castle.MVC.Test.Web/Views/index.aspx"); 
			string loginPage = this.Browser.CurrentUrl.AbsoluteUri.ToString();

			link.Click(); 
			string currentPage = this.Browser.CurrentUrl.AbsoluteUri.ToString();
			Assert(currentPage, loginPage != currentPage);
			AssertEquals("index", labelTester.Text); 
		} 
Exemplo n.º 3
0
        public void TestSubmit_WhenMultipleForms()
        {
            LabelTester submitted = new LabelTester("submitted", form1);
            Assert.AreEqual("none", submitted.Text);

            LinkButtonTester one = new LinkButtonTester("one", form1);
            one.Click();
            Assert.AreEqual("form 1", submitted.Text);

            form2.Submit();
            Assert.AreEqual("form 2", submitted.Text);

            new WebFormTester("RedirectForm", Browser).Submit();
            AssertRedirected();
        }