public static void TestForNewFunctions2() { TestFramework.OpenBrowser("/login"); LoginWebItems.UserNameTextBox.SetValue("*****@*****.**"); LoginWebItems.PasswordTextBox.SetValue("123456"); LoginWebItems.LoginButton.Click(); VerifyClass.VerifyTextInTheElement("Ruslanko Stepanko", MainPage.linkUsename); TestFramework.CloseBrowser(); }
int IComparer.Compare(object x, object y) { int compareResult; ListViewItem listviewX, listviewY; listviewX = (ListViewItem)x; listviewY = (ListViewItem)y; if (ColumnToSort == 7) { try { VerifyClass vc = (VerifyClass)listviewX.Tag; var lvXValue = listviewX.SubItems[ColumnToSort].Text; var lvYValue = listviewY.SubItems[ColumnToSort].Text; if (lvXValue.Equals("校验成功") && !lvYValue.Equals("校验成功")) { compareResult = 1; } else if (!lvXValue.Equals("校验成功") && lvYValue.Equals("校验成功")) { compareResult = -1; } else { compareResult = 0; } } catch (InvalidCastException) { compareResult = ObjectCompare.Compare(listviewX.SubItems[ColumnToSort].Text, listviewY.SubItems[ColumnToSort].Text); } } else { compareResult = ObjectCompare.Compare(listviewX.SubItems[ColumnToSort].Text, listviewY.SubItems[ColumnToSort].Text); } if (orderSort == SortOrder.Ascending) { return(compareResult); } else if (orderSort == SortOrder.Descending) { return(-compareResult); } else { return(0); } }
public override void PreRequest(object sender, PreRequestEventArgs e) { // e.Request.Url = e.Request.Url + "/growing/test/123"; //ht.Add("JiaoCaiID", JiaoCaiID); //ht.Add("StagingStatus", StagingStatus); //ht.Add("editstatus", editstatus); //ht.Add("verifyClass", VerifyClass.GetInstance()); var verifyClass = new VerifyClass("LancooEditBook", "LancooEditBook"); e.Request.QueryStringParameters.Add("JiaoCaiID", ""); e.Request.QueryStringParameters.Add("StagingStatus", ""); e.Request.QueryStringParameters.Add("editstatus", ""); e.Request.QueryStringParameters.Add("verifyClass", verifyClass.ToString()); }
public static VerifyClass SendFPReq(String action, String document, int dedo, String huella, String type) { var config = new Shared().GetConfig(); var sendData = new DataClass(); sendData.accion = action; sendData.p_ci = document; sendData.p_id_maquina = Convert.ToInt32(config.equipo); sendData.version = new VersionClass().version; sendData.p_nro_dedo1 = dedo; sendData.p_huella1 = huella; sendData.type = type; WebRequest request = WebRequest.Create(new UrlClass().url + "huellas"); request.Method = "POST"; string postData = JsonConvert.SerializeObject(sendData); byte[] byteArray = Encoding.UTF8.GetBytes(postData); request.ContentType = "text/plain"; request.ContentLength = byteArray.Length; Stream dataStream = request.GetRequestStream(); dataStream.Write(byteArray, 0, byteArray.Length); dataStream.Close(); WebResponse response = request.GetResponse(); Console.WriteLine(((HttpWebResponse)response).StatusDescription); dataStream = response.GetResponseStream(); StreamReader reader = new StreamReader(dataStream); string responseFromServer = reader.ReadToEnd(); Console.WriteLine(responseFromServer); reader.Close(); dataStream.Close(); response.Close(); VerifyClass datos = JsonConvert.DeserializeObject <VerifyClass>(responseFromServer); return(datos); }