public void TestStart_APP() { ReadExcel ReadExcelHelper = new ReadExcel(); //Create methods objects CommonMethods objCommonMethods = new CommonMethods(); Approve objCreate_Approve = new Approve(); KeyWordMethods kwm = new KeyWordMethods(); objCommonMethods.TestCase_Result_OutPutExcel(); string strMainSheetName = "Main$"; string strMainSql = "SELECT TestCaseId,NumberOfRepeats,DataSheet,Include,Url,Client,UserName,Browser FROM [" + strMainSheetName + "] where UserName = '******' and Run = 'Yes' and Include = 'Yes'"; objCommonMethods.WriteLogFileBeginHeader(KeyWords.strLogfilePath); var MainSheetResult = new Result(); var ApproveSheetResult = new Result(); var GetReqNumberResult = new Result(); var TestCaseResult = new Result(); var WriteExlResult = new Result(); var Result_ScreenShot = new Result(); var GetSelectedResult = new Result(); var Result_Browser = new Result(); Thread.Sleep(1); // TestCaseResult = objCommonMethods.Update_Table_Data_Database("Update ST_AL_Alert set ForceStatus=0"); MainSheetResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, strMainSheetName, strMainSql); string stralreadyUsingexcel = "The Microsoft Office Access database engine cannot open or write to the file";// ''. It is already opened exclusively by another user, or you need permission to view and write its data"; if (MainSheetResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(5000); MainSheetResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, strMainSheetName, strMainSql); if (MainSheetResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(10000); MainSheetResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, strMainSheetName, strMainSql); if (MainSheetResult.ErrorMessage.Contains(stralreadyUsingexcel)) { } } } if (MainSheetResult.Result1 == "Pass") { foreach (DataRow drowMain in MainSheetResult.dt.Rows) { // Testcase Id include "Yes" in input && Testcase Id is empty checking if ((drowMain[3].ToString().ToUpper() == "YES") && (drowMain[0].ToString() != null) && (drowMain[2].ToString().Trim() != "") && (Convert.ToInt32(drowMain[1]) > 0)) { // Reading the All sheet selected Testcase ID //Adding new code for supplier new design KeyWords.LoginUser_Role = drowMain[2].ToString(); KeyWords.str_App_Url = drowMain[4].ToString(); DataTable dtExlAllSheet = new DataTable(); string strSubSheetName = drowMain[2].ToString() + "$"; string strSubSql = ""; string strAllorClient = drowMain[5].ToString(); if (strAllorClient.Trim().ToLower() == "all") { strSubSql = "SELECT * FROM [" + strSubSheetName + "] WHERE TestCaseId= '" + drowMain[0].ToString() + "'"; } else { strSubSql = "SELECT top 1 * FROM [" + strSubSheetName + "] WHERE TestCaseId= '" + drowMain[0].ToString() + "' and P3 = '" + drowMain[5].ToString() + "'and TestExecute = 'yes'"; } ApproveSheetResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, strSubSheetName, strSubSql); if (ApproveSheetResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(5000); ApproveSheetResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, strSubSheetName, strSubSql); if (ApproveSheetResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(10000); ApproveSheetResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, strSubSheetName, strSubSql); if (ApproveSheetResult.ErrorMessage.Contains(stralreadyUsingexcel)) { } } } string[] strDataArray = new string[5]; string[] strColArray = new string[5]; if (ApproveSheetResult.dt.Rows.Count > 0) { strDataArray = new string[ApproveSheetResult.dt.Rows[0].ItemArray.Length]; strColArray = new string[ApproveSheetResult.dt.Rows[0].ItemArray.Length]; } // Number of counts repated in Main sheet for (int iLoop = 1; iLoop <= Convert.ToInt32(drowMain[1]); iLoop++) { //string strUpdateSqlMain = "Update [Main$] set Run = 'P' WHERE TestCaseId= '002' and Client ='" + drowMain[5].ToString() + "'"; //ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSqlMain); string strLoginUser = string.Empty; string strLoginUser1 = string.Empty; if (ApproveSheetResult.dt.Rows.Count > 0) { //Number of testcases for each Testcase ID for (int iSubRowLoop = 0; iSubRowLoop < ApproveSheetResult.dt.Rows.Count; iSubRowLoop++) { if (iSubRowLoop == 0) { //Added new browser code KeyWords.str_Browser_Execute = drowMain[7].ToString(); Result_Browser = kwm.Choose_Browser(driver, drowMain[7].ToString().ToLower()); if (Result_Browser.Result1 == KeyWords.Result_PASS) { driver = Result_Browser.driver; } } for (int c = 0; c < ApproveSheetResult.dt.Rows[iSubRowLoop].ItemArray.Length; c++) { if (ApproveSheetResult.dt.Columns[c].ColumnName.ToString() != "") { strColArray[c] = ApproveSheetResult.dt.Columns[c].ColumnName.ToString(); strDataArray[c] = ApproveSheetResult.dt.Rows[iSubRowLoop][c].ToString(); } } Stopwatch stopwatch = System.Diagnostics.Stopwatch.StartNew(); //TestCaseResult = objCommonMethods.TestCase_Login_Execution_NewApp(driver, ApproveSheetResult, KeyWords.strLogfilePath, KeyWords.strExlOutputPath, iSubRowLoop, strColArray, strDataArray, iLoop, drowMain[1].ToString(), ApproveSheetResult.dt.Rows[iSubRowLoop][0].ToString()); objCommonMethods.WriteLogFileTestCaseErrorResult(KeyWords.strLogfilePath, "Login Time " + stopwatch.Elapsed.Seconds, 3); switch (ApproveSheetResult.dt.Rows[iSubRowLoop][0].ToString()) { case Constants.TestCase002: { string strREQNumber = ApproveSheetResult.dt.Rows[iSubRowLoop]["P6"].ToString(); Console.WriteLine(strREQNumber); if (strREQNumber != "") { // TestCaseResult = objCreate_Approve.Approve_Method(driver, ApproveSheetResult.dt.Rows[iSubRowLoop], test); //TestCaseResult = objCommonMethods.Get_Table_Data_Database("select count(*) ApproveCout from ST_MS_WF_ReqWorkflow where requirementid= (select requirementid from ST_MS_Requirement where CLSRNumber='" + strREQNumber + "')", "ApproveCout"); if (TestCaseResult.Result1 == KeyWords.Result_PASS) { string strUpdateSql = "Update [approve$] set TestExecute = 'P' WHERE TestCaseId= '002' and P6 = '" + strREQNumber + "' and P3 ='" + ApproveSheetResult.dt.Rows[iSubRowLoop]["P3"].ToString() + "'"; WriteExlResult = ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSql); //Previous code is available at the bottom the file. string[] strDataArray1 = new string[5]; string[] strColArray1 = new string[5]; string strSubSql12 = "SELECT * FROM [all$] WHERE TestCaseId= '003' and P3 ='" + ApproveSheetResult.dt.Rows[iSubRowLoop]["P3"].ToString() + "'"; GetSelectedResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, "All$", strSubSql12); if (GetSelectedResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(5000); GetSelectedResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, "All$", strSubSql12); if (GetSelectedResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(10000); GetSelectedResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, "All$", strSubSql12); if (GetSelectedResult.ErrorMessage.Contains(stralreadyUsingexcel)) { } } } if (GetSelectedResult.dt.Rows.Count > 0) { if (GetSelectedResult.dt.Rows.Count > 0) { strDataArray1 = new string[GetSelectedResult.dt.Rows[0].ItemArray.Length]; strColArray1 = new string[GetSelectedResult.dt.Rows[0].ItemArray.Length]; } for (int c = 0; c <= GetSelectedResult.dt.Rows[0].ItemArray.Length - 1; c++) { if (GetSelectedResult.dt.Columns[c].ColumnName.ToString() == "P6") { strColArray1[c] = GetSelectedResult.dt.Columns[c].ColumnName.ToString(); strDataArray1[c] = strREQNumber; } else { strColArray1[c] = GetSelectedResult.dt.Columns[c].ColumnName.ToString(); strDataArray1[c] = GetSelectedResult.dt.Rows[0][c].ToString(); } } Result UpdateSelectedResult = ReadExcelHelper.WriteDataToExcelFileSelected(KeyWords.strExlInputPath, "MSP", strColArray1, strDataArray1); } string strUpdateSqlMain = "Update [Main$] set Run = 'Yes' WHERE TestCaseId= '003' and Client ='" + ApproveSheetResult.dt.Rows[iSubRowLoop]["P3"].ToString() + "'"; ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSqlMain); strUpdateSqlMain = "Update [MSP$] set TestExecute = 'Yes' WHERE TestCaseId= '003' and P6 = '" + strREQNumber + "' and P3 ='" + ApproveSheetResult.dt.Rows[iSubRowLoop]["P3"].ToString() + "'"; ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSqlMain); kwm.Logout_Link_Click_NewUI(driver, "Logout"); string strExecutepath = @System.IO.Directory.GetCurrentDirectory(); if (KeyWords.strNunitConsolePath == "") { KeyWords.strNunitConsolePath = Constants.NunitConsolePath; } ProcessStartInfo start = new ProcessStartInfo(); start.Arguments = strExecutepath + Constants.NunitBroadCastBinPath; start.FileName = KeyWords.strNunitConsolePath; Process.Start(start); } else { TestCaseResult.Result1 = KeyWords.Result_FAIL; TestCaseResult.ErrorMessage = "Unable to connect to database or some other problem"; TestCaseResult = objCommonMethods.TestCase_Result_Execution(driver, ApproveSheetResult, TestCaseResult, KeyWords.strLogfilePath, KeyWords.strExlOutputPath, iSubRowLoop, strColArray, strDataArray, iLoop, drowMain[1].ToString()); } } else { TestCaseResult.Result1 = KeyWords.Result_FAIL; TestCaseResult.ErrorMessage = "Input REQ number is empty"; TestCaseResult = objCommonMethods.TestCase_Result_Execution(driver, ApproveSheetResult, TestCaseResult, KeyWords.strLogfilePath, KeyWords.strExlOutputPath, iSubRowLoop, strColArray, strDataArray, iLoop, drowMain[1].ToString()); } break; } default: { break; } } //Switch case End here } //No of sub test cases for loop driver.Quit(); } else { // Selected testcase id input data not avalibale } } } } } else { Console.WriteLine(MainSheetResult.ErrorMessage); objCommonMethods.WriteLogFileTestCaseHeaders(KeyWords.strLogfilePath, MainSheetResult.ErrorMessage, 1, "yes"); objCommonMethods.WriteLogFileTestCaseHeaders(KeyWords.strLogfilePath, MainSheetResult.ErrorMessage, 2, "no"); } objCommonMethods.WriteLogFileEndHeader(KeyWords.strLogfilePath); }
public Result Confirm_Int(IWebDriver WDriver, DataRow Confirm_Interview) { ReadExcel ReadExcelHelper = new ReadExcel(); KeyWordMethods kwm = new KeyWordMethods(); CommonMethods objCommonMethods = new CommonMethods(); var results = new Result(); var Result_ScreenShot = new Result(); // Rate_Change objRateChange = new Rate_Change(); CreateRequirementRepository createRequirementRepository = new CreateRequirementRepository(); ConfirmInterviewModel Confrim_Interview_Model = createRequirementRepository.GetConfirmInterviewModel(Confirm_Interview); //SubmitCandidateAddResume submitCandidateAddResume = createRequirementRepository.GetSubmitCandidateAddResumeData(Confirm_Interview); //CLient selection results = kwm.Client_Change_Click_NewApp(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, Confrim_Interview_Model.strClientName); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(5000); results = kwm.Client_Change_Click_NewApp(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, Confrim_Interview_Model.strClientName); if (results.Result1 == KeyWords.Result_FAIL) { //results.ErrorMessage1 = "Unable to click on the Main menu"; return(results); } } objCommonMethods.SaveScreenShot_EachPage(WDriver, Confrim_Interview_Model.strClientName + "_"); //submenu click results = kwm.Main_Sub_Menu_Click_NewApp(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, Confrim_Interview_Model.strMainMenuLink, Confrim_Interview_Model.strSubMenuLink); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(5000); results = kwm.Main_Sub_Menu_Click_NewApp(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, Confrim_Interview_Model.strMainMenuLink, Confrim_Interview_Model.strSubMenuLink); if (results.Result1 == KeyWords.Result_FAIL) { //results.ErrorMessage1 = "Unable to click on the Main menu"; return(results); } } // Status list //if (Confrim_Interview_Model.str_Select_Statuslist != "") //{ // results = kwm.select(WDriver, KeyWords.locator_ID, KeyWords.ID_Select_Statuslist, Confrim_Interview_Model.str_Select_Statuslist); // if (results.Result1 == KeyWords.Result_FAIL) // { // try // { // SelectElement se = new SelectElement(WDriver.FindElement(By.Id(KeyWords.ID_Select_Statuslist))); //Locating select list // se.SelectByIndex(0); // } // catch // { // // // } // } // Thread.Sleep(100); // // WDriver.FindElement(By.Id(KeyWords.ID_Btn_SearchBtn)).Click(); // Thread.Sleep(1000); //} // Data is passed into search text box kwm._WDWait = kwm.WebDriver_Wait_Handler(WDriver, 30); try { Thread.Sleep(3000); kwm.waitForElementToBeClickable(WDriver, By.Id(KeyWords.ID_paginate_regReqList_filter), kwm._WDWait); WDriver.FindElement(By.XPath(KeyWords.ID_paginate_regReqList_filter)).Clear(); WDriver.FindElement(By.XPath(KeyWords.ID_paginate_regReqList_filter)).SendKeys(Confrim_Interview_Model.str_Txt_ReqNumber); } catch { try { WDriver.FindElement(By.XPath(KeyWords.ID_paginate_regReqList_filter)).Clear(); WDriver.FindElement(By.XPath(KeyWords.ID_paginate_regReqList_filter)).SendKeys(Confrim_Interview_Model.str_Txt_ReqNumber); } catch { // } } // After seraching, requirement number click Thread.Sleep(2000); // WDriver.FindElement(By.LinkText(Confrim_Interview_Model.str_Txt_ReqNumber)).Click(); Thread.Sleep(2000); // WDriver.FindElement(By.LinkText(Confrim_Interview_Model.str_Txt_ReqNumber)).Click(); kwm.waitForElementToBeClickable(WDriver, By.LinkText(Confrim_Interview_Model.str_Txt_ReqNumber), kwm._WDWait); results = kwm.click(WDriver, KeyWords.locator_LinkText, Confrim_Interview_Model.str_Txt_ReqNumber); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(2000); results = kwm.click(WDriver, KeyWords.locator_LinkText, Confrim_Interview_Model.str_Txt_ReqNumber); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(2000); results = kwm.click(WDriver, KeyWords.locator_LinkText, Confrim_Interview_Model.str_Txt_ReqNumber); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(2000); results = kwm.click(WDriver, KeyWords.locator_LinkText, Confrim_Interview_Model.str_Txt_ReqNumber); } } return(results); } //Loading message for (int z = 1; z < 500; z++) { Boolean strValue = true; try { strValue = WDriver.FindElement(By.Id("loading-message")).Displayed; } catch { strValue = true; } // Console.WriteLine("z -----> " + z); // Console.WriteLine("strValue -----> " + strValue); if (!strValue) { break; } Thread.Sleep(1000); } //View candidate link click results = kwm.Action_LookInto_Element(WDriver, KeyWords.locator_XPath, "//a[contains(text(),'" + Confrim_Interview_Model.str_Link_View_Candidates + "')]"); //string strSubLevel = "./label"; // string strSubLevel = ""; objCommonMethods.SaveScreenShot_EachPage(WDriver, Confrim_Interview_Model.strClientName + "_"); results = kwm.jsClick(WDriver, KeyWords.locator_XPath, "//a[contains(text(),'" + Confrim_Interview_Model.str_Link_View_Candidates + "')]"); //results = kwm.list_Menu_Click(WDriver, KeyWords.locator_ID, KeyWords.ID_List_listMenu1, Confrim_Interview_Model.str_Link_View_Candidates, strSubLevel); //if (results.Result1 == KeyWords.Result_FAIL) //{ // objCommonMethods.Action_Page_Down(WDriver); // Thread.Sleep(5000); // results = kwm.list_Menu_Click(WDriver, KeyWords.locator_ID, KeyWords.ID_List_listMenu1, Confrim_Interview_Model.str_Link_View_Candidates, strSubLevel); // if (results.Result1 == KeyWords.Result_FAIL) // { // return results; // } //} for (int z = 1; z < 1000; z++) { Boolean strValue = true; try { strValue = WDriver.FindElement(By.Id("loading-message")).Displayed; } catch { strValue = true; } // Console.WriteLine("z -----> " + z); // Console.WriteLine("strValue -----> " + strValue); if (!strValue) { break; } Thread.Sleep(100); } Thread.Sleep(1000); // Search Candidate Name if (Confrim_Interview_Model.str_Txt_CandidateName != "") { new WebDriverWait(WDriver, TimeSpan.FromSeconds(300)).Until(ExpectedConditions.ElementExists((By.XPath(KeyWords.Xpath_Txt_CandidateName)))); WDriver.FindElement(By.XPath(KeyWords.Xpath_Txt_CandidateName)).Clear(); kwm.sendText_clr(WDriver, KeyWords.locator_XPath, KeyWords.Xpath_Txt_CandidateName, Confrim_Interview_Model.str_Txt_CandidateName); // WDriver.FindElement(By.XPath(KeyWords.Xpath_Txt_CandidateName)).SendKeys(Confrim_Interview_Model.str_Txt_CandidateName); kwm.sendText(WDriver, KeyWords.locator_XPath, KeyWords.Xpath_Txt_CandidateName, Confrim_Interview_Model.str_Txt_CandidateName, false); } Thread.Sleep(1000); // Click on Candidate Name if (Confrim_Interview_Model.str_Txt_CandidateName != "") { try { WDriver.FindElement(By.LinkText(Confrim_Interview_Model.str_Txt_CandidateName)).Click(); } catch { Thread.Sleep(100); try { kwm.Action_LookInto_Element(WDriver, KeyWords.locator_LinkText, Confrim_Interview_Model.str_Txt_CandidateName); Thread.Sleep(1000); WDriver.FindElement(By.PartialLinkText(Confrim_Interview_Model.str_Txt_CandidateName)).Click(); } catch { // Console.WriteLine(bFlag); results.Result1 = KeyWords.Result_FAIL; results.ErrorMessage = "The given candidate name not find " + Confrim_Interview_Model.str_Txt_CandidateName; return(results); } } } Thread.Sleep(1000); // To check Confirm Interview link is displaying try { new WebDriverWait(WDriver, TimeSpan.FromSeconds(300)).Until(ExpectedConditions.ElementExists((By.Id(KeyWords.ID_List_listMenu1)))); } catch { objCommonMethods.WriteLogFileTestCaseErrorResult(KeyWords.strLogfilePath, "Action list is not displayed", 3); for (int i = 0; i < 10; i++) { try { if (WDriver.FindElement(By.Id(KeyWords.ID_List_listMenu1)).Displayed) { break; } Thread.Sleep(100); } catch { } } } // To click on Confirm Interview link string strSubLevel1 = ""; // string strSubLevel = "./label"; results = kwm.list_Menu_Click(WDriver, KeyWords.locator_ID, KeyWords.ID_List_listMenu1, Confrim_Interview_Model.str_Link_ConfirmInterview, strSubLevel1); if (results.Result1 == KeyWords.Result_FAIL) { //added by pradeep Thread.Sleep(5000); objCommonMethods.Action_Page_Down(WDriver); results = kwm.list_Menu_Click(WDriver, KeyWords.locator_ID, KeyWords.ID_List_listMenu1, Confrim_Interview_Model.str_Link_ConfirmInterview, strSubLevel1); if (results.Result1 == KeyWords.Result_FAIL) { objCommonMethods.Action_Page_Down(WDriver); results = kwm.list_Menu_Click(WDriver, KeyWords.locator_ID, KeyWords.ID_List_listMenu1, Confrim_Interview_Model.str_Link_ConfirmInterview, strSubLevel1); return(results); } //end } // Confirm Interview Window try { new WebDriverWait(WDriver, TimeSpan.FromSeconds(300)).Until(ExpectedConditions.ElementExists((By.Id(KeyWords.ID_Candidate_Int_DialogWindow)))); } catch { } // Requested Interviews try { SelectElement se = new SelectElement(WDriver.FindElement(By.Id(KeyWords.ID_Txt_Requested_Interview))); //Locating select list se.SelectByIndex(0); } catch { // } // Confirmed interview Date/Time kwm.click(WDriver, KeyWords.locator_ID, KeyWords.ID_Date_FirChoice); if (Confrim_Interview_Model.str_Txt_Confirm_IntDate != "") { if (results.Result1 == KeyWords.Result_FAIL) { results = kwm.sendText(WDriver, KeyWords.locator_ID, KeyWords.ID_Txt_Confirmed_IntDate, Confrim_Interview_Model.str_Txt_Confirm_IntDate, false); if (results.Result1 == KeyWords.Result_FAIL) { results = kwm.Select_End_Date_From_Picker(WDriver, Confrim_Interview_Model.str_Txt_Confirm_IntDate); } } } else { var today = DateTime.Now; var tomorrow = today.AddDays(1); DateTime date = tomorrow; Confrim_Interview_Model.str_Txt_Confirm_IntDate = date.ToString("MM/dd/yyyy"); results = kwm.sendText(WDriver, KeyWords.locator_ID, KeyWords.ID_Date_SecChoice, Confrim_Interview_Model.str_Txt_Confirm_IntDate, false); } // Select Time if (Confrim_Interview_Model.str_Select_SupplierTime != "") { results = kwm.select(WDriver, KeyWords.locator_ID, KeyWords.ID_Txt_TimeofInterview, Confrim_Interview_Model.str_Select_SupplierTime); if (results.Result1 == KeyWords.Result_FAIL) { try { SelectElement se = new SelectElement(WDriver.FindElement(By.Id(KeyWords.ID_Txt_TimeofInterview))); //Locating select list se.SelectByIndex(3); } catch { // } } } // Select Zone if (Confrim_Interview_Model.str_Select_SupplierZone != "") { results = kwm.select(WDriver, KeyWords.locator_ID, KeyWords.ID_Txt_ZoneofInterview, Confrim_Interview_Model.str_Select_SupplierZone); if (results.Result1 == KeyWords.Result_FAIL) { try { SelectElement se = new SelectElement(WDriver.FindElement(By.Id(KeyWords.ID_Txt_ZoneofInterview))); //Locating select list se.SelectByIndex(3); } catch { // } } } // Primary Phone if (Confrim_Interview_Model.str_Txt_PrimaryPhone != "") { results = kwm.sendText(WDriver, KeyWords.locator_ID, KeyWords.ID_Txt_PmyPhone, Confrim_Interview_Model.str_Txt_PrimaryPhone, false); if (results.Result1 == KeyWords.Result_FAIL) { // return results; } } // Alternate Phone if (Confrim_Interview_Model.str_Txt_SecondaryPhone != "") { results = kwm.sendText(WDriver, KeyWords.locator_ID, KeyWords.ID_Txt_SecPhone, Confrim_Interview_Model.str_Txt_SecondaryPhone, false); if (results.Result1 == KeyWords.Result_FAIL) { // return results; } } // Comment if (Confrim_Interview_Model.str_Txt_Sche_Comment != "") { results = kwm.sendText(WDriver, KeyWords.locator_ID, KeyWords.ID_Txt_ConfirmInt_Comment, Confrim_Interview_Model.str_Txt_Sche_Comment, false); if (results.Result1 == KeyWords.Result_FAIL) { // return results; } } objCommonMethods.Action_Page_Down(WDriver); // Confirm Interview button results = kwm.select_MSG_Button(WDriver, KeyWords.locator_class, KeyWords.locator_class_button, Confrim_Interview_Model.str_Btn_ConfirmInterview); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(3000); results = kwm.select_MSG_Button(WDriver, KeyWords.locator_type, KeyWords.locator_class_button, Confrim_Interview_Model.str_Btn_ConfirmInterview); if (results.Result1 == KeyWords.Result_FAIL) { return(results); } } // To maintain error log messages in log files objCommonMethods.SaveScreenShot_EachPage(WDriver, Confrim_Interview_Model.strClientName + "_"); results = kwm.Error_Msg_Read_Submit_Resume_details(WDriver, "//*[@" + KeyWords.locator_ID + "='ulMspUserError']/li"); //results = kwm.Error_Msg_Read_Submit_Resume_details(WDriver, "//div[@" + KeyWords.locator_ID + "= KeyWords.ID_Error_Valmessages]/div/ul/li"); if (results.Result1 == KeyWords.Result_PASS) { if (results.ErrorMessage != "") { results.Result1 = KeyWords.Result_FAIL; return(results); } } // Confirmation popup with YES/NO results = kwm.select_MSG_Button(WDriver, KeyWords.locator_type, KeyWords.locator_button, Confrim_Interview_Model.str_Btn_Yes_Action_ConfirmInt); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(3000); results = kwm.select_MSG_Button(WDriver, KeyWords.locator_type, KeyWords.locator_button, Confrim_Interview_Model.str_Btn_Yes_Action_ConfirmInt); if (results.Result1 == KeyWords.Result_FAIL) { return(results); } } // Click on OK button results = kwm.select_MSG_Button(WDriver, KeyWords.locator_type, KeyWords.locator_button, Confrim_Interview_Model.str_Btn_OK_ConfirmInt); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(13000); results = kwm.select_MSG_Button(WDriver, KeyWords.locator_type, KeyWords.locator_button, Confrim_Interview_Model.str_Btn_OK_ConfirmInt); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(15000); results = kwm.select_MSG_Button(WDriver, KeyWords.locator_type, KeyWords.locator_button, Confrim_Interview_Model.str_Btn_OK_ConfirmInt); if (results.Result1 == KeyWords.Result_FAIL) { return(results); } } } results.Result1 = KeyWords.Result_PASS; results.ErrorMessage = KeyWords.MSG_str_Confirm_Interview_Done; // results.ErrorMessage = "Invoice Batch created Successfully done --> " + strBatchNumberCreated; return(results); }
public void TestStart() { /*string strLogfilePath = System.IO.Directory.GetCurrentDirectory() + "\\Input\\SmartTrack_logfile.txt"; * string strExlInputPath = System.IO.Directory.GetCurrentDirectory() + "\\Input\\SmartTrack_Input.xlsx"; * string strExlOutputPath = System.IO.Directory.GetCurrentDirectory() + "\\Input\\SmartTrack_Output.xlsx";*/ ReadExcel ReadExcelHelper = new ReadExcel(); //Create methods objects CommonMethods objCommonMethods = new CommonMethods(); //Approve objCreate_Approve = new Approve(); IssueWorkOrder objCreate_IssueWorkOrder = new IssueWorkOrder(); KeyWordMethods kwm = new KeyWordMethods(); objCommonMethods.TestCase_Result_OutPutExcel(); string strMainSheetName = "Main$"; //string strMainSql = "SELECT TestCaseId,NumberOfRepeats,DataSheet,Include,Url,Client,UserName FROM [" + strMainSheetName + "] where UserName = '******'"; string strMainSql = "SELECT TestCaseId,NumberOfRepeats,DataSheet,Include,Url,Client,UserName,Browser FROM [" + strMainSheetName + "] where UserName = '******' and Run = 'Yes' and Include = 'Yes'"; objCommonMethods.WriteLogFileBeginHeader(KeyWords.strLogfilePath); var MainSheetResult = new Result(); var AllSheetResult = new Result(); var GetReqNumberResult = new Result(); var TestCaseResult = new Result(); var WriteExlResult = new Result(); var Result_ScreenShot = new Result(); var GetSelectedResult = new Result(); var UpdateSelectedResult = new Result(); var Result_Browser = new Result(); //string strMainSqlquery = "SELECT * FROM [" + strMainSheetName + "] where UserName = '******' and TestCaseId ='009' and Client = 'WELCH ALLYN'"; //TestCaseResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, "Main$", strMainSqlquery); Thread.Sleep(1); objCommonMethods.Update_Table_Data_Database("Update ST_AL_Alert set ForceStatus=0"); MainSheetResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, strMainSheetName, strMainSql); string stralreadyUsingexcel = "The Microsoft Office Access database engine cannot open or write to the file";// ''. It is already opened exclusively by another user, or you need permission to view and write its data"; if (MainSheetResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(5000); MainSheetResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, strMainSheetName, strMainSql); if (MainSheetResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(10000); MainSheetResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, strMainSheetName, strMainSql); if (MainSheetResult.ErrorMessage.Contains(stralreadyUsingexcel)) { } } } if (MainSheetResult.Result1 == Constants.Pass) { foreach (DataRow drowMain in MainSheetResult.dt.Rows) { // Testcase Id include "Yes" in input && Testcase Id is empty checking if ((drowMain[3].ToString().ToUpper() == "YES") && (drowMain[0].ToString() != null) && (drowMain[2].ToString().Trim() != "") && (Convert.ToInt32(drowMain[1]) > 0)) { //Adding new code for supplier new design KeyWords.LoginUser_Role = drowMain[2].ToString(); KeyWords.str_App_Url = drowMain[4].ToString(); DataTable dtExlAllSheet = new DataTable(); string strSubSheetName = drowMain[2].ToString() + "$"; string strSubSql = ""; string strAllorClient = drowMain[5].ToString(); if (strAllorClient.Trim().ToLower() == "all") { strSubSql = "SELECT * FROM [" + strSubSheetName + "] WHERE TestCaseId= '" + drowMain[0].ToString() + "'"; } else { strSubSql = "SELECT top 1 * FROM [" + strSubSheetName + "] WHERE TestCaseId= '" + drowMain[0].ToString() + "' and P3 = '" + drowMain[5].ToString() + "'and TestExecute = 'yes'"; } AllSheetResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, strSubSheetName, strSubSql); if (AllSheetResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(5000); AllSheetResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, strSubSheetName, strSubSql); if (AllSheetResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(10000); AllSheetResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, strSubSheetName, strSubSql); if (AllSheetResult.ErrorMessage.Contains(stralreadyUsingexcel)) { } } } string[] strDataArray = new string[5]; string[] strColArray = new string[5]; if (AllSheetResult.dt.Rows.Count > 0) { strDataArray = new string[AllSheetResult.dt.Rows[0].ItemArray.Length]; strColArray = new string[AllSheetResult.dt.Rows[0].ItemArray.Length]; } // Number of counts repated in Main sheet for (int iLoop = 1; iLoop <= Convert.ToInt32(drowMain[1]); iLoop++) { string strUpdateSqlMain = "Update [Main$] set Run = 'P' WHERE TestCaseId= '009' and Client ='" + drowMain[5].ToString() + "'"; WriteExlResult = ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSqlMain); if (WriteExlResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(5000); WriteExlResult = ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSqlMain); if (WriteExlResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(10000); WriteExlResult = ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSqlMain); if (WriteExlResult.ErrorMessage.Contains(stralreadyUsingexcel)) { } } } string strLoginUser = string.Empty; string strLoginUser1 = string.Empty; if (AllSheetResult.dt.Rows.Count > 0) { //Number of testcases for each Testcase ID for (int iSubRowLoop = 0; iSubRowLoop < AllSheetResult.dt.Rows.Count; iSubRowLoop++) { if (iSubRowLoop == 0) { //Added new browser code KeyWords.str_Browser_Execute = drowMain[7].ToString(); Result_Browser = kwm.Choose_Browser(driver, drowMain[7].ToString().ToLower()); if (Result_Browser.Result1 == KeyWords.Result_PASS) { driver = Result_Browser.driver; } //if (AllSheetResult.dt.Rows[iSubRowLoop]["P1"].ToString().ToLower() == Constants.Chrome) //{ // driver = Constants.CreateChromeDriver(driver); //} //else if (AllSheetResult.dt.Rows[iSubRowLoop]["P1"].ToString().ToLower() == Constants.IE) //{ // driver = new InternetExplorerDriver(@System.IO.Directory.GetCurrentDirectory()); // driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(120)); //} //else //{ // //driver = new RemoteWebDriver(DesiredCapabilities.HtmlUnit()); // driver = new FirefoxDriver(); // driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(120)); //} } for (int c = 0; c < AllSheetResult.dt.Rows[iSubRowLoop].ItemArray.Length; c++) { strColArray[c] = AllSheetResult.dt.Columns[c].ColumnName.ToString(); strDataArray[c] = AllSheetResult.dt.Rows[iSubRowLoop][c].ToString(); } if (AllSheetResult.dt.Rows[iSubRowLoop][0].ToString() != Constants.TestCase002) { Stopwatch stopwatch = System.Diagnostics.Stopwatch.StartNew(); string strEmail = ""; strEmail = strDataArray[AllSheetResult.dt.Columns.IndexOf("P1")]; string strTermsConditions = "update st_lm_user set tcflag = 1 where username like '" + strEmail + "'"; objCommonMethods.Update_Table_Data_Database(strTermsConditions); //string strUpdatePassword = "******" + strEmail + "')"; // objCommonMethods.Update_Table_Data_Database(strUpdatePassword); objCommonMethods.Validate_Password_Update(strEmail, strDataArray[AllSheetResult.dt.Columns.IndexOf("P2")]); string strUpdateSql = "Update [MSP$] set TestExecute = 'P' WHERE TestCaseId= '009' and P6 = '" + AllSheetResult.dt.Rows[iSubRowLoop]["P6"].ToString() + "' and P3 ='" + AllSheetResult.dt.Rows[iSubRowLoop]["P3"].ToString() + "'"; WriteExlResult = ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSql); if (WriteExlResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(5000); WriteExlResult = ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSql); if (WriteExlResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(10000); WriteExlResult = ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSql); if (WriteExlResult.ErrorMessage.Contains(stralreadyUsingexcel)) { } } } // TestCaseResult = objCommonMethods.TestCase_Login_Execution_NewApp(driver, AllSheetResult, KeyWords.strLogfilePath, KeyWords.strExlOutputPath, iSubRowLoop, strColArray, strDataArray, iLoop, drowMain[1].ToString(), AllSheetResult.dt.Rows[iSubRowLoop][0].ToString()); stopwatch.Stop(); //intWasteTime = intWasteTime + stopwatch.Elapsed.Seconds; Console.WriteLine("Login Time " + stopwatch.Elapsed.Seconds); objCommonMethods.WriteLogFileTestCaseErrorResult(KeyWords.strLogfilePath, "Login Time " + stopwatch.Elapsed.Seconds, 3); if (TestCaseResult.Result1 == KeyWords.Result_FAIL) { break; } } switch (AllSheetResult.dt.Rows[iSubRowLoop][0].ToString()) { case Constants.TestCase009: { string strREQNumber = AllSheetResult.dt.Rows[iSubRowLoop]["P6"].ToString(); string strClientSubmitUserName = AllSheetResult.dt.Rows[iSubRowLoop]["P8"].ToString(); if (strREQNumber != "") { // TestCaseResult = objCreate_IssueWorkOrder.IssueWorkOrder_Method(driver, AllSheetResult.dt.Rows[iSubRowLoop], MSPexecutionNo); if (TestCaseResult.Result1 == KeyWords.Result_PASS) { string[] strDataArray1 = new string[5]; string[] strColArray1 = new string[5]; string strSubSql12 = "SELECT * FROM [all$] WHERE TestCaseId= '010' and P3 ='" + AllSheetResult.dt.Rows[iSubRowLoop]["P3"].ToString() + "'"; GetSelectedResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, "All$", strSubSql12); if (GetSelectedResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(5000); GetSelectedResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, "All$", strSubSql12); if (GetSelectedResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(10000); GetSelectedResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, "All$", strSubSql12); if (GetSelectedResult.ErrorMessage.Contains(stralreadyUsingexcel)) { } } } if (GetSelectedResult.dt.Rows.Count > 0) { if (GetSelectedResult.dt.Rows.Count > 0) { strDataArray1 = new string[GetSelectedResult.dt.Rows[0].ItemArray.Length]; strColArray1 = new string[GetSelectedResult.dt.Rows[0].ItemArray.Length]; } for (int c = 0; c <= GetSelectedResult.dt.Rows[0].ItemArray.Length - 1; c++) { if (GetSelectedResult.dt.Columns[c].ColumnName.ToString() == "P6") { strColArray1[c] = GetSelectedResult.dt.Columns[c].ColumnName.ToString(); strDataArray1[c] = strREQNumber; } else if (GetSelectedResult.dt.Columns[c].ColumnName.ToString() == "P8") { strColArray1[c] = GetSelectedResult.dt.Columns[c].ColumnName.ToString(); strDataArray1[c] = strClientSubmitUserName; } else { strColArray1[c] = GetSelectedResult.dt.Columns[c].ColumnName.ToString(); strDataArray1[c] = GetSelectedResult.dt.Rows[0][c].ToString(); } } GetSelectedResult = ReadExcelHelper.WriteDataToExcelFileSelected(KeyWords.strExlInputPath, "Supplier", strColArray1, strDataArray1); } strUpdateSqlMain = "Update [Main$] set Run = 'Yes' WHERE TestCaseId= '010' and Client ='" + AllSheetResult.dt.Rows[iSubRowLoop]["P3"].ToString() + "'"; WriteExlResult = ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSqlMain); if (WriteExlResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(5000); WriteExlResult = ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSqlMain); if (WriteExlResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(10000); WriteExlResult = ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSqlMain); if (WriteExlResult.ErrorMessage.Contains(stralreadyUsingexcel)) { } } } kwm.Logout_Link_Click_NewUI(driver, "Logout"); string strExecutepath = @System.IO.Directory.GetCurrentDirectory(); if (KeyWords.strNunitConsolePath == "") { KeyWords.strNunitConsolePath = Constants.NunitConsolePath; // KeyWords.strNunitConsolePath = ""; } ProcessStartInfo start = new ProcessStartInfo(); start.Arguments = strExecutepath + Constants.NunitSupplierAWOBinPath; start.FileName = KeyWords.strNunitConsolePath; Process.Start(start); // System.Diagnostics.Process.Start(strExecutepath + "\\ExecuteScripts\\testrun_Supplier_AWO.bat"); } else { kwm.select_MSG_Button(driver, KeyWords.locator_type, KeyWords.locator_button, Constants.No); kwm.select_MSG_Button(driver, KeyWords.locator_type, KeyWords.locator_button, Constants.cancel); kwm.select_MSG_Button(driver, KeyWords.locator_type, KeyWords.locator_button, "close"); } TestCaseResult = objCommonMethods.TestCase_Result_Execution(driver, AllSheetResult, TestCaseResult, KeyWords.strLogfilePath, KeyWords.strExlOutputPath, iSubRowLoop, strColArray, strDataArray, iLoop, drowMain[1].ToString()); } else { TestCaseResult.Result1 = KeyWords.Result_FAIL; TestCaseResult.ErrorMessage = "Input REQ number is empty"; TestCaseResult = objCommonMethods.TestCase_Result_Execution(driver, AllSheetResult, TestCaseResult, KeyWords.strLogfilePath, KeyWords.strExlOutputPath, iSubRowLoop, strColArray, strDataArray, iLoop, drowMain[1].ToString()); } break; } default: { break; } } //Switch case End here } //No of sub test cases for loop driver.Close(); } else { // Selected testcase id input data not avalibale } } } } } else { Console.WriteLine(MainSheetResult.ErrorMessage); objCommonMethods.WriteLogFileTestCaseHeaders(KeyWords.strLogfilePath, MainSheetResult.ErrorMessage, 1, "yes"); objCommonMethods.WriteLogFileTestCaseHeaders(KeyWords.strLogfilePath, MainSheetResult.ErrorMessage, 2, "no"); } objCommonMethods.WriteLogFileEndHeader(KeyWords.strLogfilePath); }
public Result RequisitionAge_Method(IWebDriver WDriver, DataRow Requisition_Data, int a) { KeyWordMethods kwm = new KeyWordMethods(); ReadExcel ReadExcelHelper_local = new ReadExcel(); kwm._WDWait = kwm.WebDriver_Wait_Handler(WDriver, 60); CommonMethods objCommonMethods = new CommonMethods(); var results = new Result(); var Result_ScreenShot = new Result(); List <string> listExistClients = new List <string>() { }; List <string> str_list_SupplierMailId = new List <string>(); CreateRequirementRepository createRequirementRepository = new CreateRequirementRepository(); BroadcastModel broadcastModel = createRequirementRepository.GetBroadcastData(Requisition_Data); listExistClients = new List <string>() { Constants.Discover }; if (listExistClients.Contains(broadcastModel.strClientName.ToLower())) { results = kwm.Client_Change_Click_NewApp_Discover(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, broadcastModel.strClientName); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(5000); results = kwm.Client_Change_Click_NewApp_Discover(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, broadcastModel.strClientName); if (results.Result1 == KeyWords.Result_FAIL) { Boolean bFlagDropDwon = false; try { // bFlagDropDwon = WDriver.FindElement(By.XPath(KeyWords.XPath_supplierMenu_ClientDropDown)).Enabled; bFlagDropDwon = kwm.isElementEnabledByXPath(WDriver, KeyWords.XPath_supplierMenu_ClientDropDown); } catch { bFlagDropDwon = false; } if (bFlagDropDwon) { return(results); } } } } listExistClients = new List <string>() { Constants.Discover }; if (!listExistClients.Contains(broadcastModel.strClientName.ToLower())) { results = kwm.Client_Change_Click_NewApp(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, broadcastModel.strClientName); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(5000); results = kwm.Client_Change_Click_NewApp(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, broadcastModel.strClientName); if (results.Result1 == KeyWords.Result_FAIL) { Boolean bFlagDropDwon = false; try { // bFlagDropDwon = WDriver.FindElement(By.XPath(KeyWords.XPath_supplierMenu_ClientDropDown)).Enabled; bFlagDropDwon = kwm.isElementEnabledByXPath(WDriver, KeyWords.XPath_supplierMenu_ClientDropDown); } catch { bFlagDropDwon = false; } if (bFlagDropDwon) { return(results); } } } } objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); results = kwm.Main_Sub_Menu_Click_NewApp(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, broadcastModel.strMainMenuLink, broadcastModel.strSubMenuLink); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(5000); results = kwm.Main_Sub_Menu_Click_NewApp(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, broadcastModel.strMainMenuLink, broadcastModel.strSubMenuLink); if (results.Result1 == KeyWords.Result_FAIL) { //results.ErrorMessage1 = "Unable to click on the Main menu"; return(results); } } if (broadcastModel.strSubMenuLink.ToLower().Contains("identified")) { if (!kwm.waitForElementExists(WDriver, By.XPath("//table[@id='IdentifiedReqList']//tbody//tr"), kwm._WDWait)) { Thread.Sleep(2000); } } else { if (!kwm.waitForElementExists(WDriver, By.XPath("//table[@id='regReqList']//tbody//tr"), kwm._WDWait)) { Thread.Sleep(2000); } } //Search requirement kwm.sendText_XPath(WDriver, KeyWords.locator_XPath, KeyWords.XPath_SearchBox_Requirements_regReqList, broadcastModel.str_Link_ReqNumber, broadcastModel.str_Link_ReqNumber, false); //Wait for Requirement to load if (!kwm.waitForElementToBeVisible(WDriver, By.XPath(KeyWords.XPath_Img_Processing), kwm._WDWait)) { kwm.waitForElementToBeClickable(WDriver, By.XPath("//table[@id='regReqList']//td/a[contains(text(),'" + broadcastModel.str_Link_ReqNumber + "')]"), kwm._WDWait); } objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); // /* only for test string RequisitionAge = kwm.ReqAge(WDriver, "Requisition Age")._Var; int Age = Int32.Parse(RequisitionAge); //Click on Requirement Link kwm.click(WDriver, KeyWords.locator_XPath, "//table[@id='regReqList']//td/a[contains(text(),'" + broadcastModel.str_Link_ReqNumber + "')]"); //WDriver.FindElement(By.XPath("//table[@id='regReqList']//td/a[contains(text(),'" + broadcastModel.str_Link_ReqNumber + "')]")).Click(); //wait for page to load kwm.waitForElementExists(WDriver, By.XPath(KeyWords.XPath_OverlayLoader), kwm._WDWait); //Wait for broadcast link to be Displayed kwm.waitForElementToBeVisible(WDriver, By.XPath(KeyWords.XPath_ActionListMenu_Broadcast_reqBroadcast), kwm._WDWait); kwm.click(WDriver, KeyWords.locator_ID, KeyWords.ID_tabsAll); kwm.Action_LookInto_Element(WDriver, KeyWords.locator_XPath, KeyWords.Xpath_Date_ApprovalLog_CreateDate); //kwm.waitForElementToBeClickable(WDriver, By.XPath(KeyWords.Xpath_Date_ApprovalLog_CreateDate), kwm._WDWait); string Date = WDriver.FindElement(By.XPath("//*[@id='Table4']//tr[@class = 'altOdd skillrow odd']/td[1]")).Text; string[] date = Date.Split(' '); string CreatedDate = date[0]; DateTime myDate = DateTime.ParseExact(CreatedDate, "MM/dd/yyyy", System.Globalization.CultureInfo.InvariantCulture); DateTime todaydate = DateTime.Now; int RequisitionAge_days = (todaydate.Date - myDate.Date).Days; if (Age == RequisitionAge_days) { } else { results.Result1 = KeyWords.Result_FAIL; return(results); } try { //kwm.waitForElementExists(WDriver, By.Id("tblSuppliers"), kwm._WDWait); //kwm.waitForElementToBeVisible(WDriver, By.Id("tblSuppliers"), kwm._WDWait); Thread.Sleep(10000); for (int t1 = 0; t1 < 100; t1++) { if (kwm.isElementDisplayed(WDriver, "tblSuppliers")) { Thread.Sleep(100); break; } } //Verify if the supplier table is displayed } catch (Exception e) { objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); results.ErrorMessage = e.Message; results.Result1 = KeyWords.Result_FAIL; return(results); } //wait for page to load kwm.waitForElementExists(WDriver, By.XPath(KeyWords.XPath_OverlayLoader), kwm._WDWait); if (!kwm.isElementDisplayedByXPath(WDriver, KeyWords.XPath_OverlayLoader)) { kwm.waitForElementToBeVisible(WDriver, By.XPath(KeyWords.XPath_OverlayLoader), kwm._WDWait); } kwm.waitForElementToBeVisible(WDriver, By.XPath(KeyWords.XPath_ActionListMenu_BroadcastDetails_reqBroadcastDetails), kwm._WDWait); if (kwm.isElementDisplayedByXPath(WDriver, KeyWords.XPath_ActionListMenu_BroadcastDetails_reqBroadcastDetails)) { objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); results.ErrorMessage = "Broadcast is successfull"; results.listData = str_list_SupplierMailId; results.Result1 = KeyWords.Result_PASS; return(results); } return(results); //---------------------------------------------------------------------------------------- }
public Result Broadcast_Method(IWebDriver WDriver, DataRow Broadcast_Data, int a) { KeyWordMethods kwm = new KeyWordMethods(); ReadExcel ReadExcelHelper_local = new ReadExcel(); kwm._WDWait = kwm.WebDriver_Wait_Handler(WDriver, 60); CommonMethods objCommonMethods = new CommonMethods(); var results = new Result(); var Result_ScreenShot = new Result(); List <string> listExistClients = new List <string>() { }; List <string> str_list_SupplierMailId = new List <string>(); CreateRequirementRepository createRequirementRepository = new CreateRequirementRepository(); BroadcastModel broadcastModel = createRequirementRepository.GetBroadcastData(Broadcast_Data); BroadCastActions broadCastActions = new BroadCastActions(); listExistClients = new List <string>() { Constants.Discover }; if (listExistClients.Contains(broadcastModel.strClientName.ToLower())) { results = kwm.Client_Change_Click_NewApp_Discover(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, broadcastModel.strClientName); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(5000); results = kwm.Client_Change_Click_NewApp_Discover(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, broadcastModel.strClientName); if (results.Result1 == KeyWords.Result_FAIL) { Boolean bFlagDropDwon = false; try { // bFlagDropDwon = WDriver.FindElement(By.XPath(KeyWords.XPath_supplierMenu_ClientDropDown)).Enabled; bFlagDropDwon = kwm.isElementEnabledByXPath(WDriver, KeyWords.XPath_supplierMenu_ClientDropDown); } catch { bFlagDropDwon = false; } if (bFlagDropDwon) { return(results); } } } } listExistClients = new List <string>() { Constants.Discover }; if (!listExistClients.Contains(broadcastModel.strClientName.ToLower())) { results = kwm.Client_Change_Click_NewApp(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, broadcastModel.strClientName); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(5000); results = kwm.Client_Change_Click_NewApp(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, broadcastModel.strClientName); if (results.Result1 == KeyWords.Result_FAIL) { Boolean bFlagDropDwon = false; try { // bFlagDropDwon = WDriver.FindElement(By.XPath(KeyWords.XPath_supplierMenu_ClientDropDown)).Enabled; bFlagDropDwon = kwm.isElementEnabledByXPath(WDriver, KeyWords.XPath_supplierMenu_ClientDropDown); } catch { bFlagDropDwon = false; } if (bFlagDropDwon) { return(results); } } } } objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); results = kwm.Main_Sub_Menu_Click_NewApp(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, broadcastModel.strMainMenuLink, broadcastModel.strSubMenuLink); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(5000); results = kwm.Main_Sub_Menu_Click_NewApp(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, broadcastModel.strMainMenuLink, broadcastModel.strSubMenuLink); if (results.Result1 == KeyWords.Result_FAIL) { //results.ErrorMessage1 = "Unable to click on the Main menu"; return(results); } } // /* only for test if (!kwm.waitForElementExists(WDriver, By.XPath("//table[@id='regReqList']//tbody//tr"), kwm._WDWait)) { Thread.Sleep(2000); } //Search requirement kwm.sendText_XPath(WDriver, KeyWords.locator_XPath, KeyWords.XPath_SearchBox_Requirements_regReqList, broadcastModel.str_Link_ReqNumber, broadcastModel.str_Link_ReqNumber, false); Thread.Sleep(5000); //Wait for Requirement to load if (!kwm.waitForElementToBeVisible(WDriver, By.XPath("//table[@id='regReqList']//td/a[contains(text(),'" + broadcastModel.str_Link_ReqNumber + "')]"), kwm._WDWait)) { kwm.waitForElementToBeClickable(WDriver, By.XPath("//table[@id='regReqList']//td/a[contains(text(),'" + broadcastModel.str_Link_ReqNumber + "')]"), kwm._WDWait); } objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); Thread.Sleep(5000); //Click on Requirement Link kwm.click(WDriver, KeyWords.locator_XPath, "//table[@id='regReqList']//td/a[contains(text(),'" + broadcastModel.str_Link_ReqNumber + "')]"); //WDriver.FindElement(By.XPath("//table[@id='regReqList']//td/a[contains(text(),'" + broadcastModel.str_Link_ReqNumber + "')]")).Click(); //wait for page to load kwm.waitForElementExists(WDriver, By.XPath(KeyWords.XPath_OverlayLoader), kwm._WDWait); //Wait for broadcast link to be Displayed kwm.waitForElementToBeVisible(WDriver, By.XPath(KeyWords.XPath_ActionListMenu_Broadcast_reqBroadcast), kwm._WDWait); //Click on Broadcast menu link kwm.jsClick(WDriver, KeyWords.locator_XPath, KeyWords.XPath_ActionListMenu_Broadcast_reqBroadcast); //Wait for form to load Thread.Sleep(1000); if (kwm.isElementDisplayedByXPath(WDriver, "//div[@aria-labelledby='ui-dialog-title-PleaseWaitPopup' and contains(@style,'display: none')]")) { kwm.waitForElementToBeVisible(WDriver, By.XPath("//div[@aria-labelledby='ui-dialog-title-PleaseWaitPopup' and contains(@style,'display: none')]"), kwm._WDWait); } objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); //Click on Distribution List if (kwm.isElementDisplayedByXPath(WDriver, KeyWords.XPath_li_DistributionList)) { kwm.jsClick(WDriver, KeyWords.locator_XPath, KeyWords.XPath_li_DistributionList); } //Wait for dialog box if (!kwm.isElementDisplayedByXPath(WDriver, KeyWords.XPath_MsgBox_DistributionListPopup)) { kwm.waitForElementToBeVisible(WDriver, By.XPath(KeyWords.XPath_MsgBox_DistributionListPopup), kwm._WDWait); } objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); listExistClients = new List <string>() { Constants.EQT }; if (listExistClients.Contains(broadcastModel.strClientName.ToLower())) { // Bill Rates(USD) * if (broadcastModel.str_txt_BillRatesUSD_ddlBillratesHigh != "") { kwm.sendText(WDriver, KeyWords.locator_ID, KeyWords.ID_txt_BillRatesUSD_ddlBillratesHigh, broadcastModel.str_txt_BillRatesUSD_ddlBillratesHigh, false); if (results.Result1 == KeyWords.Result_FAIL) { kwm.sendText(WDriver, KeyWords.locator_ID, KeyWords.ID_txt_BillRatesUSD_ddlBillratesHigh, broadcastModel.str_txt_BillRatesUSD_ddlBillratesHigh, false); } } } //wait for distrubution dropdown list if (kwm.isElementDisplayed(WDriver, KeyWords.ID_MsgBox_Select_DistributionList_ddlDistList)) { //select the value by index in distrubution dropdown list //kwm.selectByIndex(WDriver, KeyWords.locator_ID, KeyWords.ID_MsgBox_Select_DistributionList_ddlDistList, 1); if (broadcastModel.strClientName.ToLower() == Constants.Welchallyn || broadcastModel.strClientName.ToLower() == Constants.Tesla) { kwm.select(WDriver, KeyWords.locator_ID, KeyWords.ID_MsgBox_Select_DistributionList_ddlDistList, broadcastModel.str_Select_DistributionList); } else { //select the value by index in distrubution dropdown list kwm.selectByIndex(WDriver, KeyWords.locator_ID, KeyWords.ID_MsgBox_Select_DistributionList_ddlDistList, 1); } //wait for tier dropdown to load kwm.waitForElementToBeVisible(WDriver, By.Id(KeyWords.ID_MsgBox_Select_Tiers_ddlTiers), kwm._WDWait); //select the value by index in distrubution dropdown list results = kwm.select(WDriver, KeyWords.locator_ID, KeyWords.ID_Select_ddlTiers, broadcastModel.str_Select_Tier); if (results.Result1 == KeyWords.Result_FAIL) { //select the value by index in distrubution dropdown list kwm.selectByIndex(WDriver, KeyWords.locator_ID, KeyWords.ID_MsgBox_Select_Tiers_ddlTiers, 1); } try { //kwm.waitForElementExists(WDriver, By.Id("tblSuppliers"), kwm._WDWait); //kwm.waitForElementToBeVisible(WDriver, By.Id("tblSuppliers"), kwm._WDWait); Thread.Sleep(4000); for (int t1 = 0; t1 < 100; t1++) { if (kwm.isElementDisplayed(WDriver, "tblSuppliers")) { Thread.Sleep(100); break; } } //Verify if the supplier table is displayed if (kwm.isElementDisplayedXpath(WDriver, "//*[@id='tblSuppliers_filter']/label/input")) { //Move to supplier list kwm.Action_LookInto_Element(WDriver, KeyWords.locator_ID, "tblSuppliers"); objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); // kwm.waitForElementToBeVisible(WDriver, By.XPath("//table[@id='tblSuppliers']//tr//th[@fieldname='primaryEmail']"), kwm._WDWait); //Verify Email Header is displayed if (kwm.isElementDisplayedByXPath(WDriver, "//table[@id='tblSuppliers']//tbody//tr[1]//input")) { // kwm.waitForElementToBeClickable(WDriver, By.XPath("//table[@id='tblSuppliers']//tr//th[@fieldname='primaryEmail']"), kwm._WDWait); //Need to check if the check box is selected or not //pending- end if (WDriver.FindElements(By.XPath("//table[@id='tblSuppliers']//tbody//tr")).ToList().Count > 0) { String setEmailXpath; //Get the attribute value of the email field String strVal = WDriver.FindElement(By.XPath("//table[@id='tblSuppliers']//tr//th[@fieldname='primaryEmail']")).GetAttribute("style"); //verifying if it is displayed on the screen load or not if (strVal.ToLower().Contains("display: none;")) { //setEmailXpath = "//table[@id='tblSuppliers']//tbody/tr//td[@id='iconTable']"; //foreach (IWebElement ele in WDriver.FindElements(By.XPath(setEmailXpath)).ToList()) //{ // ele.Click(); // // Actions action = new Actions(WDriver); // objCommonMethods.Action_Button_Enter(WDriver); // // action.SendKeys(Keys.Enter).Build().Perform(); // Thread.Sleep(1000); // //Add supplier mail id's to list // str_list_SupplierMailId.Add(kwm.GetText_Xpath(WDriver, "//table[@id='tblSuppliers']//tbody/tr/following-sibling::tr[@class='child']//span[normalize-space(text())='Email']/following-sibling::*[@class='dtr-data']")._Var); // // action.SendKeys(Keys.Enter).Build().Perform(); // objCommonMethods.Action_Button_Enter(WDriver); // Thread.Sleep(1000); // ele.Click(); //} kwm.jsCommand_Click(WDriver, "$('#tblSuppliers tbody tr td:first-child').click()"); setEmailXpath = "//table[@id='tblSuppliers']//tbody/tr[@class='child']//span[normalize-space(text())='Email']/following-sibling::*[@class='dtr-data' and contains(text(),'@hcmondemand.net')]"; //"//table[@id='tblSuppliers']//tbody/tr//td[@id='iconTable']"; foreach (IWebElement ele in WDriver.FindElements(By.XPath(setEmailXpath)).ToList()) { //Add supplier mail id's to list str_list_SupplierMailId.Add(ele.Text); } } else { setEmailXpath = "//table[@id='tblSuppliers']//tbody//tr[@role='row']//td//self::*[contains(text(),'@')]"; foreach (IWebElement ele in WDriver.FindElements(By.XPath(setEmailXpath)).ToList()) { //Add supplier mail id's to list str_list_SupplierMailId.Add(ele.Text); } } objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); //click on broadcast button kwm.jsClick(WDriver, KeyWords.locator_XPath, KeyWords.XPath_MsgBox_Btn_Broadcast_Broadcast); if (kwm.waitForElementToBeClickable(WDriver, By.XPath(KeyWords.XPath_MsgBox_ConfirmSuppliers_Btn_Yes_Yes), kwm._WDWait)) { objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); //click on yes button on confirm supplier popup kwm.jsClick(WDriver, KeyWords.locator_XPath, KeyWords.XPath_MsgBox_ConfirmSuppliers_Btn_Yes_Yes); kwm.waitForElementToBeVisible(WDriver, By.XPath(KeyWords.XPath_MsgBox_dlgBroadcastSent_Btn_OK_OK), kwm._WDWait); objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); //Click on Ok button results = kwm.click(WDriver, KeyWords.locator_XPath, KeyWords.XPath_MsgBox_dlgBroadcastSent_Btn_OK_OK); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(5000); kwm.waitForElementToBeVisible(WDriver, By.XPath(KeyWords.XPath_MsgBox_dlgBroadcastSent_Btn_OK_OK), kwm._WDWait); kwm.click(WDriver, KeyWords.locator_XPath, KeyWords.XPath_MsgBox_dlgBroadcastSent_Btn_OK_OK); } } else { objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); results.ErrorMessage = "Yes button is not displayed/clickable"; results.Result1 = KeyWords.Result_FAIL; return(results); } } else { objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); results.ErrorMessage = "List count is 0 i.e no mail id's are added to the list"; results.Result1 = KeyWords.Result_FAIL; return(results); } } else { objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); results.ErrorMessage = "No Mail's displayed for the selected suppliers"; results.Result1 = KeyWords.Result_FAIL; return(results); } } else { objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); results.ErrorMessage = "Supplier table is Not displayed "; results.Result1 = KeyWords.Result_FAIL; return(results); } } catch (Exception e) { objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); results.ErrorMessage = e.Message; results.Result1 = KeyWords.Result_FAIL; return(results); } } else { objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); results.ErrorMessage = "Distribution Dropdown is not displayed/selected"; results.Result1 = KeyWords.Result_FAIL; return(results); } //wait for page to load kwm.waitForElementExists(WDriver, By.XPath(KeyWords.XPath_OverlayLoader), kwm._WDWait); if (!kwm.isElementDisplayedByXPath(WDriver, KeyWords.XPath_OverlayLoader)) { kwm.waitForElementToBeVisible(WDriver, By.XPath(KeyWords.XPath_OverlayLoader), kwm._WDWait); } kwm.waitForElementToBeVisible(WDriver, By.XPath(KeyWords.XPath_ActionListMenu_BroadcastDetails_reqBroadcastDetails), kwm._WDWait); if (kwm.isElementDisplayedByXPath(WDriver, KeyWords.XPath_ActionListMenu_BroadcastDetails_reqBroadcastDetails)) { //broadCastActions.addComments(WDriver, Broadcast_Data, "TxtComment"); //broadCastActions.broadacastDetails(WDriver, Broadcast_Data); //broadCastActions.openDiscussion(WDriver, Broadcast_Data, "Gordon, James"); //broadCastActions.ReBroadcast_Method(WDriver, Broadcast_Data); //broadCastActions.saveAsCatalog(WDriver, Broadcast_Data); //broadCastActions.recallRequisition(WDriver, Broadcast_Data); //broadCastActions.requeueMethod(WDriver, Broadcast_Data, "Hemphill, Jeffrey", "Gordon, James"); //broadCastActions.cancelRequisition(WDriver, Broadcast_Data); //broadCastActions.changeStatus(WDriver, Broadcast_Data, "New"); //broadCastActions.reOpenRequistion(WDriver, Broadcast_Data); //broadCastActions.convertRequisitionToPayroll(WDriver, Broadcast_Data); //broadCastActions.assignMspPoc(WDriver, Broadcast_Data); //broadCastActions.sendReminder(WDriver, Broadcast_Data); //broadCastActions.viewETKDetails(WDriver, Broadcast_Data); objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); results.ErrorMessage = "Broadcast is successfull"; results.listData = str_list_SupplierMailId; results.Result1 = KeyWords.Result_PASS; return(results); } return(results); //---------------------------------------------------------------------------------------- //Edit method calling string strSubLevel = "./label"; objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); if (broadcastModel.str_Link_Edit != "") { results = kwm.list_Menu_Click(WDriver, KeyWords.locator_ID, KeyWords.ID_List_listMenu1, broadcastModel.str_Link_Edit, strSubLevel); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(2000); results = kwm.list_Menu_Click(WDriver, KeyWords.locator_ID, KeyWords.ID_List_listMenu1, broadcastModel.str_Link_Edit, strSubLevel); if (results.Result1 == KeyWords.Result_FAIL) { return(results); } } } }
public void TestStart() { /*string strLogfilePath = System.IO.Directory.GetCurrentDirectory() + "\\Input\\SmartTrack_logfile.txt"; * string strExlInputPath = System.IO.Directory.GetCurrentDirectory() + "\\Input\\SmartTrack_Input.xlsx"; * string strExlOutputPath = System.IO.Directory.GetCurrentDirectory() + "\\Input\\SmartTrack_Output.xlsx";*/ // Console.WriteLine(System.IO.("../Input/SmartTrack_logfile.txt")); ReadExcel ReadExcelHelper = new ReadExcel(); //Create methods objects CommonMethods objCommonMethods = new CommonMethods(); //Approve objCreate_Approve = new Approve(); SubmitCandidate objCreate_SubmitCandidate = new SubmitCandidate(); KeyWordMethods kwm = new KeyWordMethods(); objCommonMethods.TestCase_Result_OutPutExcel(); string strMainSheetName = "Main$"; // string strMainSql = "SELECT TestCaseId,NumberOfRepeats,DataSheet,Include,Url,Client,UserName FROM [" + strMainSheetName + "] where UserName = '******'"; string strMainSql = "SELECT TestCaseId,NumberOfRepeats,DataSheet,Include,Url,Client,UserName,NumOfCan,WhereToStart,Browser FROM [" + strMainSheetName + "] where UserName = '******' and Run = 'Yes' and Include = 'Yes'"; objCommonMethods.WriteLogFileBeginHeader(KeyWords.strLogfilePath); var MainSheetResult = new Result(); var AllSheetResult = new Result(); var GetReqNumberResult = new Result(); var TestCaseResult = new Result(); var WriteExlResult = new Result(); var Result_ScreenShot = new Result(); var GetSelectedResult = new Result(); var Result_Browser = new Result(); //TestCaseResult = objCommonMethods.Get_Table_Data_Database("select a.approveremail from ST_MS_WF_ReqQueue a join ST_MS_WF_ReqWorkflow b on a.requirementid=b.requirementid and b.reqapproverid =a.reqsenttoapproverid where b.requirementid=21081 and b.clientid=21", "approveremail"); //string iUserID = ""; //if (TestCaseResult.listData.Count >= 1) //{ // iUserID = TestCaseResult.listData[0]; //} Thread.Sleep(1); // objCommonMethods.Update_Table_Data_Database("Update ST_AL_Alert set ForceStatus=0"); MainSheetResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, strMainSheetName, strMainSql); string stralreadyUsingexcel = "The Microsoft Office Access database engine cannot open or write to the file";// ''. It is already opened exclusively by another user, or you need permission to view and write its data"; if (MainSheetResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(5000); MainSheetResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, strMainSheetName, strMainSql); if (MainSheetResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(10000); MainSheetResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, strMainSheetName, strMainSql); if (MainSheetResult.ErrorMessage.Contains(stralreadyUsingexcel)) { } } } if (MainSheetResult.Result1 == "Pass") { foreach (DataRow drowMain in MainSheetResult.dt.Rows) { // Testcase Id include "Yes" in input && Testcase Id is empty checking if ((drowMain[3].ToString().ToUpper() == "YES") && (drowMain[0].ToString() != null) && (drowMain[2].ToString().Trim() != "") && (Convert.ToInt32(drowMain[1]) > 0)) { // Reading the All sheet selected Testcase ID //Adding new code for supplier new design KeyWords.LoginUser_Role = drowMain[2].ToString(); KeyWords.str_App_Url = drowMain[4].ToString(); DataTable dtExlAllSheet = new DataTable(); string strSubSheetName = drowMain[2].ToString() + "$"; string strSubSql = ""; string strAllorClient = drowMain[5].ToString(); if (strAllorClient.Trim().ToLower() == "all") { strSubSql = "SELECT * FROM [" + strSubSheetName + "] WHERE TestCaseId= '" + drowMain[0].ToString() + "'"; } else { strSubSql = "SELECT top 1 * FROM [" + strSubSheetName + "] WHERE TestCaseId= '" + drowMain[0].ToString() + "' and P3 = '" + drowMain[5].ToString() + "'and TestExecute = 'yes'"; } AllSheetResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, strSubSheetName, strSubSql); if (AllSheetResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(5000); AllSheetResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, strSubSheetName, strSubSql); if (AllSheetResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(10000); AllSheetResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, strSubSheetName, strSubSql); if (AllSheetResult.ErrorMessage.Contains(stralreadyUsingexcel)) { } } } string[] strDataArray = new string[5]; string[] strColArray = new string[5]; if (AllSheetResult.dt.Rows.Count > 0) { strDataArray = new string[AllSheetResult.dt.Rows[0].ItemArray.Length]; strColArray = new string[AllSheetResult.dt.Rows[0].ItemArray.Length]; } // Number of counts repated in Main sheet for (int iLoop = 1; iLoop <= Convert.ToInt32(drowMain[1]); iLoop++) { string strUpdateSqlMain = ""; //string strUpdateSqlMain = "Update [Main$] set Run = 'P' WHERE TestCaseId= '004' and Client ='" + drowMain[5].ToString() + "'"; // ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSqlMain); WriteExlResult = ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSqlMain); if (WriteExlResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(5000); WriteExlResult = ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSqlMain); if (WriteExlResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(10000); WriteExlResult = ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSqlMain); if (WriteExlResult.ErrorMessage.Contains(stralreadyUsingexcel)) { } } } string strLoginUser = string.Empty; string strLoginUser1 = string.Empty; if (AllSheetResult.dt.Rows.Count > 0) { //Number of testcases for each Testcase ID for (int iSubRowLoop = 0; iSubRowLoop < AllSheetResult.dt.Rows.Count; iSubRowLoop++) { if (iSubRowLoop == 0) { //Added new browser code KeyWords.str_Browser_Execute = drowMain[9].ToString(); Result_Browser = kwm.Choose_Browser(driver, drowMain[9].ToString().ToLower()); if (Result_Browser.Result1 == KeyWords.Result_PASS) { driver = Result_Browser.driver; } } for (int c = 0; c < AllSheetResult.dt.Rows[iSubRowLoop].ItemArray.Length; c++) { if (AllSheetResult.dt.Columns[c].ColumnName.ToString() != "") { strColArray[c] = AllSheetResult.dt.Columns[c].ColumnName.ToString(); strDataArray[c] = AllSheetResult.dt.Rows[iSubRowLoop][c].ToString(); } } if (AllSheetResult.dt.Rows[iSubRowLoop][0].ToString() != Constants.TestCase002) { Stopwatch stopwatch = System.Diagnostics.Stopwatch.StartNew(); string strEmail = ""; //strEmail = strDataArray[AllSheetResult.dt.Columns.IndexOf("P1")]; //string strTermsConditions = "update st_lm_user set tcflag = 1 where username like '" + strEmail + "'"; //objCommonMethods.Update_Table_Data_Database(strTermsConditions); //string strUpdatePassword = "******" + strEmail + "')"; //objCommonMethods.Update_Table_Data_Database(strUpdatePassword); // objCommonMethods.Validate_Password_Update(strEmail, strDataArray[AllSheetResult.dt.Columns.IndexOf("P2")]); // string strUpdatePassword = "******" + strEmail + "')"; // objCommonMethods.Update_Table_Data_Database(strUpdatePassword); // objCommonMethods.Validate_Password_Update(strEmail, strDataArray[AllSheetResult.dt.Columns.IndexOf("P4")]); string strUpdateSql = ""; // string strUpdateSql = "Update [Supplier$] set TestExecute = 'P' WHERE TestCaseId= '004' and P6 = '" + AllSheetResult.dt.Rows[iSubRowLoop]["P6"].ToString() + "' and P3 ='" + AllSheetResult.dt.Rows[iSubRowLoop]["P3"].ToString() + "'"; // ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSql); WriteExlResult = ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSql); if (WriteExlResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(5000); WriteExlResult = ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSql); if (WriteExlResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(10000); WriteExlResult = ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSql); if (WriteExlResult.ErrorMessage.Contains(stralreadyUsingexcel)) { } } } //TestCaseResult = objCommonMethods.TestCase_Login_Execution_NewApp(driver, AllSheetResult, KeyWords.strLogfilePath, KeyWords.strExlOutputPath, iSubRowLoop, strColArray, strDataArray, iLoop, drowMain[1].ToString(), AllSheetResult.dt.Rows[iSubRowLoop][0].ToString()); stopwatch.Stop(); //intWasteTime = intWasteTime + stopwatch.Elapsed.Seconds; Console.WriteLine("Login Time " + stopwatch.Elapsed.Seconds); objCommonMethods.WriteLogFileTestCaseErrorResult(KeyWords.strLogfilePath, "Login Time " + stopwatch.Elapsed.Seconds, 3); if (TestCaseResult.Result1 == KeyWords.Result_FAIL) { break; } } switch (AllSheetResult.dt.Rows[iSubRowLoop][0].ToString()) { case Constants.TestCase004: { int intNumRep = 0; int iWhereToStart = 1; try { string st = drowMain[7].ToString(); intNumRep = Convert.ToInt32(drowMain[7].ToString()); } catch { intNumRep = 1; } try { string wheretost = drowMain[8].ToString(); iWhereToStart = Convert.ToInt32(drowMain[8].ToString()); } catch { iWhereToStart = 1; } for (int iloopUser = 1; iloopUser <= intNumRep; iloopUser++) { var results = new Result(); string strClientSubmitUserName = ""; string strClientSubmitUserNameLN = ""; string strClientSubmitUserNameFN = ""; int iWhereLoop = 0; string strREQNumber = AllSheetResult.dt.Rows[iSubRowLoop]["P6"].ToString(); // string[] separators = { "#" }; // string[] words = strREQNumber.Split(separators, StringSplitOptions.RemoveEmptyEntries); results = kwm.GetNameFromReqNumber("LN", strREQNumber); if (results.Result1 == KeyWords.Result_PASS) { strClientSubmitUserNameLN = results.ErrorMessage; AllSheetResult.dt.Rows[iSubRowLoop]["P9"] = strClientSubmitUserNameLN; } results = kwm.GetNameFromReqNumber("FN", strREQNumber); if (results.Result1 == KeyWords.Result_PASS) { strClientSubmitUserNameFN = results.ErrorMessage; AllSheetResult.dt.Rows[iSubRowLoop]["P10"] = strClientSubmitUserNameFN; } if (intNumRep == 1) { KeyWords.blnFlagLogout = true; } else { KeyWords.blnFlagLogout = false; } if (intNumRep == iloopUser) { KeyWords.blnFlagLogout = true; } if (iloopUser != 1) { if (iWhereToStart > 1) { iWhereLoop = iWhereToStart + iloopUser; strClientSubmitUserNameLN = strClientSubmitUserNameLN + "_" + iWhereLoop.ToString(); strClientSubmitUserNameFN = strClientSubmitUserNameFN + "_" + iWhereLoop.ToString(); } else { strClientSubmitUserNameLN = strClientSubmitUserNameLN + "_" + iloopUser.ToString(); strClientSubmitUserNameFN = strClientSubmitUserNameFN + "_" + iloopUser.ToString(); } AllSheetResult.dt.Rows[iSubRowLoop]["P9"] = strClientSubmitUserNameLN; AllSheetResult.dt.Rows[iSubRowLoop]["P10"] = strClientSubmitUserNameFN; } else { if (intNumRep >= 1) { if (iWhereToStart > 1) { iWhereLoop = iWhereToStart + iloopUser - 1; strClientSubmitUserNameLN = strClientSubmitUserNameLN + "_" + iWhereLoop.ToString(); strClientSubmitUserNameFN = strClientSubmitUserNameFN + "_" + iWhereLoop.ToString(); } else { strClientSubmitUserNameLN = strClientSubmitUserNameLN + "_" + iloopUser.ToString(); strClientSubmitUserNameFN = strClientSubmitUserNameFN + "_" + iloopUser.ToString(); } AllSheetResult.dt.Rows[iSubRowLoop]["P9"] = strClientSubmitUserNameLN; AllSheetResult.dt.Rows[iSubRowLoop]["P10"] = strClientSubmitUserNameFN; } } strClientSubmitUserName = strClientSubmitUserNameLN + ", " + strClientSubmitUserNameFN; if (strREQNumber != "") { //*******submit candidate method calling*********** //TestCaseResult = objCreate_SubmitCandidate.SubmitCandidate_Method(driver, AllSheetResult.dt.Rows[iSubRowLoop]); //*********************** End of submit candidate // TestCaseResult = objCreate_SubmitCandidate.Mass_Upload_Candidate(driver, AllSheetResult.dt.Rows[iSubRowLoop]); if (TestCaseResult.Result1 == KeyWords.Result_PASS) { string[] strDataArray1 = new string[5]; string[] strColArray1 = new string[5]; //In main sheet Run column update as P string strUpdateSqlMain1 = "Update [Main$] set Run = 'P' WHERE TestCaseId= '004' and Client ='" + drowMain[5].ToString() + "'"; ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSqlMain1); string strUpdateSql = "Update [Supplier$] set TestExecute = 'P' WHERE TestCaseId= '004' and P6 = '" + AllSheetResult.dt.Rows[iSubRowLoop]["P6"].ToString() + "' and P3 ='" + AllSheetResult.dt.Rows[iSubRowLoop]["P3"].ToString() + "'"; ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSql); string strSubSql12 = "SELECT * FROM [MSP$] WHERE TestCaseId= '005' and P3 ='" + AllSheetResult.dt.Rows[iSubRowLoop]["P3"].ToString() + "'"; GetSelectedResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, "MSP$", strSubSql12); if (GetSelectedResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(5000); GetSelectedResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, "MSP$", strSubSql12); if (GetSelectedResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(10000); GetSelectedResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, "MSP$", strSubSql12); if (GetSelectedResult.ErrorMessage.Contains(stralreadyUsingexcel)) { } } } // Console.WriteLine(strSubSql12); if (GetSelectedResult.dt.Rows.Count > 0) { if (GetSelectedResult.dt.Rows.Count > 0) { strDataArray1 = new string[GetSelectedResult.dt.Rows[0].ItemArray.Length]; strColArray1 = new string[GetSelectedResult.dt.Rows[0].ItemArray.Length]; } for (int c = 0; c <= GetSelectedResult.dt.Rows[0].ItemArray.Length - 1; c++) { if (GetSelectedResult.dt.Columns[c].ColumnName.ToString() != "") { if (GetSelectedResult.dt.Columns[c].ColumnName.ToString() == "P6") { strColArray1[c] = GetSelectedResult.dt.Columns[c].ColumnName.ToString(); strDataArray1[c] = strREQNumber; } else if (GetSelectedResult.dt.Columns[c].ColumnName.ToString() == "P8") { strColArray1[c] = GetSelectedResult.dt.Columns[c].ColumnName.ToString(); strDataArray1[c] = strClientSubmitUserName; } else { strColArray1[c] = GetSelectedResult.dt.Columns[c].ColumnName.ToString(); strDataArray1[c] = GetSelectedResult.dt.Rows[0][c].ToString(); } } } GetSelectedResult = ReadExcelHelper.WriteDataToExcelFileSelected(KeyWords.strExlInputPath, "MSP", strColArray1, strDataArray1); } strUpdateSqlMain = "Update [Main$] set Run = 'Yes' WHERE TestCaseId= '005' and Client ='" + AllSheetResult.dt.Rows[iSubRowLoop]["P3"].ToString() + "'"; //ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSqlMain); WriteExlResult = ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSqlMain); if (WriteExlResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(5000); WriteExlResult = ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSqlMain); if (WriteExlResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(10000); WriteExlResult = ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSqlMain); if (WriteExlResult.ErrorMessage.Contains(stralreadyUsingexcel)) { } } } string strExecutepath = @System.IO.Directory.GetCurrentDirectory(); if (KeyWords.strNunitConsolePath == "") { KeyWords.strNunitConsolePath = Constants.NunitConsolePath; } ProcessStartInfo start = new ProcessStartInfo(); start.Arguments = strExecutepath + Constants.NunitMSPSMBinPath; start.FileName = KeyWords.strNunitConsolePath; start.UseShellExecute = false; Process.Start(start); } else { kwm.select_MSG_Button(driver, KeyWords.locator_type, KeyWords.locator_button, Constants.No); kwm.select_MSG_Button(driver, KeyWords.locator_type, KeyWords.locator_button, Constants.cancel); kwm.select_MSG_Button(driver, KeyWords.locator_type, KeyWords.locator_button, "close"); } TestCaseResult = objCommonMethods.TestCase_Result_Execution(driver, AllSheetResult, TestCaseResult, KeyWords.strLogfilePath, KeyWords.strExlOutputPath, iSubRowLoop, strColArray, strDataArray, iLoop, drowMain[1].ToString()); } else { TestCaseResult.Result1 = KeyWords.Result_FAIL; TestCaseResult.ErrorMessage = "Input REQ number is empty"; TestCaseResult = objCommonMethods.TestCase_Result_Execution(driver, AllSheetResult, TestCaseResult, KeyWords.strLogfilePath, KeyWords.strExlOutputPath, iSubRowLoop, strColArray, strDataArray, iLoop, drowMain[1].ToString()); } } break; } default: { break; } } //Switch case End here } //No of sub test cases for loop driver.Quit(); } else { // Selected testcase id input data not avalibale } } } } } else { Console.WriteLine(MainSheetResult.ErrorMessage); objCommonMethods.WriteLogFileTestCaseHeaders(KeyWords.strLogfilePath, MainSheetResult.ErrorMessage, 1, "yes"); objCommonMethods.WriteLogFileTestCaseHeaders(KeyWords.strLogfilePath, MainSheetResult.ErrorMessage, 2, "no"); } objCommonMethods.WriteLogFileEndHeader(KeyWords.strLogfilePath); }
public Result Sche_Interview(IWebDriver WDriver, DataRow Schedule_Interview) { ReadExcel ReadExcelHelper = new ReadExcel(); KeyWordMethods kwm = new KeyWordMethods(); CommonMethods objCommonMethods = new CommonMethods(); var results = new Result(); var Result_ScreenShot = new Result(); // Rate_Change objRateChange = new Rate_Change(); kwm._WDWait = kwm.WebDriver_Wait_Handler(WDriver, 30); CreateRequirementRepository createRequirementRepository = new CreateRequirementRepository(); ScheduleInterviewModel Schedule_Interview_Model = createRequirementRepository.GetScheduleInterviewModel(Schedule_Interview); // SubmitCandidateAddResume submitCandidateAddResume = createRequirementRepository.GetSubmitCandidateAddResumeData(Schedule_Interview); objCommonMethods.SaveScreenShot_EachPage(WDriver, Schedule_Interview_Model.strClientName + "_"); //CLient selection Boolean bFlagDropDwon = false; try { bFlagDropDwon = WDriver.FindElement(By.XPath(KeyWords.XPath_supplierMenu_ClientDropDown)).Enabled; } catch { bFlagDropDwon = false; } if (bFlagDropDwon) { results = kwm.SupplierClient_Change_Click_NewApp(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, Schedule_Interview_Model.strClientName); if (results.Result1 == KeyWords.Result_FAIL) { //Thread.Sleep(000); results = kwm.SupplierClient_Change_Click_NewApp(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, Schedule_Interview_Model.strClientName); if (results.Result1 == KeyWords.Result_FAIL) { return(results); } } } // Select Main & Sub Menu's objCommonMethods.SaveScreenShot_EachPage(WDriver, Schedule_Interview_Model.strClientName + "_"); results = kwm.Main_Sub_Menu_Click_NewApp(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, Schedule_Interview_Model.strMainMenuLink, Schedule_Interview_Model.strSubMenuLink); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(5000); results = kwm.Main_Sub_Menu_Click_NewApp(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, Schedule_Interview_Model.strMainMenuLink, Schedule_Interview_Model.strSubMenuLink); if (results.Result1 == KeyWords.Result_FAIL) { //results.ErrorMessage1 = "Unable to click on the Main menu"; return(results); } } // Search Requirement number try { new WebDriverWait(WDriver, TimeSpan.FromSeconds(300)).Until(ExpectedConditions.ElementExists((By.Id(KeyWords.ID_Txt_SearchReq)))); Thread.Sleep(2000); WDriver.FindElement(By.Id(KeyWords.ID_Txt_SearchReq)).Clear(); WDriver.FindElement(By.Id(KeyWords.ID_Txt_SearchReq)).SendKeys(Schedule_Interview_Model.str_Txt_ReqNumber); } catch { try { WDriver.FindElement(By.Id(KeyWords.ID_Txt_SearchReq)).Clear(); WDriver.FindElement(By.Id(KeyWords.ID_Txt_SearchReq)).SendKeys(Schedule_Interview_Model.str_Txt_ReqNumber); } catch { // } } Thread.Sleep(1000); kwm.Action_LookInto_Element(WDriver, KeyWords.locator_LinkText, Schedule_Interview_Model.str_Txt_ReqNumber); // Click on Requirement number if (Schedule_Interview_Model.str_Txt_ReqNumber != "") { results = kwm.click(WDriver, KeyWords.locator_LinkText, Schedule_Interview_Model.str_Txt_ReqNumber); if (results.Result1 == KeyWords.Result_FAIL) { objCommonMethods.Action_Page_Down(WDriver); kwm.Action_LookInto_Element(WDriver, KeyWords.locator_XPath, "//td[@class=' wrapNormal']//a[contains(text(),'" + Schedule_Interview_Model.str_Txt_ReqNumber + "')]"); results = kwm.click(WDriver, KeyWords.locator_LinkText, Schedule_Interview_Model.str_Txt_ReqNumber); if (results.Result1 == KeyWords.Result_FAIL) { results.Result1 = KeyWords.Result_FAIL; results.ErrorMessage = "The given CW number not find " + Schedule_Interview_Model.str_Txt_ReqNumber; return(results); } } } else { results.Result1 = KeyWords.Result_FAIL; results.ErrorMessage = "The given CW number is empty "; return(results); } // To check Submitted candidates link is displaying try { new WebDriverWait(WDriver, TimeSpan.FromSeconds(300)).Until(ExpectedConditions.ElementExists((By.XPath(KeyWords.Xpath_Link_SubmittedCand)))); } catch { objCommonMethods.WriteLogFileTestCaseErrorResult(KeyWords.strLogfilePath, "Submitted candidates link is not displayed", 3); for (int i = 0; i < 10; i++) { try { if (WDriver.FindElement(By.XPath(KeyWords.Xpath_Link_SubmittedCand)).Displayed) { break; } Thread.Sleep(100); } catch { } } } // To click on Submitted candidates link string strSubLevel = ""; results = kwm.list_Menu_Click(WDriver, KeyWords.locator_ID, KeyWords.ID_Link_SubmittedCandidate, Schedule_Interview_Model.str_Link_Subcaniddates, strSubLevel); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(5000); results = kwm.list_Menu_Click(WDriver, KeyWords.locator_ID, KeyWords.ID_Link_SubmittedCandidate, Schedule_Interview_Model.str_Link_Subcaniddates, strSubLevel); if (results.Result1 == KeyWords.Result_FAIL) { return(results); } } // Search Candidate Name try { new WebDriverWait(WDriver, TimeSpan.FromSeconds(300)).Until(ExpectedConditions.ElementExists((By.Id(KeyWords.ID_Txt_SearchCand)))); Thread.Sleep(2000); WDriver.FindElement(By.Id(KeyWords.ID_Txt_SearchCand)).Clear(); WDriver.FindElement(By.Id(KeyWords.ID_Txt_SearchCand)).SendKeys(Schedule_Interview_Model.str_Txt_CandidateName); } catch { try { WDriver.FindElement(By.Id(KeyWords.ID_Txt_SearchCand)).Clear(); WDriver.FindElement(By.Id(KeyWords.ID_Txt_SearchCand)).SendKeys(Schedule_Interview_Model.str_Txt_CandidateName); } catch { // } } Thread.Sleep(200); // Click on Candidate Name if (Schedule_Interview_Model.str_Txt_CandidateName != "") { try { WDriver.FindElement(By.LinkText(Schedule_Interview_Model.str_Txt_CandidateName)).Click(); } catch { Thread.Sleep(100); try { WDriver.FindElement(By.PartialLinkText(Schedule_Interview_Model.str_Txt_CandidateName)).Click(); } catch { // Console.WriteLine(bFlag); results.Result1 = KeyWords.Result_FAIL; results.ErrorMessage = "The given candidate name not find " + Schedule_Interview_Model.str_Txt_CandidateName; return(results); } } } // To check Schedule Interview link is displaying try { new WebDriverWait(WDriver, TimeSpan.FromSeconds(300)).Until(ExpectedConditions.ElementExists((By.Id(KeyWords.ID_List_listMenu1)))); } catch { objCommonMethods.WriteLogFileTestCaseErrorResult(KeyWords.strLogfilePath, "Action list is not displayed", 3); for (int i = 0; i < 10; i++) { try { if (WDriver.FindElement(By.Id(KeyWords.ID_List_listMenu1)).Displayed) { break; } Thread.Sleep(100); } catch { } } } // To click on Schedule interview link string strSubLevel1 = ""; // string strSubLevel = "./label"; results = kwm.list_Menu_Click(WDriver, KeyWords.locator_ID, KeyWords.ID_List_listMenu1, Schedule_Interview_Model.str_Link_ScheInterview, strSubLevel1); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(5000); results = kwm.list_Menu_Click(WDriver, KeyWords.locator_ID, KeyWords.ID_List_listMenu1, Schedule_Interview_Model.str_Link_ScheInterview, strSubLevel1); if (results.Result1 == KeyWords.Result_FAIL) { return(results); } } // Schedule Interview Window try { new WebDriverWait(WDriver, TimeSpan.FromSeconds(300)).Until(ExpectedConditions.ElementExists((By.Id(KeyWords.ID_Candidate_Int_DialogWindow)))); } catch { } // Interview Accepted(Radio button) if (Schedule_Interview_Model.str_Radio_Interview_Accepted != "") { if (Schedule_Interview_Model.str_Radio_Interview_Accepted.ToLower().Equals(KeyWords.str_String_Compare_yes)) { results = objCommonMethods.Select_Radio_Button(WDriver, "AcceptedRadio", "1"); // Confirm Interview Schedule if (Schedule_Interview_Model.str_Radio_ConfirmInterview != "") { if (Schedule_Interview_Model.str_Radio_ConfirmInterview.ToLower().Equals(KeyWords.str_String_Compare_yes)) { results = objCommonMethods.Select_Radio_Button(WDriver, "ConfirmInterview", "1"); } else { Thread.Sleep(1000); results = objCommonMethods.Select_Radio_Button(WDriver, "ConfirmInterview", "3"); Thread.Sleep(1000); //Date kwm.click(WDriver, KeyWords.locator_ID, KeyWords.ID_Date_Schedule_ScheduleDate); if (Schedule_Interview_Model.str_ScheduleDate != "") { results = kwm.Select_Date_From_Picker(WDriver, DateTime.Today); if (results.Result1 == KeyWords.Result_FAIL) { results = kwm.sendText(WDriver, KeyWords.locator_ID, KeyWords.ID_Date_Schedule_ScheduleDate, Schedule_Interview_Model.str_ScheduleDate, false); if (results.Result1 == KeyWords.Result_FAIL) { //return results; } } } //kwm.click(WDriver, KeyWords.locator_ID, KeyWords.ID_Txt_ScheduleDate); //DateTime today = DateTime.Now; //DateTime date = today.AddDays(1); //Schedule_Interview_Model.str_ScheduleDate = date.ToString("MM/dd/yyyy"); // results = kwm.sendText(WDriver, KeyWords.locator_ID, KeyWords.ID_Date_ScheFirChoice, Schedule_Interview_Model.str_ScheduleDate, false); Thread.Sleep(2000); // Select Time1 if (Schedule_Interview_Model.str_Select_Time1 != "") { results = kwm.select(WDriver, KeyWords.locator_ID, KeyWords.ID_Select_ScheTime, Schedule_Interview_Model.str_Select_Time1); if (results.Result1 == KeyWords.Result_FAIL) { try { SelectElement se = new SelectElement(WDriver.FindElement(By.Id(KeyWords.ID_Select_ScheTime))); //Locating select list se.SelectByIndex(3); } catch { // } } } // Select Zone1 if (Schedule_Interview_Model.str_Select_Zone1 != "") { results = kwm.select(WDriver, KeyWords.locator_ID, KeyWords.ID_Select_ScheZone, Schedule_Interview_Model.str_Select_Zone1); if (results.Result1 == KeyWords.Result_FAIL) { try { SelectElement se = new SelectElement(WDriver.FindElement(By.Id(KeyWords.ID_Select_ScheZone))); //Locating select list se.SelectByIndex(3); } catch { // } } } //Time Zone if (Schedule_Interview_Model.str_Select_TimeZone_ScheduleZone != "") { results = kwm.select(WDriver, KeyWords.locator_ID, KeyWords.ID_Select_TimeZone_ScheduleZone, Schedule_Interview_Model.str_Select_TimeZone_ScheduleZone); if (results.Result1 == KeyWords.Result_FAIL) { try { SelectElement se = new SelectElement(WDriver.FindElement(By.Id(KeyWords.ID_Select_TimeZone_ScheduleZone))); //Locating select list se.SelectByIndex(3); } catch { // } } } // kwm.click(WDriver, KeyWords.locator_ID, KeyWords.ID_Select_ScheduleTime); //if (Interview_Process_Model.str_Date_FirChoice != "") //{ // //results = kwm.Select_End_Date_From_Picker(WDriver, createRequirementModel.strDateAssignmentEnd); // // if (results.Result1 == KeyWords.Result_FAIL) // // { // results = kwm.sendText(WDriver, KeyWords.locator_ID, KeyWords.ID_Date_FirChoice, Interview_Process_Model.str_Date_FirChoice, false); // if (results.Result1 == KeyWords.Result_FAIL) // { // //return results; // } // // } //} //else //{ // DateTime date = DateTime.Today; // Interview_Process_Model.str_Date_FirChoice = date.ToString("MM/dd/yyyy"); // results = kwm.sendText(WDriver, KeyWords.locator_ID, KeyWords.ID_Date_FirChoice, Interview_Process_Model.str_Date_FirChoice, false); //} } } else { results = objCommonMethods.Select_Radio_Button(WDriver, "ConfirmInterview", "2"); } } else { results = objCommonMethods.Select_Radio_Button(WDriver, "AcceptedRadio", "0"); Thread.Sleep(1000); // Reject reason SelectElement se = new SelectElement(WDriver.FindElement(By.Id(KeyWords.ID_Select_RejectReason))); //Locating select list se.SelectByIndex(1); } } else { results = objCommonMethods.Select_Radio_Button(WDriver, "AcceptedRadio", "0"); Thread.Sleep(1000); // Reject reason SelectElement se = new SelectElement(WDriver.FindElement(By.Id(KeyWords.ID_Select_RejectReason))); //Locating select list se.SelectByIndex(1); } Thread.Sleep(2000); // Primary Phone if (Schedule_Interview_Model.str_Txt_PrimaryPhone != "") { results = kwm.sendText_clr_backspace_phone(WDriver, KeyWords.locator_ID, KeyWords.ID_Txt_PrimaryPhone, Schedule_Interview_Model.str_Txt_PrimaryPhone); if (results.Result1 == KeyWords.Result_FAIL) { // return results; } } Thread.Sleep(2000); // Alternate Phone if (Schedule_Interview_Model.str_Txt_SecondaryPhone != "") { results = kwm.sendText_clr_backspace_phone(WDriver, KeyWords.locator_ID, KeyWords.ID_Txt_AlternatePhone, Schedule_Interview_Model.str_Txt_SecondaryPhone); if (results.Result1 == KeyWords.Result_FAIL) { // return results; } } // Comment if (Schedule_Interview_Model.str_Txt_Sche_Comment != "") { results = kwm.sendText_clr_backspace(WDriver, KeyWords.locator_ID, KeyWords.ID_Txt_SchInterview_Comment, Schedule_Interview_Model.str_Txt_Sche_Comment); if (results.Result1 == KeyWords.Result_FAIL) { // return results; } } objCommonMethods.Action_Page_Down(WDriver); // Schedule Interview button results = kwm.select_MSG_Button(WDriver, KeyWords.locator_class, KeyWords.locator_class_button, Schedule_Interview_Model.str_Btn_ScheduleInterview); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(3000); results = kwm.select_MSG_Button(WDriver, KeyWords.locator_type, KeyWords.locator_class_button, Schedule_Interview_Model.str_Btn_ScheduleInterview); if (results.Result1 == KeyWords.Result_FAIL) { WDriver.FindElement(By.Id(KeyWords.ID_Btn_RejectInterview)).Click(); } } // To maintain error log messages in log files objCommonMethods.SaveScreenShot_EachPage(WDriver, Schedule_Interview_Model.strClientName + "_"); results = kwm.Error_Msg_Read_Submit_Resume_details(WDriver, "//*[@" + KeyWords.locator_ID + "='ulMspUserError']/li"); //results = kwm.Error_Msg_Read_Submit_Resume_details(WDriver, "//div[@" + KeyWords.locator_ID + "= KeyWords.ID_Error_Valmessages]/div/ul/li"); if (results.Result1 == KeyWords.Result_PASS) { if (results.ErrorMessage != "") { results.Result1 = KeyWords.Result_FAIL; return(results); } } // Confirmation popup with YES/NO results = kwm.select_MSG_Button(WDriver, KeyWords.locator_type, KeyWords.locator_button, Schedule_Interview_Model.str_Btn_Yes_Action_ScheInt); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(3000); results = kwm.select_MSG_Button(WDriver, KeyWords.locator_type, KeyWords.locator_button, Schedule_Interview_Model.str_Btn_Yes_Action_ScheInt); if (results.Result1 == KeyWords.Result_FAIL) { return(results); } } // Click on OK button results = kwm.select_MSG_Button(WDriver, KeyWords.locator_type, KeyWords.locator_button, Schedule_Interview_Model.str_Btn_OK_ScheInt); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(13000); results = kwm.select_MSG_Button(WDriver, KeyWords.locator_type, KeyWords.locator_button, Schedule_Interview_Model.str_Btn_OK_ScheInt); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(15000); results = kwm.select_MSG_Button(WDriver, KeyWords.locator_type, KeyWords.locator_button, Schedule_Interview_Model.str_Btn_OK_ScheInt); if (results.Result1 == KeyWords.Result_FAIL) { return(results); } } } results.Result1 = KeyWords.Result_PASS; results.ErrorMessage1 = KeyWords.MSG_str_Schedule_Interview_Done; // results.ErrorMessage = "Invoice Batch created Successfully done --> " + strBatchNumberCreated; return(results); }
public void TestStart() { /*string strLogfilePath = System.IO.Directory.GetCurrentDirectory() + "\\Input\\SmartTrack_logfile.txt"; * string strExlInputPath = System.IO.Directory.GetCurrentDirectory() + "\\Input\\SmartTrack_Input.xlsx"; * string strExlOutputPath = System.IO.Directory.GetCurrentDirectory() + "\\Input\\SmartTrack_Output.xlsx";*/ // Console.WriteLine(System.IO.("../Input/SmartTrack_logfile.txt")); ReadExcel ReadExcelHelper = new ReadExcel(); //Create methods objects CommonMethods objCommonMethods = new CommonMethods(); //Approve objCreate_Approve = new Approve(); Broadcast objCreate_Broadcast = new Broadcast(); KeyWordMethods kwm = new KeyWordMethods(); objCommonMethods.TestCase_Result_OutPutExcel(); string strMainSheetName = "Main$"; // string strMainSql = "SELECT TestCaseId,NumberOfRepeats,DataSheet,Include,Url,Client,UserName FROM [" + strMainSheetName + "] where UserName = '******'"; string strMainSql = "SELECT TestCaseId,NumberOfRepeats,DataSheet,Include,Url,Client,UserName,Browser FROM [" + strMainSheetName + "] where UserName = '******' and Run = 'Yes' and Include = 'Yes'"; objCommonMethods.WriteLogFileBeginHeader(KeyWords.strLogfilePath); var MainSheetResult = new Result(); var MSPSheetResult = new Result(); var GetReqNumberResult = new Result(); var TestCaseResult = new Result(); var WriteExlResult = new Result(); var Result_ScreenShot = new Result(); var GetSelectedResult = new Result(); var Result_Browser = new Result(); Thread.Sleep(1); //objCommonMethods.Update_Table_Data_Database("Update ST_AL_Alert set ForceStatus=0"); MainSheetResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, strMainSheetName, strMainSql); string stralreadyUsingexcel = "The Microsoft Office Access database engine cannot open or write to the file";// ''. It is already opened exclusively by another user, or you need permission to view and write its data"; if (MainSheetResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(5000); MainSheetResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, strMainSheetName, strMainSql); if (MainSheetResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(10000); MainSheetResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, strMainSheetName, strMainSql); if (MainSheetResult.ErrorMessage.Contains(stralreadyUsingexcel)) { } } } if (MainSheetResult.Result1 == "Pass") { foreach (DataRow drowMain in MainSheetResult.dt.Rows) { // Testcase Id include "Yes" in input && Testcase Id is empty checking if ((drowMain[3].ToString().ToUpper() == "YES") && (drowMain[0].ToString() != null) && (drowMain[2].ToString().Trim() != "") && (Convert.ToInt32(drowMain[1]) > 0)) { // Reading the All sheet selected Testcase ID //Adding new code for supplier new design KeyWords.LoginUser_Role = drowMain[2].ToString(); KeyWords.str_App_Url = drowMain[4].ToString(); // string[,] strColDataArray = new string[95, 95]; DataTable dtExlAllSheet = new DataTable(); string strSubSheetName = drowMain[2].ToString() + "$"; string strSubSql = ""; string strAllorClient = drowMain[5].ToString(); if (strAllorClient.Trim().ToLower() == "all") { strSubSql = "SELECT * FROM [" + strSubSheetName + "] WHERE TestCaseId= '" + drowMain[0].ToString() + "'"; } else { strSubSql = "SELECT top 1 * FROM [" + strSubSheetName + "] WHERE TestCaseId= '" + drowMain[0].ToString() + "' and P3 = '" + drowMain[5].ToString() + "'and TestExecute = 'yes'"; } MSPSheetResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, strSubSheetName, strSubSql); if (MSPSheetResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(5000); MSPSheetResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, strSubSheetName, strSubSql); if (MSPSheetResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(10000); MSPSheetResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, strSubSheetName, strSubSql); if (MSPSheetResult.ErrorMessage.Contains(stralreadyUsingexcel)) { } } } string[] strDataArray = new string[5]; string[] strColArray = new string[5]; if (MSPSheetResult.dt.Rows.Count > 0) { strDataArray = new string[MSPSheetResult.dt.Rows[0].ItemArray.Length]; strColArray = new string[MSPSheetResult.dt.Rows[0].ItemArray.Length]; } // Number of counts repated in Main sheet for (int iLoop = 1; iLoop <= Convert.ToInt32(drowMain[1]); iLoop++) { string strLoginUser = string.Empty; string strLoginUser1 = string.Empty; if (MSPSheetResult.dt.Rows.Count > 0) { //Number of testcases for each Testcase ID for (int iSubRowLoop = 0; iSubRowLoop < MSPSheetResult.dt.Rows.Count; iSubRowLoop++) { if (iSubRowLoop == 0) { //Added new browser code KeyWords.str_Browser_Execute = drowMain[7].ToString(); Result_Browser = kwm.Choose_Browser(driver, drowMain[7].ToString().ToLower()); if (Result_Browser.Result1 == KeyWords.Result_PASS) { driver = Result_Browser.driver; } } for (int c = 0; c < MSPSheetResult.dt.Rows[iSubRowLoop].ItemArray.Length; c++) { if (MSPSheetResult.dt.Columns[c].ColumnName.ToString() != "") { strColArray[c] = MSPSheetResult.dt.Columns[c].ColumnName.ToString(); strDataArray[c] = MSPSheetResult.dt.Rows[iSubRowLoop][c].ToString(); } } if (MSPSheetResult.dt.Rows[iSubRowLoop][0].ToString() != Constants.TestCase002) { Stopwatch stopwatch = System.Diagnostics.Stopwatch.StartNew(); string strEmail = ""; strEmail = strDataArray[MSPSheetResult.dt.Columns.IndexOf("P1")]; //TestCaseResult = objCommonMethods.TestCase_Login_Execution_NewApp(driver, MSPSheetResult, KeyWords.strLogfilePath, KeyWords.strExlOutputPath, iSubRowLoop, strColArray, strDataArray, iLoop, drowMain[1].ToString(), MSPSheetResult.dt.Rows[iSubRowLoop][0].ToString()); stopwatch.Stop(); //intWasteTime = intWasteTime + stopwatch.Elapsed.Seconds; Console.WriteLine("Login Time " + stopwatch.Elapsed.Seconds); objCommonMethods.WriteLogFileTestCaseErrorResult(KeyWords.strLogfilePath, "Login Time " + stopwatch.Elapsed.Seconds, 3); if (TestCaseResult.Result1 == KeyWords.Result_FAIL) { break; } } switch (MSPSheetResult.dt.Rows[iSubRowLoop][0].ToString()) { case Constants.TestCase003: { string strREQNumber = MSPSheetResult.dt.Rows[iSubRowLoop]["P6"].ToString(); if (strREQNumber != "") { // TestCaseResult = objCreate_Broadcast.Broadcast_Method(driver, MSPSheetResult.dt.Rows[iSubRowLoop], test); if (TestCaseResult.Result1 == KeyWords.Result_PASS) { string strUpdateAllSheet = "Update [All$] set P1='" + TestCaseResult.listData[0].ToString() + "' WHERE TestCaseId= '004' and P3 ='" + MSPSheetResult.dt.Rows[iSubRowLoop]["P3"].ToString() + "'"; WriteExlResult = ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateAllSheet); string strUpdateMSPSheet = "Update [MSP$] set TestExecute='P' WHERE TestCaseId= '003' and P3 ='" + MSPSheetResult.dt.Rows[iSubRowLoop]["P3"].ToString() + "' and P6='" + strREQNumber + "'"; WriteExlResult = ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateMSPSheet); string[] strDataArray1 = new string[5]; string[] strColArray1 = new string[5]; string strSubSql12 = "SELECT * FROM [All$] WHERE TestCaseId= '004' and P3 ='" + MSPSheetResult.dt.Rows[iSubRowLoop]["P3"].ToString() + "'"; GetSelectedResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, "All$", strSubSql12); if (GetSelectedResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(5000); GetSelectedResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, "All$", strSubSql12); if (GetSelectedResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(10000); GetSelectedResult = ReadExcelHelper.GetDataTableFromExcelFile(KeyWords.strExlInputPath, "All$", strSubSql12); if (GetSelectedResult.ErrorMessage.Contains(stralreadyUsingexcel)) { } } } if (GetSelectedResult.dt.Rows.Count > 0) { if (GetSelectedResult.dt.Rows.Count > 0) { strDataArray1 = new string[GetSelectedResult.dt.Rows[0].ItemArray.Length]; strColArray1 = new string[GetSelectedResult.dt.Rows[0].ItemArray.Length]; } for (int c = 0; c <= GetSelectedResult.dt.Rows[0].ItemArray.Length - 1; c++) { if (GetSelectedResult.dt.Columns[c].ColumnName.ToString() == "P6") { strColArray1[c] = GetSelectedResult.dt.Columns[c].ColumnName.ToString(); strDataArray1[c] = strREQNumber; } else { strColArray1[c] = GetSelectedResult.dt.Columns[c].ColumnName.ToString(); strDataArray1[c] = GetSelectedResult.dt.Rows[0][c].ToString(); } } GetSelectedResult = ReadExcelHelper.WriteDataToExcelFileSelected(KeyWords.strExlInputPath, "Supplier", strColArray1, strDataArray1); } string strUpdateSqlMain = "Update [Main$] set Run = 'Yes' WHERE TestCaseId= '004' and Client ='" + MSPSheetResult.dt.Rows[iSubRowLoop]["P3"].ToString() + "'"; WriteExlResult = ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSqlMain); if (WriteExlResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(5000); WriteExlResult = ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSqlMain); if (WriteExlResult.ErrorMessage.Contains(stralreadyUsingexcel)) { Thread.Sleep(10000); WriteExlResult = ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateSqlMain); if (WriteExlResult.ErrorMessage.Contains(stralreadyUsingexcel)) { } } } string strExecutepath = @System.IO.Directory.GetCurrentDirectory(); if (KeyWords.strNunitConsolePath == "") { KeyWords.strNunitConsolePath = Constants.NunitConsolePath; // KeyWords.strNunitConsolePath = ""; } ProcessStartInfo start = new ProcessStartInfo(); start.Arguments = strExecutepath + Constants.NunitSupplierBinPath; start.FileName = KeyWords.strNunitConsolePath; // start.UseShellExecute = false; Thread.Sleep(5000); Process.Start(start); } else { string strUpdateMSPSheet = "Update [MSP$] set TestExecute='F' WHERE TestCaseId= '003' and P3 ='" + MSPSheetResult.dt.Rows[iSubRowLoop]["P3"].ToString() + "' and P6='" + strREQNumber + "'"; WriteExlResult = ReadExcelHelper.UpdateDataToExcelFile(KeyWords.strExlInputPath, strUpdateMSPSheet); } TestCaseResult = objCommonMethods.TestCase_Result_Execution(driver, MSPSheetResult, TestCaseResult, KeyWords.strLogfilePath, KeyWords.strExlOutputPath, iSubRowLoop, strColArray, strDataArray, iLoop, drowMain[1].ToString()); } else { TestCaseResult.Result1 = KeyWords.Result_FAIL; TestCaseResult.ErrorMessage = "Input REQ number is empty"; TestCaseResult = objCommonMethods.TestCase_Result_Execution(driver, MSPSheetResult, TestCaseResult, KeyWords.strLogfilePath, KeyWords.strExlOutputPath, iSubRowLoop, strColArray, strDataArray, iLoop, drowMain[1].ToString()); } break; } default: { break; } } //Switch case End here } //No of sub test cases for loop driver.Quit(); } else { // Selected testcase id input data not avalibale } } } } } else { Console.WriteLine(MainSheetResult.ErrorMessage); objCommonMethods.WriteLogFileTestCaseHeaders(KeyWords.strLogfilePath, MainSheetResult.ErrorMessage, 1, "yes"); objCommonMethods.WriteLogFileTestCaseHeaders(KeyWords.strLogfilePath, MainSheetResult.ErrorMessage, 2, "no"); } objCommonMethods.WriteLogFileEndHeader(KeyWords.strLogfilePath); }