/// <summary> /// Constructor to initialize the ScriptHelper object and in turn the objects wrapped by it /// </summary> /// <param name="scriptHelper">The ScriptHelper object</param> public ReusableLibrary(ScriptHelper scriptHelper) { this.ScriptHelper = scriptHelper; this.Driver = scriptHelper.Driver; this.DataTable = scriptHelper.DataTable; this.Report = scriptHelper.Report; }
private void InitializeDatatable() { String datatablePath = _frameworkParameters.RelativePath + Util.GetFileSeparator() + "Datatables"; String runTimeDatatablePath; if (_reportSettings.IncludeTestDataInReport) { runTimeDatatablePath = reportPath + Util.GetFileSeparator() + "Datatables"; if (!File.Exists(runTimeDatatablePath + Util.GetFileSeparator() + testParameters.CurrentScenario + ".xls")) { try { File.Copy(datatablePath + Util.GetFileSeparator() + testParameters.CurrentScenario + ".xls", runTimeDatatablePath + Util.GetFileSeparator() + testParameters.CurrentScenario + ".xls"); } catch (IOException e) { Console.WriteLine(e.StackTrace); throw new FrameworkException("Error in creating run-time datatable: Copying the datatable failed..."); } } if (!File.Exists(runTimeDatatablePath + Util.GetFileSeparator() + "Common Testdata.xls")) { try { File.Copy(datatablePath + Util.GetFileSeparator() + "Common Testdata.xls", runTimeDatatablePath + Util.GetFileSeparator() + "Common Testdata.xls"); } catch (IOException e) { Console.WriteLine(e.StackTrace); throw new FrameworkException("Error in creating run-time datatable: Copying the common datatable failed..."); } } } else { runTimeDatatablePath = datatablePath; } dataTable = new CraftDataTable(runTimeDatatablePath, testParameters.CurrentScenario); }
/// <summary> /// Constructor to initialize all the objects wrapped by the ScriptHelper class /// </summary> /// <param name="dataTable">The CraftDataTable object</param> /// <param name="report">The SeleniumReport object</param> /// <param name="driver"></param> public ScriptHelper(CraftDataTable dataTable, SeleniumReport report, RemoteWebDriver driver) { this.DataTable = dataTable; this.Report = report; this.Driver = driver; }