@Parameters and parameter injection not wroking when used on the same method in version 6.12

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

@Parameters and parameter injection not wroking when used on the same method in version 6.12

Eric Perron
Hi, we have a problem in version 6.12 with a method when using the @Parameters annotation and parameter injection on the same method.

The following example worked in 6.11 and before, but not in 6.12:

Test code
package parameters;

import org.testng.ITestContext;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;

public class SimpleTest
{
   
@Parameters({ "browser" })
   
@BeforeTest
   
public void setUpTest(String browser, ITestContext context)
   
{
       
System.out.println(browser);
       
System.out.println("context : " + context);
   
}

   
@Test()
   
public void aTest()
   
{
       
System.out.println("a test");
   
}
}

xml file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">

<suite name="Suite">
   
<test name="Test">
       
<parameter name="browser" value="chrome" />
       
<classes>
           
<class name="parameters.SimpleTest" />
       
</classes>
   
</test> <!-- Test -->
</suite> <!-- Suite -->

Is it a known issue or did something changed in the new version.

Thanks

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: @Parameters and parameter injection not wroking when used on the same method in version 6.12

Julien Herr
Hi,

If it was working with 6.11, could you open an issue on github? https://github.com/cbeust/testng/issues

Thanks,
Julien

Le mercredi 20 septembre 2017 09:06:49 UTC+2, Eric Perron a écrit :
Hi, we have a problem in version 6.12 with a method when using the @Parameters annotation and parameter injection on the same method.

The following example worked in 6.11 and before, but not in 6.12:

Test code
package parameters;

import org.testng.ITestContext;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;

public class SimpleTest
{
   
@Parameters({ "browser" })
   
@BeforeTest
   
public void setUpTest(String browser, ITestContext context)
   
{
       
System.out.println(browser);
       
System.out.println("context : " + context);
   
}

   
@Test()
   
public void aTest()
   
{
       
System.out.println("a test");
   
}
}

xml file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "<a href="http://testng.org/testng-1.0.dtd" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Ftestng.org%2Ftestng-1.0.dtd\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFHihXzQ1YlwcxcDehnw97TuniFLA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Ftestng.org%2Ftestng-1.0.dtd\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFHihXzQ1YlwcxcDehnw97TuniFLA&#39;;return true;">http://testng.org/testng-1.0.dtd">

<suite name="Suite">
   
<test name="Test">
       
<parameter name="browser" value="chrome" />
       
<classes>
           
<class name="parameters.SimpleTest" />
       
</classes>
   
</test> <!-- Test -->
</suite> <!-- Suite -->

Is it a known issue or did something changed in the new version.

Thanks

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: @Parameters and parameter injection not wroking when used on the same method in version 6.12

Eric Perron
OK, I have created the issue on github
#1554

Thanks

Le jeudi 21 septembre 2017 03:33:31 UTC-4, Julien Herr a écrit :
Hi,

If it was working with 6.11, could you open an issue on github? <a href="https://github.com/cbeust/testng/issues" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fcbeust%2Ftestng%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEkZFwrR886j6_KMGsK-VN4fP6q5g&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fcbeust%2Ftestng%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEkZFwrR886j6_KMGsK-VN4fP6q5g&#39;;return true;">https://github.com/cbeust/testng/issues

Thanks,
Julien

Le mercredi 20 septembre 2017 09:06:49 UTC+2, Eric Perron a écrit :
Hi, we have a problem in version 6.12 with a method when using the @Parameters annotation and parameter injection on the same method.

The following example worked in 6.11 and before, but not in 6.12:

Test code
package parameters;

import org.testng.ITestContext;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;

public class SimpleTest
{
   
@Parameters({ "browser" })
   
@BeforeTest
   
public void setUpTest(String browser, ITestContext context)
   
{
       
System.out.println(browser);
       
System.out.println("context : " + context);
   
}

   
@Test()
   
public void aTest()
   
{
       
System.out.println("a test");
   
}
}

xml file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "<a href="http://testng.org/testng-1.0.dtd" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Ftestng.org%2Ftestng-1.0.dtd\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFHihXzQ1YlwcxcDehnw97TuniFLA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Ftestng.org%2Ftestng-1.0.dtd\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFHihXzQ1YlwcxcDehnw97TuniFLA&#39;;return true;">http://testng.org/testng-1.0.dtd">

<suite name="Suite">
   
<test name="Test">
       
<parameter name="browser" value="chrome" />
       
<classes>
           
<class name="parameters.SimpleTest" />
       
</classes>
   
</test> <!-- Test -->
</suite> <!-- Suite -->

Is it a known issue or did something changed in the new version.

Thanks

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: @Parameters and parameter injection not wroking when used on the same method in version 6.12

Eric Perron
In reply to this post by Julien Herr
OK, I have created Issue #1554 on github.

Thanks

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.