How to pass testng parameter to code in Maven based project | Selenium Forum
M
Posted on 26/10/2015
Hi Team,
I am getting following error while running my test case in POM based TestNg project :
Parameter 'browser' is required by @Configuration on method setup but has not been marked @Optional or defined.

My TestNG parameter :
<parameter name ="browser" value ="firefox"></parameter>

my POM :
<build>
<plugins>
<plugin>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src/test/resource/testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
<plugin>
</plugins>
</build>

My Test.java is using :
@Parameters ({"browser"})

My Question is how and what changes i need to make in POM in order to pass parameter to test which is already present in testng.xml?

M
Replied on 27/10/2015

i don't understand the question. can you please repeat the question?