Mostrando entradas con la etiqueta Test. Mostrar todas las entradas
Mostrando entradas con la etiqueta Test. Mostrar todas las entradas

15/5/17

Otro de envío de teclas.

Ejecuta un chrome y le envía las teclas para probar la página

Parece funcionar. Habría luego que comprobar que la página ha hecho lo que se le ha pedido



Process p = new Process();
p.StartInfo.FileName = @"C:\Program Files (x86)\Google\Chrome\Application\Chrome.exe";
p.StartInfo.Arguments = @"file:///C:/Users/usuario/Desktop/borrame.html";//html que se quiere probar
p.Start();
p.WaitForInputIdle();
Thread.Sleep(1000);
SendKeys.SendWait("{TAB}");
SendKeys.SendWait("hola a todos");
SendKeys.SendWait("{Tab}");
SendKeys.SendWait("{Enter}");
Thread.Sleep(1000);
p.CloseMainWindow();

27/4/11

Comparar el contenido de dos filas

public static bool ContenidoRowsEsIgual<T>(T row1, T row2) where T : DataRow {
bool result = true;
if (!row1.GetType().Equals(row2.GetType())) {
throw new Exception("Las filas no son del mismo tipo");
}
DataRow r1 = row1 as DataRow;
DataRow r2 = row2 as DataRow;
for (int i = 0; i < r1.ItemArray.Length; i++) {
if (!r1[i].Equals(r2[i])) {
result = false;
}
}
return result;
}