Domanda

I'm using FireFoxDriver, C#, NUnit and Selenium.

My test method starts by going to a page and performing some actions then the user will be redirected to another page.

How to verify whether the page redirection has occured?

this.FireFoxWebDriver.Navigate().GoToUrl(url);
// performing some actions
// todo: how to verify the page url now?

Thanks,

È stato utile?

Soluzione

ah, so simple!

Assert.AreEqual(this.FireFoxWebDriver.Url, expectedRedirectUrl);

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top