I am having issue with this error. it used to work fine earlier. then now i am learning on TestNG extentreports and Listeners. created those classes and all. now this error is bothering me.
Cannot inject @Test annotated Method [OrderHistory] with [class java.lang.String]. For more information on native dependency injection please refer to http://testng.org/doc/documentation-main.html#native-dependency-injection
public class SubmitOrderTest extends BaseTest {
//String productName="ZARA COAT 3";
@Test(dataProvider="getData",groups={"Purchase"})
public void submitOrder(HashMap<String,String> input) throws IOException {
ProductCatalouge productCatalouge=landingpage.loginApplication(input.get("email"),input.get("password"));
List<WebElement>products= productCatalouge.getProductList();
productCatalouge.addToCart(input.get("product"));
CartPage cartPage= productCatalouge.goToCartPage();
Boolean match= cartPage.varifyProductsDisplay(input.get("product"));
Assert.assertTrue(match);
CheckOut checkout= cartPage.goToCheckout();
checkout.selectCountry("India");
ConfirmationPage confirmationPage=checkout.submitOrder();
String confirmMessage=confirmationPage.confirmationmessage();
Assert.assertTrue(confirmMessage.equalsIgnoreCase("THANKYOU FOR THE ORDER."));
}
@Test(dependsOnMethods={"submitOrder"})
public void OrderHistory(String productName)
{
ProductCatalouge productCatalouge=landingpage.loginApplication("shah.nira@gmail.com","Love123");
OrderPage orderPage=productCatalouge.goToOrderPage();
Assert.assertTrue(orderPage.varifyOrderDisplay(productName));
}
@DataProvider
public Object[][] getData() throws IOException
{
List<HashMap<String,String>> data= getJasonDatatoMap(System.getProperty("user.dir")+"//src//test//java//NikiAcedamy//FrameDesign//data//PurchaseOrder.json");
return new Object[][] {{data.get(0)},{data.get(1)}};
}