has no parameters defined but was found to be using a data provider (either explicitly specified or inherited from class level annotation).
Data provider mismatch
Ok, I understand now, thanks for explaining. I’m looking into this for my own curiosity but I have not gotten to the bottom of it. I need to make sure you understand:
This is not an Appium issue. You are looking at the way to use TestNg annotations. If you want a quicker answer, or possibly a better one, I would suggest you to cross post on the TestNg user group: https://groups.google.com/g/testng-users
Those people have forgotten more about TestNg than I have ever known.
Ok, I’ve looked into this pretty thoroughly and I think this boils down to something from the link I shared above:
*DataProviders pass the different parameters on a single test in a single execution, whereas parameters pass the parameters just once per execution in TestNG.
So I don’t believe you can use a @Parameter annotation to pass multiple values.
However, once again looking at the link I provided above, you can see that you can parametrize the Data Provider in such a way to achieve what you want.
Take a look at the section titled: DataProviders With Method As A Parameter. You will see that they parametrize based on a method name, like this:
public class DProvider {
@DataProvider (name = "data-provider")
public Object[][] dpMethod (Method m){
switch (m.getName()) {
case "Sum":
return new Object[][] {{2, 3 , 5}, {5, 7, 9}};
case "Diff":
return new Object[][] {{2, 3, -1}, {5, 7, -2}};
}
return null;
}
It seems to me that there is no reason that you couldn’t leverage this on the device uuid, or the device name, or some other capability, using the getCapability method from driver to address this:
As I said above, you really should cross post to the TestNg users group and see what they think. There may be a better solution that I don’t know about.