c# - How to pass webSite parameter to SeleniumGrid instances -


i using c#, mbunit , selenium grid , need run same scripts 3 different environments dev, qa , prod. launch 3 different remote controls in selenium grid, how can pass different website url instances? need 1 instance dev site, qa , prod.

this example using testng. in unit test file / script, you'll have looks this:

public class logintest {     private static final hub_url = "http://thegridhubserver/wd/hub";      @parameters({ "appurl" })     public void logintest(@optional("http://thetestserver/login/") final string appurl) {      // ... create remotewebdriver object / connections / capabilities here , execute test } 

to execute them in parallel, you'll need configure testng xml configuration file this:

<suite name="login test suite" parallel="tests" verbose="1" thread-count="8">      <test name="dev">         <parameter name="appurl" value="http://thedevserver/login"></parameter>         <classes>             <class name="package.to.your.test.class.logintest" />         </classes>     </test>       <test name="qa">         <parameter name="appurl" value="http://thetestserver/login"></parameter>         <classes>             <class name="package.to.your.test.class.logintest" />         </classes>     </test>     </test>       <test name="prod">         <parameter name="appurl" value="http://theprodserver/login"></parameter>         <classes>             <class name="package.to.your.test.class.logintest" />         </classes>     </test> </suite> 

then run xml file testng test, , assuming have @ least 3 webdriver client nodes capabilities match defined webdriver, these 3 tests sent hub, send them out in parallel client nodes, use different url each test execution.

hope helps!


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -