예제 #1
0
        private Boolean RunSteps(IWebElement elem, int row = 0)
        {
            Boolean stepResult = true;

            if (action.Equals("click") || action.Equals("clickByJS"))
            {
                driver.TakeElemSnapshot(elem, sheetName, fileName, testcase, stepnumber);
            }

            switch (action)
            {
            case "open":
                stepResult = driver.Open(testdata);
                break;

            case "click":
                stepResult = driver.ClickObject(elem);
                break;

            case "clickByJS":
                stepResult = driver.ClickByJS(elem);
                break;

            case "select":
                stepResult = driver.SelectOptions(elem, testdata);
                break;

            case "type":
                stepResult = driver.SendKeys(elem, testdata);
                break;

            case "typeByJS":
                stepResult = driver.SendKeysByJS(elem, testdata);
                break;

            case "delay":
                stepResult = driver.DelayExplicit(testdata);
                break;

            case "delayUntilFieldHasValue":
                stepResult = driver.DelayUntilFieldIsPopulated(elem);
                break;

            case "acceptAlert":
                stepResult = driver.AcceptAlert();
                exitIfNull = false;
                break;

            case "dismissAlert":
                stepResult = driver.DismissAlert();
                exitIfNull = false;
                break;

            case "getdata":
                stepResult = WriteCellData(fileName, driver.GetData(elem), row);
                break;

            case "getElementAttribute":
                stepResult = WriteCellData(fileName, driver.GetElementAttribute(elem, testdata), row);
                break;

            case "customUploadInternetMandatoryDocs":
                stepResult = driver.CustomActionUploadInternetMandatoryDoc(testdata);
                break;

            case "customUploadInternetNonMandatoryDocs":
                stepResult = driver.CustomActionUploadInternetNonMandatoryDoc(testdata);
                break;

            case "customUploadAVAInternetMandatoryDocs":
                stepResult = driver.CustomActionAVAUploadInternetMandatoryDoc(testdata);
                break;

            case "customUploadAVAInternetNonMandatoryDocs":
                stepResult = driver.CustomActionAVAUploadInternetNonMandatoryDoc(testdata);
                break;

            case "customInternetCompareTableDataDates":
                stepResult = driver.CustomActionInternetCompareTableDataDates(testdata);
                break;

            case "customInternetVerifyCorrespondenceAppDetails":
                stepResult = driver.CustomInternetVerifyCorrespondenceAppDetails(elem);
                exitIfNull = false;
                break;

            case "customInternetVerifyCorrespondenceCorrDetails":
                stepResult = driver.CustomInternetVerifyCorrespondenceCorrDetails(elem);
                exitIfNull = false;
                break;

            case "customIntranetSearchAppNum":
                stepResult = driver.CustomActionIntranetSearchAppNum(testdata);
                exitIfNull = false;
                break;

            case "customIntranetBPMChangeValues":
                stepResult = driver.CustomActionIntranetBPMChangeValues(testdata);
                exitIfNull = false;
                break;

            case "skip":
                stepResult = driver.Skip();
                exitIfNull = false;
                break;

            case "switchToNewFrame":
                stepResult = driver.SwitchToNewFrame(elem);
                exitIfNull = false;
                break;

            case "switchToNewWindow":
                stepResult = driver.SwitchToNewWindow(testdata);
                exitIfNull = false;
                break;

            case "switchToParentWindow":
                stepResult = driver.SwitchToParentWindow();
                exitIfNull = false;
                break;

            case "verifyElementPresent":
                stepResult = driver.VerifyElementPresent(elem);
                exitIfNull = false;
                break;

            case "verifyElementIsSelected":
                stepResult = driver.VerifyElementIsSelected(elem);
                exitIfNull = false;
                break;

            case "verifyElementIsNotSelected":
                stepResult = driver.VerifyElementIsNotSelected(elem);
                exitIfNull = false;
                break;

            case "verifyElementNotPresent":
                stepResult = driver.VerifyElementNotPresent(elem);
                exitIfNull = false;
                break;

            case "verifyFieldValue":
                stepResult = driver.VerifyFieldValue(elem, testdata);
                exitIfNull = false;
                break;

            case "verifyElementContainsText":
                stepResult = driver.VerifyElementContainsText(elem, testdata);
                exitIfNull = false;
                break;

            case "verifyElementCount":
                stepResult = driver.VerifyElementCount(testdata, locator, locvalue, attribute, attrvalue);
                exitIfNull = false;
                break;

            case "verifyMinElementCount":
                stepResult = driver.VerifyMinElementCount(testdata, locator, locvalue, attribute, attrvalue);
                exitIfNull = false;
                break;

            case "verifyMaxElementCount":
                stepResult = driver.VerifyMaxElementCount(testdata, locator, locvalue, attribute, attrvalue);
                exitIfNull = false;
                break;

            case "confirmJavescriptWindow":
                stepResult = driver.ConfirmJavescriptWindow(testdata);
                exitIfNull = false;
                break;

            default:
                stepResult = false;
                break;
            }

            if (!action.Equals("click") && !action.Equals("clickByJS"))
            {
                driver.TakeElemSnapshot(elem, sheetName, fileName, testcase, stepnumber);
            }

            return(stepResult);
        }