Note that there are some explanatory texts on larger screens.

plurals
  1. POSelenium Grid throws Parameter 'selenium.host' is required by @Configuration on method startServer
    primarykey
    data
    text
    <p>On running Selenium Grid I am getting the below exception:</p> <pre><code>org.testng.TestNGException: Parameter 'selenium.host' is required by @Configuration on method startServer but has not been marked @Optional or defined in D:\workspace\ALM05_PA\config\gridSuite.xml at org.testng.internal.Parameters.createParameters(Parameters.java:144) at org.testng.internal.Parameters.createParameters(Parameters.java:342) at org.testng.internal.Parameters.createConfigurationParameters(Parameters.java:78) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:191) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:131) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:278) at org.testng.SuiteRunner.run(SuiteRunner.java:241) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1169) at org.testng.TestNG.runSuitesLocally(TestNG.java:1094) at org.testng.TestNG.run(TestNG.java:1006) at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:107) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:199) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:170) </code></pre> <p>My Code: (Consider i have started remote controls and launched the hub)</p> <pre><code>@BeforeSuite(alwaysRun = true) @Parameters({"selenium.host", "selenium.port", "selenium.browser", "selenium.url" }) public void startServer(String host, String port, String browser, String url, String SEARCH_STRING) throws Exception { selenium = new DefaultSelenium(host, Integer.parseInt(port), browser, url); selenium.start(); } </code></pre> <p>testng.xml:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"&gt; &lt;suite name="SL-Grid" parallel="tests"&gt; &lt;parameter name="username" value="test" /&gt; &lt;parameter name="password" value="test1" /&gt; &lt;test name="SL-Chrome" preserve-order="true"&gt; &lt;parameter name="selenium.host" value="localhost"&gt;&lt;/parameter&gt; &lt;parameter name="selenium.port" value="5555"&gt;&lt;/parameter&gt; &lt;parameter name="selenium.browser" value="*googlechrome"&gt;&lt;/parameter&gt; &lt;parameter name="selenium.url" value="http://properurl:8080/"&gt;&lt;/parameter&gt; &lt;classes&gt; &lt;class name="com.TestBase" /&gt; // Base class where all generic methods, setUp and tearDown methods present &lt;class name="com.Login"&gt; // Login related methods and inherit TestBase &lt;methods&gt; &lt;include name="loginPage" /&gt; &lt;include name="signIn" /&gt; &lt;/methods&gt; &lt;/class&gt; &lt;class name="com.Page1"&gt; &lt;methods&gt; &lt;include name="clickLinkA" /&gt; &lt;include name="isTextBoxXXXPresent" /&gt; &lt;/methods&gt; &lt;/class&gt;&lt;/classes&gt;&lt;/test&gt; // same way for another browser we have another test with varied port number &lt;/suite&gt; </code></pre> <p>Difference between my project and other example given in various site are : I have @BeforeSuite annotation in the startServer method, (@BeforeClass was not working for a normal project (not a Grid) as i have various inherited classes in a test and so i changed it to @BeforeSuite and its working.)</p> <p>Can any one help me please.. Thanks in Advance</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload