@Test( dataProvider = "testData", groups = {"Android"}) public void testChatWithFrontDesk( String email, String password, String chatName, String chatAdminEmail, String chatAdminPassword, String FirstMsg, String description) throws Throwable { Calendar cal = Calendar.getInstance(); String chatUrl = xlsChatFrontDesk.getCellValue("chatURL", "Value"); boolean res = false; try { TestEngine.testDescription.put(HtmlReportSupport.tc_name, description); String testMessage = "Test message " + cal.getTime(); System.out.println("Test message " + testMessage); handleRateAppPopUp(); navigateToMyAccount(); handleRateAppPopUp(); click(AccountPageLocators.logInButton, "logInButton"); login(email, password); handleRateAppPopUp(); navigateToHome(); handleRateAppPopUp(); // handelWelcomeDashboardDialog(); waitForElementPresent(HomePageLocators.chatWithFrontDeskButton, "chatWithFrontDeskButton"); click(HomePageLocators.chatWithFrontDeskButton, "chatWithFrontDeskButton"); if (isElementDisplayed(InHousePhoneLocators.textAreaForChat2)) { click(InHousePhoneLocators.textAreaForChat2, "textAreaForChat2"); type(InHousePhoneLocators.textAreaForChat2, testMessage, "textAreaForChat2"); waitForElementPresent(InHousePhoneLocators.sendButtonForChat2, "sendButtonForChat2"); click(InHousePhoneLocators.sendButtonForChat2, "sendButtonForChat2"); } else { waitForElementPresent(InHousePhoneLocators.textAreaForChat, "textAreaForChat"); click(InHousePhoneLocators.textAreaForChat, "textInputField"); type(InHousePhoneLocators.textAreaForChat, testMessage, "textInputField"); waitForElementPresent(InHousePhoneLocators.textAreaForChat, "textAreaForChat"); // click(InHousePhoneLocators.ChatNameInput, "ChatNameInput"); // type(InHousePhoneLocators.ChatNameInput, chatName, "ChatNameInput"); click(InHousePhoneLocators.sendButtonForChat, "sendButtonForChat"); } String replyMsg = GeneralHelper.FrontDeskChat( chatUrl, chatAdminEmail, chatAdminPassword, testMessage, FirstMsg); if (replyMsg != null) { if (isElementDisplayed(HomePageLocators.chatWithFrontDeskButton)) { click(HomePageLocators.chatWithFrontDeskButton, "chatWithFrontDeskButton"); } res = AndroidDriver2.getPageSource().contains(replyMsg); } System.out.println("resutl " + res); if (res) { Reporter.SuccessReport(description, " Successful"); System.out.println("successfully calling Front Desk "); } else { Reporter.failureReport(description, " Failed"); } } catch (Exception e) { e.printStackTrace(); Reporter.failureReport("LogIn", "Failed"); } }