appModules.Provider_reg_Action.java Source code

Java tutorial

Introduction

Here is the source code for appModules.Provider_reg_Action.java

Source

package appModules;

import org.openqa.selenium.Keys;
import org.testng.Reporter;

import pageObjects.AddMicrositePage;
import pageObjects.ProviderRegistrationPage;
import utility.CommonFunctions;
import utility.Constant;
import utility.ExcelUtils;
import utility.Log;
import utility.Utils;

public class Provider_reg_Action {

    public static void reg(int iTestCaseRow) throws Exception {
        try {
            String url = ExcelUtils.getCellData(iTestCaseRow, Constant.Col_URL);
            System.out.println("provider:" + url);
            ProviderRegistrationPage.geturl(Constant.micurl + url);
            //Log.info("Navigated to Registration page successfully");
            //ProviderRegistrationPage.geturl("https://cos.triplefin.com/triplefin/microsite/d8eds");
            ProviderRegistrationPage.button_Register().click();
            Utils.implicitwait();
            Log.info("Clicked on Register button successfulylly");

            String npinum = ExcelUtils.getCellData(iTestCaseRow, Constant.Col_npiNumber);
            System.out.println(npinum);
            ProviderRegistrationPage.txtbox_NPInumber().click();
            ProviderRegistrationPage.txtbox_NPInumber().sendKeys(npinum);
            Thread.sleep(2000);
            ProviderRegistrationPage.txtbox_NPInumber().sendKeys(Keys.TAB);
            Thread.sleep(5000);
            Log.info("Entered NPI number");

            String Address1 = ExcelUtils.getCellData(iTestCaseRow, Constant.Col_Address1);
            ProviderRegistrationPage.txtbox_Address1().sendKeys(Address1);
            Log.info("Entered Address 1 successfully");

            String deanum = ExcelUtils.getCellData(iTestCaseRow, Constant.Col_deaNumber);
            ProviderRegistrationPage.txtbox_deanumber().clear();
            ProviderRegistrationPage.txtbox_deanumber().sendKeys(deanum);
            Log.info("Entered DEA number successfulylly");

            String licenceNumber = ExcelUtils.getCellData(iTestCaseRow, Constant.Col_licenceNumber);
            ProviderRegistrationPage.txtbox_licenceNumber().clear();
            ProviderRegistrationPage.txtbox_licenceNumber().sendKeys(licenceNumber);
            Log.info("Entered license number successfulylly");

            String email = utility.CommonFunctions.getRandomString(5) + "@triplefin.com";
            ProviderRegistrationPage.txtbox_email().sendKeys(email);
            Log.info("Email entered successfulylly");

            ProviderRegistrationPage.txtbox_dob().click();
            ProviderRegistrationPage.txtbox_dob().sendKeys("04121987");
            Log.info("dob entered successfulylly");

            String password = ExcelUtils.getCellData(iTestCaseRow, Constant.Col_password);
            ProviderRegistrationPage.txtbox_password().sendKeys(password);
            Log.info("Entered password successfulylly");

            String confirmpassword = ExcelUtils.getCellData(iTestCaseRow, Constant.Col_confirmPassword);
            ProviderRegistrationPage.txtbox_confirmPassword().sendKeys(confirmpassword);
            Log.info("Entered confirm password successfulylly");

            ProviderRegistrationPage.button_registerProviderLink().click();

        } catch (Exception e) {
            throw (e);
        }
        Reporter.log("Registered for Provider successfully");

    }

}