private void Init() { Data = DataSources.Get("RXCase"); Ranorex.Controls.ProgressForm.Hide(); //Host.Local.RunApplication("D:\\@BV110\\Launcher.exe"); }
/// <summary> /// Performs the playback of actions in this module. /// </summary> /// <remarks>You should not call this method directly, instead pass the module /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method /// that will in turn invoke this method.</remarks> void ITestModule.Run() { Mouse.DefaultMoveTime = 300; Keyboard.DefaultKeyPressTime = 100; Delay.SpeedFactor = 1.0; //Get handle on SmartFolder var tc = TestSuite.Current.GetTestContainer("SmartFolder"); //Get the name of the connector to use from the Global Parameter "Data Source" var testsource = DataSources.Get(TestSuite.Current.Parameters["DataSource"]); //Switch and load connector before test conatiner execution. tc.DataContext.Source = testsource; tc.DataContext.Source.Load(); }
public static void UpdateInputFile(String ColumnName, String Value) { String tc = TestSuite.CurrentTestContainer.DataContext.Source.Connector.Name.ToString(); //var source = ; // tc.DataContext.Source=source; // tc.DataContext.Source.Load(); Ranorex.Core.Data.DataCache myConn = DataSources.Get(tc); myConn.Load(); int row1 = TestSuite.CurrentTestContainer.DataContext.CurrentRowIndex; //var colheader= new DataConnectorBindingInfo("ApplicaitonNumber",tc.Id, tc.DataContext); var colnames = TestSuite.Current.CurrentTestContainer.DataContext.AvailableDataColumnNames; int colcount = colnames.Count; int columnindex = 0; for (int i = 0; i < colcount; i++) { if (colnames[i].FullName == ColumnName) { columnindex = i; break; } else if (i == colcount) { return; } } //int index = colnames.IndexOf("ApplicationNumber"); //int colindex = IndexOf(colnames,"ApplicationNumber"); Ranorex.Core.Data.RowCollection propTableRowsCSV = myConn.Rows; //Set the first column value for each row to "new value" // foreach (var row in propTableRowsCSV) { propTableRowsCSV[row1 - 1].Values[columnindex] = Value; // propTableRowsCSV[34].Values[0] = "20"; // propTableRowsCSV[35].Values[0] = "30"; // propTableRowsCSV[35].Values[1] = "30"; //int z = myConn.Columns.IndexOf("ApplicaitonNumber"); //string CellValue = Dataconn.Rows[1].Values[z]; } myConn.Store(); }
public static void UpdateInputFile(String ColumnName, String Value) { String tc = TestSuite.CurrentTestContainer.DataContext.Source.Connector.Name.ToString(); Report.Info("Current testcase:" + tc); Ranorex.Core.Data.DataCache myConn = DataSources.Get(tc); myConn.Load(); int row1 = TestSuite.CurrentTestContainer.DataContext.CurrentRowIndex; var colnames = TestSuite.Current.CurrentTestContainer.DataContext.AvailableDataColumnNames; Report.Info("noOfColumn in Datasheet:" + colnames.Count); int colcount = colnames.Count; int columnindex = 0; for (int i = 0; i < colcount; i++) { Report.Info("ColumnName in Datasheet:" + colnames[i].FullName); if (colnames[i].FullName == ColumnName) { columnindex = i; break; } else if (i == colcount) { return; } } Ranorex.Core.Data.RowCollection propTableRowsCSV = myConn.Rows; Report.Info("noOfRows in Datasheet:" + propTableRowsCSV.Count); { Report.Info("row " + row1 + " and column " + columnindex + " in Datasheet"); //propTableRowsCSV[row1-1].Values[columnindex] = Value; } myConn.Store(); }