New answers tagged

0

Just apply split while returning inside the overridden method next() public class DpOne { final static String DELIMITER = ","; @DataProvider(name="references") public Iterator<Object[]> refDataProvider(){ try{ Scanner scanner = new Scanner( new File("temp.csv")); ...


2

Data Providers are use to pass the Test-Data into the @test .Please create a java member function to write the excel and call directly to your @test instead of using it in /as data provider


0

Just to add to the above answer, If you refer the documentation https://testng.org/doc/documentation-main.html#parameters-dataproviders If you declare your @DataProvider as taking a java.lang.reflect.Method as first parameter, so whatever class methods supported for java.lang.reflect.Method class will be supported inside the data provider, you can see all ...


3

This will help you public class Dummy { @DataProvider(name="dp") public Object[][] getData(Method m) { //this will print respective class name System.out.println(m.getDeclaringClass()); return new Object[][] {{"name"}}; } } Will print the class name as shown in image below You can get only the class ...


1

you are getting the exception because somewhere you are creating a array with negative size On analyzing the code , the most possible line that causes this issue would be: Object[][] data = new Object[rows - 1][cols]; In your code you are getting sheet name as : String sheetName = m.getName(); When you call this from a different class i am not sure whether ...


3

The problem with implicit wait is that it will wait the full time unless the element being searched for is present. Since you are waiting for an element to go away, the implicit wait is going to last the full time span. I'd suggest removing the implicit wait entirely and using your two wait.until calls followed by a third wait.until that checks that an ...


Top 50 recent answers are included