I'm still relatively new to both Java and TestNG, so forgive me if I use incorrect technical terms. I'll keep an eye out for responses throughout the day in case I need to correct myself or clarify.
In the automated test that I am writing, I am passing my parameters through an Excel sheet via Data Provider. That whole part is fine. However, I would now like to perform a getText() on an element and copy that String BACK to the excel sheet that Data Provider was reading from.
Here is an example of my intentions:
//Grabs Parameters to be used from Excel Sheet
@DataProvider
public Object[][] getData(){
suiteXls = new Xls_Reader(System.getProperty("user.dir")+"//src//testData.xlsx")
List<String> sheetNames = new ArrayList<String>();
sheetNames.add("TestStrings");
return TestUtilFinal.getData(suiteXls,sheetNames);
}
//Test Begins
@Test(dataProvider="getData")
public void Test1(String Value_1, String Operator, String Value_2, String Output){
// do some work here
Output.saveToCell();
An Issue that I potentially see is that the cell that the value would be saved in would be dynamic.
Here is what the excel sheet would look like before the test is run
Here is what the same sheet would like AFTER the test is run. Any help or insight would be greatly appreciated! Thanks