Search code examples
c#seleniumframeworksnunithybrid

Can we control the [Setup] method execution before [Test] Method Execution in Selenium N unit


Am just wondering how to solve this. I need to automate my company website. There I need to navigate more than one url for a multiple web pages. I have designed Hybrid framework along with Page object Model Design.

My Requirement is, say I have 3 url's :

www.google.com
www.yahoo.com
Facebook

All the above url and its test data I will keep in an Excel sheet. I have created three different pages and three different test classes. So my list of questions are:

  1. How to pass url's one by one to [setup] method
  2. how to call the test method deepening upon the url type

Execution Flow need to implement of Application:


Solution

  • Storing URL in excel is not good idea,

    • You may store URL in app.config file and by using ConfigManager utility you may retrieve those URL from app.config file

    • As according to your test cases you can use URL where its needed and required