public void Recognition_UploadAttachments_WS_1166_Sample2() { if (!DataParser.ReturnExecution("WS_1166")) { Assert.Ignore(); } else { _file = "Resources\\" + client + "\\TestsData\\WS_1166.xml"; AwardData.GetAwardImpact(_file); string user = AwardData.GetAwardUserName(_file), award = AwardData.GetAwardName(_file), value = AwardData.GetAwardValue(_file), secondvalue = AwardData.GetAwardSecondValue(_file), file_name = GeneralData.GetFileName(_file), path_file_wrong = GeneralData.GetPathWrongFile(_file).Trim(), reason = AwardData.GetAwardMessage(_file), path_file = GeneralData.GetPathFile(_file).Trim(), proxy_name = ProxyData.GetProxyUserName(_file); //Scenario 2 NominationHomePage recognitionPage = InitialPage.Go().Logon().ClickLogin().NavigateToAdminHomePage().LoginProxyAsuser() .EnterUserName(proxy_name).ProxyToMainHomePage().ClosePopUp().NavigateToNomination(); recognitionPage .SearchEmployeeFound(user) .SelectAward(award) .SelectValues(value) .SelectValues(secondvalue) .FillReason(reason); recognitionPage.ClickUploadFile(); foreach (char a in path_file_wrong) { SendKeys.SendWait(a.ToString()); Thread.Sleep(30); } SendKeys.SendWait("{ENTER}"); Assert.AreEqual("You can't upload files of this type.", recognitionPage.GetErrorMsguploadFile(), "The file was upload correctly or the msg is not right"); } }