public void driveFunction(tstObject tstObj, string doFunc, string lnNum, string stpNum, string[] inArray, string baseURL, string product, string datsource, string pth, ref string getNeg, ref string[,] tstresult, out int fndExcep, out int tstFail) { bool dispObj; string objString; string thsItem; string itmPath; string retXpath; string[,] vfyArray; string[,] arrOutcome; string tblPath; TimeSpan currTime; WebDriverWait wait; //Function list that corresponds to each sheet on the data sheet. //Array params are passed and the appropriate function is run arrOutcome = null; dispObj = false; tstFail = 0; fndExcep = 0; retXpath = ""; wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10)); vfyArray = new string[1, 9]; try { switch (doFunc) { #region Login case "Login": { try { //login tstObj.Login(tstObj, inArray, baseURL, stpNum, brwsrType, product, pth, out fndExcep, ref tstresult); } catch (Exception e) { //Record failed result tmpString = e.Message; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //Record exception and begin exit process fndExcep = -1; } break; } #endregion #region Logout case "Logout": { try { tstObj.Logout(pth, true, stpNum, product, ref tstresult); } catch (Exception e) { //Record failed result tmpString = e.Message; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //Record exception and begin exit process fndExcep = -1; } break; } #endregion #region addOutcome case "addOutcome": { try { addOutcome(tstObj, dispObj, inArray, stpNum, pth, ref tstresult, out fndExcep, out tstFail); } catch (NoSuchElementException e) { //Record failed result tmpString = "Failed clicking the dropdown list box: " + e.Message; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //Record exception and begin exit process fndExcep = -1; } break; } #endregion #region calendarControl case "calendarControl": { calendarControl(tstObj, inArray, stpNum, pth, ref tstresult, out fndExcep); break; } #endregion #region chkCheckbox case "chkCheckbox": { try { clkLink = inArray[0]; //check to see if the checkbox to be clicked is a modal if (inArray[3] == "Y" || inArray[3] == "y") { driver.SwitchTo().Frame(inArray[4]); do { dispObj = WaitUntil(tstObj, inArray[0], out objString, out currTime, ""); if (currTime.Seconds >= 6) { dispObj = false; break; } } while (dispObj != true); //if there is an exception, objString will not be blank //if not blank, fail test and log exception. Otherwise continue execution if (objString == "") { chkCheckbox(tstObj, dispObj, inArray, stpNum, pth, ref tstresult, out fndExcep); //TextFileOps.Write(pth, "<br />", clrIndex); } else { fndExcep = -1; tmpString = objString; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); } driver.SwitchTo().DefaultContent(); } else { do { dispObj = WaitUntil(tstObj, inArray[0], out objString, out currTime, ""); if (currTime.Seconds >= 6) { dispObj = false; break; } } while (dispObj != true); //if there is an exception, objString will not be blank //if not blank, fail test and log exception. Otherwise continue execution if (objString == "") { chkCheckbox(tstObj, dispObj, inArray, stpNum, pth, ref tstresult, out fndExcep); //TextFileOps.Write(pth, "<br />", clrIndex); } else { fndExcep = -1; tmpString = objString; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); } } } catch (Exception e) { //Record failed result tmpString = "Failed clicking the dropdown list box: " + e.Message; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //Record exception and begin exit process fndExcep = -1; } break; } #endregion #region clkButton case "clkButton": { try { clkLink = inArray[0]; Thread.Sleep(1000); //check to see if the button to be clicked is a modal if (inArray[2] == "Y" || inArray[2] == "y") { driver.SwitchTo().Frame(inArray[3]); do { dispObj = WaitUntil(tstObj, inArray[0], out objString, out currTime, ""); if (currTime.Seconds >= 6) { dispObj = false; break; } } while (dispObj != true); //if there is an exception, objString will not be blank //if not blank, fail test and log exception. Otherwise continue execution if (objString == "") { tstObj.clkButton(tstObj, dispObj, inArray, stpNum, pth, ref tstresult, out fndExcep); //TextFileOps.Write(pth, "<br />", clrIndex); } else { fndExcep = -1; tmpString = objString; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); } driver.SwitchTo().DefaultContent(); } else { do { dispObj = WaitUntil(tstObj, inArray[0], out objString, out currTime, ""); if (currTime.Seconds >= 6) { dispObj = false; break; } } while (dispObj != true); if (objString == "") { tstObj.clkButton(tstObj, dispObj, inArray, stpNum, pth, ref tstresult, out fndExcep); //TextFileOps.Write(pth, "<br />", clrIndex); } else { fndExcep = -1; tmpString = objString; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); } } } catch (Exception e) { //Record failed result tmpString = "Failed clicking the dropdown list box: " + e.Message; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //Record exception and begin exit process fndExcep = -1; } break; } #endregion #region inputText case "inputText": { try { if (inArray[3] == "Y" || inArray[3] == "y") { driver.SwitchTo().Frame(inArray[4]); do { dispObj = WaitUntil(tstObj, inArray[0], out objString, out currTime, ""); if (currTime.Seconds >= 6) { dispObj = false; break; } } while (dispObj != true); //if there is an exception, objString will not be blank //if not blank, fail test and log exception. Otherwise continue execution if (objString == "") { tstObj.inputText(tstObj, dispObj, inArray, stpNum, pth, ref tstresult, out fndExcep); //TextFileOps.Write(pth, "<br />", clrIndex); } else { fndExcep = -1; tmpString = objString; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); } driver.SwitchTo().DefaultContent(); } else { if (inArray[0] != "URL") { do { dispObj = WaitUntil(tstObj, inArray[0], out objString, out currTime, ""); if (currTime.Seconds >= 6) { dispObj = false; break; } } while (dispObj != true); if (objString == "") { tstObj.inputText(tstObj, dispObj, inArray, stpNum, pth, ref tstresult, out fndExcep); } else { fndExcep = -1; tmpString = objString; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); } } else { driver.Navigate().GoToUrl(inArray[2]); } } } catch(Exception e) { //Record failed result tmpString = "Failed clicking the dropdown list box: " + e.Message; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //Record exception and begin exit process fndExcep = -1; } break; } #endregion #region moveSlider case "moveSlider": { //add string to the test results list tmpString = "Setting the ........(" + stpNum + ")"; try { do { dispObj = WaitUntil(tstObj, inArray[0], out objString, out currTime, ""); if (currTime.Seconds >= 6) { dispObj = false; break; } } while (dispObj != true); if (dispObj == true) { tstObj.moveSlider(tstObj, dispObj, inArray, stpNum, pth, ref tstresult, out fndExcep, out tstFail); } else { fndExcep = -1; tmpString = objString; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); } } catch(Exception e) { //Record failed result tmpString = "An exception was found moving the slider: " + e.Message; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //Record exception and begin exit process fndExcep = -1; } break; } #endregion #region navLinks case "navLinks": //navigate to a link { if (inArray[0] != "SWITCH TAB") { try { do { dispObj = WaitUntil(tstObj, inArray[0], out objString, out currTime, ""); if (currTime.Seconds >= 6) { dispObj = false; break; } } while (dispObj != true); if (dispObj == true) { tstObj.navLinks(tstObj, dispObj, inArray, stpNum, pth, ref tstresult, out fndExcep); } else { fndExcep = -1; tmpString = objString; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); } } catch (Exception e) { //Record failed result tmpString = "Failed clicking the dropdown list box: " + e.Message; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //Record exception and begin exit process fndExcep = -1; } } else { tstObj.navLinks(tstObj, dispObj, inArray, stpNum, pth, ref tstresult, out fndExcep); } break; } #endregion #region selDropdown case "selDropdown": { try { if (inArray[5] == "Y" || inArray[5] == "y") { driver.SwitchTo().Frame(inArray[6]); do { dispObj = WaitUntil(tstObj, inArray[0], out objString, out currTime, ""); if (currTime.Seconds >= 6) { dispObj = false; break; } } while (dispObj != true); //if there is an exception, objString will not be blank //if not blank, fail test and log exception. Otherwise continue execution if (objString == "") { tstObj.selDropDown(tstObj, dispObj, inArray[0], inArray[1], inArray[2], inArray[3], inArray[4], inArray[5], inArray[6], inArray[7], stpNum, pth, ref tstresult, out fndExcep); //TextFileOps.Write(pth, "<br />", clrIndex); } else { fndExcep = -1; tmpString = objString; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); } driver.SwitchTo().DefaultContent(); } else { do { dispObj = WaitUntil(tstObj, inArray[0], out objString, out currTime, ""); if (currTime.Seconds >= 6) { dispObj = false; break; } } while (dispObj != true); //if there is an exception, objString will not be blank //if not blank, fail test and log exception. Otherwise continue execution if (objString == "") { tstObj.selDropDown(tstObj, dispObj, inArray[0], inArray[1], inArray[2], inArray[3], inArray[4], inArray[5], inArray[6], inArray[7], stpNum, pth, ref tstresult, out fndExcep); //TextFileOps.Write(pth, "<br />", clrIndex); } else { fndExcep = -1; tmpString = objString; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); } } } catch(Exception e) { //Record failed result tmpString = "Failed clicking the dropdown list box: " + e.Message; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //Record exception and begin exit process fndExcep = -1; } break; } #endregion #region sendKeys case "sendKeys": tstObj.sendKeys(tstObj, inArray, stpNum, pth, out fndExcep, stpNum); break; #endregion #region tblSelect case "tblSelect": { try { if (inArray[5] == "Y" || inArray[5] == "y") { driver.SwitchTo().Frame(inArray[6]); do { dispObj = WaitUntil(tstObj, inArray[0], out objString, out currTime, ""); if (currTime.Seconds >= 6) { dispObj = false; break; } } while (dispObj != true); if (dispObj == true) { tstObj.tblSelect(tstObj, dispObj, inArray, stpNum, pth, ref tstresult, out fndExcep); } else { fndExcep = -1; tmpString = objString; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); } driver.SwitchTo().DefaultContent(); } else { do { dispObj = WaitUntil(tstObj, inArray[0], out objString, out currTime, ""); if (currTime.Seconds >= 6) { dispObj = false; break; } } while (dispObj != true); if (dispObj == true) { tstObj.tblSelect(tstObj, dispObj, inArray, stpNum, pth, ref tstresult, out fndExcep); } else { fndExcep = -1; tmpString = objString; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); } } thsItem = inArray[2]; } catch (Exception e) { //Record failed result tmpString = "Failed clicking the dropdown list box: " + e.Message; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //Record exception and begin exit process fndExcep = -1; } break; } #endregion #region vfyGrades case "vfyGrades": { try { //add string to the test results list tmpString = "CHECKPOINT:"; tstresult = arrayAppend("True", tmpString, "20", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); inArray = vfyListArray(inArray); //add string to the test results list tmpString = "Searching for the grades table........(" + stpNum + ")"; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //make sure that item exists do { dispObj = WaitUntil(tstObj, inArray[0], out objString, out currTime, ""); if (currTime.Seconds >= 6) { dispObj = false; break; } } while (dispObj != true); if (dispObj == true) { tmpString = "Found the grade table......"; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); tstObj.vfyGrades(tstObj, dispObj, inArray, stpNum, pth, ref tstresult, out fndExcep, out tstFail); } else { fndExcep = -1; tmpString = objString; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); } thsItem = inArray[2]; tmpString = "Finished checking the grade table"; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); tmpString = "END CHECKPOINT:"; tstresult = arrayAppend("True", tmpString, "20", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); tmpString = "<br />"; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); } catch (Exception e) { //Record failed result tmpString = "Failed clicking the dropdown list box: " + e.Message; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //Record exception and begin exit process fndExcep = -1; } break; } #endregion #region vfyTableEntry case "vfyTableEntry": { try { getNeg = inArray[6]; tmpString = "CHECKPOINT:"; tstresult = arrayAppend("True", tmpString, "20", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); thsItem = inArray[8]; inArray = vfyListArray(inArray); tmpString = "Searching for the " + inArray[8] + " table........(" + stpNum + ")"; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //wait for the page to load before verification if expecting a table to be present if (inArray[7] == "N") { do { dispObj = WaitUntil(tstObj, inArray[0], out objString, out currTime, inArray[5]); if (currTime.Seconds >= 6) { dispObj = false; break; } } while (dispObj != true); if (objString == "") { tmpString = "Found the " + thsItem + " table......"; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); for (int x = 0; x < inArray.Length - 9; x++) { if (dispObj == true) { tstObj.vfyTableEntry(tstObj, inArray[0], inArray[1], inArray[2], inArray[3], inArray[4], inArray[5], inArray[6], inArray[7], inArray[8], inArray[x + 9], datsource, stpNum, pth, ref retXpath, ref tstresult, out fndExcep, out tstFail); } else { fndExcep = -1; tmpString = objString; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); } } } else { fndExcep = -1; objString = ""; tmpString = "The " + thsItem + " item was not found......(Step " + stpNum.ToString() + ")"; tstresult = arrayAppend("True", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); tstresult = arrayAppend("True", objString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); } } else { tmpString = "Verifying that the " + thsItem + " table is present"; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //TextFileOps.Write(pth, "Found the " + thsItem + " table......", 1); for (int x = 0; x < inArray.Length - 9; x++) { do { dispObj = WaitUntil(tstObj, inArray[0], out objString, out currTime, inArray[6]); if (currTime.Seconds >= 6) { dispObj = false; break; } } while (dispObj != true); if (dispObj == true) { tstObj.vfyTableEntry(tstObj, inArray[0], inArray[1], inArray[2], inArray[3], inArray[4], inArray[5], inArray[6], inArray[7], inArray[8], inArray[x + 9], datsource, stpNum, pth, ref retXpath, ref tstresult, out fndExcep, out tstFail); } else { fndExcep = -1; tmpString = objString; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); } } } tmpString = "Finished checking the " + thsItem + " item..."; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); tmpString = "END CHECKPOINT:"; tstresult = arrayAppend("True", tmpString, "20", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); } catch (Exception e) { //Record failed result tmpString = "Failed clicking the dropdown list box: " + e.Message; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //Record exception and begin exit process fndExcep = -1; } break; } #endregion #region vfyDropdown case "vfyDropdown": { try { thsItem = inArray[4]; inArray = vfyListArray(inArray); getNeg = inArray[2]; tmpString = "CHECKPOINT:"; tstresult = arrayAppend("True", tmpString, "20", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); tmpString = "Searching for the " + inArray[3] + " dropdown........(" + stpNum + ")"; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //wait for the page to load before verification if expecting a table to be present if (inArray[2] != "N" && inArray[2] != "n") { do { dispObj = WaitUntil(tstObj, inArray[0], out objString, out currTime, ""); if (currTime.Seconds >= 6) { dispObj = false; break; } } while (dispObj != true); if (dispObj == true) { tmpString = "Found the " + thsItem + " table......"; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //driver.FindElement(By.XPath(inArray[0])).Click(); for (int x = 0; x < inArray.Length - 4; x++) { if (x > 0) { itmPath = inArray[0] + "[" + Convert.ToString(x + 1) + "]"; } else { if (inArray[1] != "") { itmPath = inArray[0] + "[" + inArray[1] + "]"; } else { itmPath = inArray[0]; } } tstObj.vfyObject(tstObj, itmPath, inArray[1], inArray[2], inArray[3], inArray[x + 4], " dropdown", dispObj, stpNum, pth, ref tstresult, out fndExcep, out tstFail); } //driver.FindElement(By.XPath(inArray[0])).Click(); } else { tmpString = "The " + thsItem + " dropdown was not found......"; tstresult = arrayAppend("True", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); fndExcep = -1; } } else { for (int x = 0; x < inArray.Length - 4; x++) { tstresult = arrayAppend("verify", "table", dispObj.ToString(), inArray[x + 4], inArray[x + 4], inArray[3], String.Empty, String.Empty, String.Empty, tstresult); if (x > 0) { itmPath = inArray[1] + "[" + Convert.ToString(x + 1) + "]"; } else { if (inArray[2] != "") { itmPath = inArray[1] + "[" + inArray[2] + "]"; } else { itmPath = inArray[1]; } } tstObj.vfyObject(tstObj, itmPath, inArray[1], inArray[2], inArray[3], inArray[x + 4], " dropdown", dispObj, stpNum, pth, ref tstresult, out fndExcep, out tstFail); } } tmpString = "Finished checking the " + thsItem + " item..."; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); tmpString = "END CHECKPOINT:"; tstresult = arrayAppend("True", tmpString, "20", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); } catch (Exception e) { //Record failed result tmpString = "Failed clicking the dropdown list box: " + e.Message; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //Record exception and begin exit process fndExcep = -1; } break; } #endregion #region vfyButton case "vfyButton": { try { thsItem = inArray[4]; inArray = vfyListArray(inArray); getNeg = inArray[2]; tmpString = "CHECKPOINT:"; tstresult = arrayAppend("True", tmpString, "20", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); tmpString = "Searching for the " + inArray[2] + " button........(" + stpNum + ")"; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //section off the scenarios if the field is (!=N) or is not (==N) present on the screen if (inArray[2] != "N" && inArray[2] != "n") { do { dispObj = WaitUntil(tstObj, inArray[0], out objString, out currTime, ""); if (currTime.Seconds >= 6) { dispObj = false; break; } } while (dispObj != true); if (dispObj == true) { tmpString = "Found the " + thsItem + " button......"; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //TextFileOps.Write(pth, "Found the " + thsItem + " item......", 1); //driver.FindElement(By.XPath(inArray[0])).Click(); for (int x = 0; x < inArray.Length - 4; x++) { if (x > 0) { itmPath = inArray[0] + "[" + Convert.ToString(x + 1) + "]"; } else { if (inArray[1] != "") { itmPath = inArray[0] + "[" + inArray[1] + "]"; } else { itmPath = inArray[0]; } } tstObj.vfyObject(tstObj, itmPath, inArray[1], inArray[2], inArray[3], inArray[x + 4], " button", dispObj, stpNum, pth, ref tstresult, out fndExcep, out tstFail); } } else { tmpString = "The " + thsItem + " button was not found......"; tstresult = arrayAppend("True", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); fndExcep = -1; } } else { tmpString = "Verifying that the " + thsItem + " button is not present"; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); for (int x = 0; x < inArray.Length - 4; x++) { if (x > 0) { itmPath = inArray[1] + "[" + Convert.ToString(x + 1) + "]"; } else { if (inArray[1] != "") { itmPath = inArray[0] + "[" + inArray[1] + "]"; } else { itmPath = inArray[0]; } } tstObj.vfyObject(tstObj, itmPath, inArray[1], inArray[2], inArray[3], inArray[x + 4], " button", dispObj, stpNum, pth, ref tstresult, out fndExcep, out tstFail); } } tmpString = "Finished checking the " + thsItem + " button..."; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); tmpString = "END CHECKPOINT:"; tstresult = arrayAppend("True", tmpString, "20", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); } catch (Exception e) { //Record failed result tmpString = "Failed clicking the dropdown list box: " + e.Message; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //Record exception and begin exit process fndExcep = -1; } break; } #endregion #region vfyImages case "vfyImages": { try { thsItem = inArray[4]; inArray = vfyListArray(inArray); getNeg = inArray[2]; tmpString = "CHECKPOINT:"; tstresult = arrayAppend("True", tmpString, "20", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); tmpString = "Searching for the " + inArray[3] + " image........(" + stpNum + ")"; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //section off the scenarios if the field is (!=N) or is not (==N) present on the screen if (inArray[2] != "N" && inArray[2] != "n") { do { dispObj = WaitUntil(tstObj, inArray[0], out objString, out currTime, ""); if (currTime.Seconds >= 6) { dispObj = false; break; } } while (dispObj != true); if (dispObj == true) { tmpString = "Found the " + thsItem + " image......"; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //driver.FindElement(By.XPath(inArray[0])).Click(); for (int x = 0; x < inArray.Length - 4; x++) { if (x > 0) { itmPath = inArray[0] + "[" + Convert.ToString(x + 1) + "]"; } else { if (inArray[1] != "") { itmPath = inArray[0] + "[" + inArray[1] + "]"; } else { itmPath = inArray[0]; } } tstObj.vfyObject(tstObj, itmPath, inArray[1], inArray[2], inArray[3], inArray[x + 4], " image", dispObj, stpNum, pth, ref tstresult, out fndExcep, out tstFail); } //driver.FindElement(By.XPath(inArray[0])).Click(); } else { TextFileOps.Write(pth, "The " + thsItem + " image was not found......", -1); tstresult = arrayAppend("True", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); fndExcep = -1; } } else { TextFileOps.Write(pth, "Verifying that the " + thsItem + " image is not present", 1); for (int x = 0; x < inArray.Length - 4; x++) { if (x > 0) { itmPath = inArray[0] + "[" + Convert.ToString(x + 1) + "]"; } else { if (inArray[1] != "") { itmPath = inArray[0] + "[" + inArray[1] + "]"; } else { itmPath = inArray[0]; } } tstObj.vfyObject(tstObj, itmPath, inArray[1], inArray[2], inArray[3], inArray[x + 4], " image", dispObj, stpNum, pth, ref tstresult, out fndExcep, out tstFail); } } tmpString = "Finished checking the " + thsItem + " image..."; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); tmpString = "END CHECKPOINT:"; tstresult = arrayAppend("True", tmpString, "20", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); } catch (Exception e) { //Record failed result tmpString = "Failed finding image: " + e.Message; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //Record exception and begin exit process fndExcep = -1; } break; } #endregion #region vfyField case "vfyField": { try { thsItem = inArray[4]; inArray = vfyListArray(inArray); getNeg = inArray[2]; tmpString = "CHECKPOINT:"; tstresult = arrayAppend("True", tmpString, "20", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); tmpString = "Searching for the " + inArray[3] + " field........(" + stpNum + ")"; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //section off the scenarios if the field is (!=N) or is not (==N) present on the screen if (inArray[2] != "N" && inArray[2] != "n") { do { dispObj = WaitUntil(tstObj, inArray[0], out objString, out currTime, ""); if (currTime.Seconds >= 6) { dispObj = false; break; } } while (dispObj != true); if (dispObj == true) { tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //driver.FindElement(By.XPath(inArray[0])).Click(); for (int x = 0; x < inArray.Length - 4; x++) { if (x > 0) { itmPath = inArray[0] + "[" + Convert.ToString(x + 1) + "]"; } else { itmPath = inArray[0]; } tstObj.vfyObject(tstObj, itmPath, inArray[1], inArray[2], inArray[3], inArray[x + 4], " field", dispObj, stpNum, pth, ref tstresult, out fndExcep, out tstFail); } //driver.FindElement(By.XPath(inArray[0])).Click(); } else { tmpString = "The " + thsItem + " object was not found......"; tstresult = arrayAppend("True", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); fndExcep = -1; } } else { tmpString = "Verifying that the " + thsItem + " table is not present"; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); for (int x = 0; x < inArray.Length - 4; x++) { if (x > 0) { itmPath = inArray[0] + "[" + Convert.ToString(x + 1) + "]"; } else { if (inArray[2] != "") { itmPath = inArray[1] + "[" + inArray[2] + "]"; } else { itmPath = inArray[1]; } } tstObj.vfyObject(tstObj, itmPath, inArray[1], inArray[2], inArray[3], inArray[x + 4], " field", dispObj, stpNum, pth, ref tstresult, out fndExcep, out tstFail); } } tmpString = "Finished checking the " + thsItem + " field..."; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); tmpString = "END CHECKPOINT:"; tstresult = arrayAppend("True", tmpString, "20", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); } catch (Exception e) { //Record failed result tmpString = e.Message; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //Record exception and begin exit process fndExcep = -1; } break; } #endregion #region vfyNote case "vfyNote": { vfyNote(pth, inArray[0]); break; } #endregion #region vfyText case "vfyText": { try { thsItem = inArray[4]; inArray = vfyListArray(inArray); getNeg = inArray[2]; tmpString = "CHECKPOINT:"; tstresult = arrayAppend("True", tmpString, "20", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); tmpString = "Searching for the " + inArray[2] + " text........(" + stpNum + ")"; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //section off the scenarios if the field is (!=N) or is not (==N) present on the screen if (inArray[1] != "N" && inArray[1] != "n") { do { dispObj = WaitUntil(tstObj, inArray[0], out objString, out currTime, ""); if (currTime.Seconds >= 6) { dispObj = false; break; } } while (dispObj != true); if (dispObj == true) { tmpString = "Found the " + thsItem + " text......"; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); for (int x = 0; x < inArray.Length - 4; x++) { if (x > 0) { itmPath = inArray[0] + "[" + Convert.ToString(x + 1) + "]"; } else { if (inArray[1] != "") { itmPath = inArray[0] + "[" + inArray[1] + "]"; } else { itmPath = inArray[0]; } } tstObj.vfyObject(tstObj, itmPath, inArray[1], inArray[2], inArray[3], inArray[x + 4], " text", dispObj, stpNum, pth, ref tstresult, out fndExcep, out tstFail); } } else { tmpString = "The " + thsItem + " text was not found......"; tstresult = arrayAppend("True", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); fndExcep = -1; } } else { tmpString = "Verifying that the " + thsItem + " text is not present"; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); } tmpString = "Finished checking the " + thsItem + " text..."; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); tmpString = "END CHECKPOINT:"; tstresult = arrayAppend("True", tmpString, "20", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); } catch (Exception e) { //Record failed result tmpString = e.Message; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //Record exception and begin exit process fndExcep = -1; } break; } #endregion #region vfyLink case "vfyLink": { try { thsItem = inArray[4]; inArray = vfyListArray(inArray); getNeg = inArray[2]; tmpString = "CHECKPOINT:"; tstresult = arrayAppend(dispObj.ToString(), tmpString, "20", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); tmpString = "Searching for the " + inArray[4] + " link........(" + stpNum + ")"; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //section off the scenarios if the field is (!=N) or is not (==N) present on the screen if (inArray[2] != "N" && inArray[2] != "n") { do { dispObj = WaitUntil(tstObj, inArray[0], out objString, out currTime, inArray[3]); //break the loop if looking for more than 6 seconds if (currTime.Seconds >= 6) { dispObj = false; break; } } while (dispObj != true); if (dispObj == true) { tmpString = "Found the " + thsItem + " link......"; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //driver.FindElement(By.XPath(inArray[0])).Click(); for (int x = 0; x < inArray.Length - 4; x++) { if (x > 0) { itmPath = inArray[0] + "[" + Convert.ToString(x + 1) + "]"; } else { if (inArray[1] != "") { itmPath = inArray[0] + "[" + inArray[1] + "]"; } else { itmPath = inArray[0]; } } tstObj.vfyObject(tstObj, itmPath, inArray[1], inArray[2], inArray[3], inArray[x + 4], " link", dispObj, stpNum, pth, ref tstresult, out fndExcep, out tstFail); } //driver.FindElement(By.XPath(inArray[0])).Click(); } else { tmpString = "The " + thsItem + " link was not found......"; tstresult = arrayAppend("True", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); fndExcep = -1; } } else { tmpString = "Verifying that the " + thsItem + " link is not present"; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); for (int x = 0; x < inArray.Length - 4; x++) { if (x > 0) { itmPath = inArray[1] + "[" + Convert.ToString(x + 1) + "]"; } else { if (inArray[2] != "") { itmPath = inArray[1] + "[" + inArray[2] + "]"; } else { itmPath = inArray[1]; } } tstObj.vfyObject(tstObj, itmPath, inArray[1], inArray[2], inArray[3], inArray[x + 4], " link", dispObj, stpNum, pth, ref tstresult, out fndExcep, out tstFail); } } tmpString = "Finished checking the " + thsItem + " text..."; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); tmpString = "END CHECKPOINT:"; tstresult = arrayAppend("True", tmpString, "20", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); } catch (Exception e) { //Record failed result tmpString = e.Message; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //Record exception and begin exit process fndExcep = -1; } break; } #endregion #region Wait case "Wait": { try { tstObj.Wait(inArray[0]); tstresult = arrayAppend("True", "Waiting " + inArray[0] + " seconds........(" + stpNum + ")", "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); } catch (Exception e) { //Record failed result tmpString = e.Message; tstresult = arrayAppend("False", tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); //Record exception and begin exit process fndExcep = -1; } break; } #endregion #region default default: fndExcep = -1; TextFileOps.Write(pth, "Step (" + stpNum + "), " + doFunc + " is not present in the testing app", -1); break; #endregion } if (doFunc != "vfyNote") { if (doFunc != "Logout") tmpString = "Operation - " + doFunc + ": Excel line number - " + lnNum; else tmpString = "Operation - " + doFunc; tstresult = arrayAppend("True", tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); } } catch (Exception e) { tstresult = arrayAppend("False", e.Message, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult); fndExcep = -1; } }