This is the testNG.xml File:
This is the day4.java File
]
This is the console Result.
Why I am getting this issue?
I also tried with @optional method but in the that way I am getting the NULL value.
This is the testNG.xml File:
This is the day4.java File
]
This is the console Result.
Why I am getting this issue?
I also tried with @optional method but in the that way I am getting the NULL value.
You are not passed any parameter value in the testng.xml file.Your xml file should look like
<suite name="Parameter test Suite" verbose="1">
<!-- This parameter will be passed to every test in this suite -->
<parameter name="suite-param" value="suite level parameter" />
<test name="Home loan">
<classes>
<class name="test">
<methods>
<include name="demo" />
</methods>
</class>
</classes>
</test>
</suite>
Here parameter name and value will be your URL
Few more details about xml file https://developers.perfectomobile.com/display/TT/TestNG+-User+specified+TestNG+xml+parameters
So you have to make 2 changes.
Your code should look like this:
@Parameter("URL")
@Test
public void webloginHomeloan(@Optional String urlname){
System.out.println("WebloginHome");
System.out.println("Parameterized value is:"+ URL)
}
Add @Optional in parameter as you are not passing any value from String urlname and change "urlname" to "URL"