Model 23 Part 15: Cannot inject @Test annotated Method [CreateLeadTest] with [class java.util.Hashtable] | Selenium Forum

Model 23 Part 15:    Cannot inject @Test annotated Method [CreateLeadTest] with [class java.util.Hashtable] | Selenium Forum

Model 23 Part 15: Cannot inject @Test annotated Method [CreateLeadTest] with [class java.util.Hashtable]

when i am running batch test cases through testng, getting followin error:

Cannot inject @Test annotated Method [CreateLeadTest] with [class java.util.Hashtable]

[Utils] [ERROR] [Error] org.testng.TestNGException: Cannot inject @Test annotated Method [CreateLeadTest] with [class java.util.Hashtable]. For more information on native dependency injection please refer to http://testng.org/doc/documentation-main.html#native-dependency-injection

======================================================================

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> <suite name="SuiteName">

<test name="LoginTest" allow-return-values="true"> <classes> <class name="com.ktest.zoho.project.testcases.LoginTest" ></class> </classes> </test> <test name="LeadTest" allow-return-values="true"> <classes> <class name="com.ktest.zoho.project.testcases.LeadTest" ></class> </classes> </test>

<test name="PotentialTest" allow-return-values="true"> <classes> <class name="com.ktest.zoho.project.testcases.PotentialTest" ></class> </classes> </test> </suite>

======================================================

@Test(priority=1,dataProvider = "getData") public void CreateLeadTest (Hashtable<String,String> data) { test = rep.startTest("CreateLeadTest"); //Propinit(); OpnBrowser(data.get("Browser")); navigate("Appurl"); CRMlogin("Acessesyourapp_xpath","AcessAppTxt");

===================================================================

@DataProvider public Object [][]getData() { super.Propinit(); //Initialize Property file xls = new Xls_Reader(prop.getProperty("xlsPath"));

return DataUtil.getTestData(xls, testCaseName);

=================================================================================

Did you try debugging the code?

Share the complete exception stack trace as well.

I will submit tomorrow. I reseraced and have so many issue for:

Cannot inject @Test annotated Method with [class ........

but NOT with Hashtable

https://stackoverflow.com/questions/38530453/selenium-webdriver-testng-data-provider-is-trying-to-pass-2-parameter-but-the

https://www.google.com/search?rlz=1C1GCEA_enUS758US758&ei=UIMSXYfsGbKL5wK8xY_4Cw&q=Cannot+inject+%40Test+annotated+Method+with+%5Bclass+java.util.Hashtable%5D&oq=Cannot+inject+%40Test+annotated+Method+with+%5Bclass+java.util.Hashtable%5D&gs_l=psy-ab.3...72555.74898..76241...0.0..0.101.1430.15j2......0....1..gws-wiz.IsAlKhxR6A8

Please share the project in a compressed ZIP file

I have resolved issue, Data provider was not defined properly. You can close it

We offer online selenium and UFT/QTP training. The course is very comprehensive and covers every aspect of automation testing with UFT/QTP and selenium. All types of frameworks are covered in depth - data driven framework, hybrid framework, page object model with a live project

© 2020 Whizdom Trainings. All rights Reserved - Powered by Whizdom Trainings

Recommended articles