1. If there two different test methods in the SAME class
[Test,TestCaseSource("getData")]
public void create_wo_test
[Test, TestCaseSource("getData")]
public void edit_wo_test(...)
2. In Datautil we have implemented only single getData() method
3. for first testcase method i want to use data from excel sheet "Create_WO_Test"
4. for second testcase method i want to use data from excel sheet "Edit_WO_Test"
public static object[] getData()
{
return DataUtil.getData(xls, ?);
}
}
Question :
namespace PTCPMO.SeleniumTestCases.TestCases
{
[TestFixture]
public class Create_workorderTest : BaseTest
{
IJavaScriptExecutor js;
[Test,TestCaseSource("getData")]
public void create_wo_test(string Runmode,string Browser, string Purpose_for_WO,string LS ,string BMP,string EMP,string Stream, string Network_Area, string Source, string Priority ,string WO_Manager , string WO_Status)
{
}
[Test, TestCaseSource("getData")]
public void edit_wo_test(string Runmode, string Browser, string Purpose_for_WO, string LS, string BMP, string EMP, string Stream, string Network_Area, string Source, string Priority, string WO_Manager, string WO_Status)
{
}
public static object[] getData()
{
return DataUtil.getData(xls, "Edit_WO_Test");
}
}
IF Want to run both test cases in a batch , the how will set 'sheetname' [?] in getData method?
You can use 2 different test data sources
public static object[] getData_1()
public static object[] getData_2()
Instructor
Support Desk Replied on 29/05/2019
Is the issue resolved?