Trying to use @Parameter method but click on “Login” link not working

Hi All,

I wrote a ┬ásignUp code (freecharge website) and parameterize values using @Parameter but the ‘Login” link is not working while running the code.

Please see attached image for code and testng.xml

Default Asked on December 8, 2014 in Selenium WebDriver.

Please close your answer.

on December 9, 2014.
Add Comment
  • 1 Answer(s)

    Hi Pankaj,

    There is no attachment. Please refer this page for TestNG Paramemeter:

    Test Case

    import java.util.concurrent.TimeUnit;
    import org.openqa.selenium.By;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.firefox.FirefoxDriver;
    import org.testng.annotations.Test;
    import org.testng.annotations.Parameters;
    public class TestngParameters {
    private static WebDriver driver;
    @Parameters({ "sUsername", "sPassword" })
    public void test(String sUsername, String sPassword) {
    driver = new FirefoxDriver();
    driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

    TestNG XML

    <suite name="Suite">
    <test name="ToolsQA">
    <parameter name="sUsername" value="testuser_1"/>
    <parameter name="sPassword" value="Test@123"/>
    <class name="automationFramework.TestngParameters" />

    Professor Answered on December 8, 2014.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.