Ejemplo n.º 1
0
        internal void ChatWithOtherUser(IWebDriver driver)
        {
            // Populate the excel data into system
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "SignIn");

            // Wait and click on Search icon
            GlobalDefinitions.WaitForElementClickable(driver, "XPath",
                                                      "//i[@class='search link icon']", 10);
            SearchIcon.Click();

            // Wait and Enter name in Search user part
            GlobalDefinitions.WaitForElement(driver, "XPath",
                                             "//input[@placeholder='Search user']", 10);
            SearchUserInput.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Name"));

            // Wait and Choosse the first one option
            Thread.Sleep(1500);
            DropdownFirstOpt.Click();

            // Wait and Choose the first one result
            GlobalDefinitions.WaitForElement(driver, "XPath",
                                             "//*[@id='service-search-section']//div[2]/div/div/div[1]/a/img", 10);
            ResultFirstOpt.Click();

            // Wait and click on Chat button
            GlobalDefinitions.WaitForElementClickable(driver, "XPath",
                                                      "//a[@href='/Home/Message/?user=5fc9c489b2bb710001b08fb7']", 10);
            ChatBtnOnProfile.Click();

            // Wait and input message in input area
            GlobalDefinitions.WaitForElement(driver, "Id", "chatTextBox", 10);
            ChatInputArea.SendKeys("Hi! Test!");
            Thread.Sleep(500);

            // Click on send button
            SendBtn.Click();

            // Extent report
            Base.test.Log(LogStatus.Pass, "Chat with other users successfully!");
        }
Ejemplo n.º 2
0
        public void ChatWithOtherUser(IWebDriver driver)
        {
            // Populate the excel data into system
            ExcelLib.PopulateInCollection(ConstantUtils.TestDataPath, "SignIn");

            // Wait and click on Search icon
            WaitForElementClickable(driver, "XPath",
                                    "//i[@class='search link icon']", 10);
            SearchIcon.Click();

            // Wait and Enter name in Search user part
            WaitForElement(driver, "XPath",
                           "//input[@placeholder='Search user']", 10);
            SearchUserInput.SendKeys(ExcelLib.ReadData(3, "Name"));

            // Wait and Choosse the first one option
            Thread.Sleep(1500);
            DropdownFirstOpt.Click();

            // Wait and Choose the first one result
            WaitForElement(driver, "XPath",
                           "//*[@id='service-search-section']//div[2]/div/div/div[1]/a/img", 10);
            ResultFirstOpt.Click();

            // Wait and click on Chat button
            WaitForElementClickable(driver, "XPath",
                                    "//a[@href='/Home/Message/?user=5fc9c489b2bb710001b08fb7']", 10);
            ChatBtnOnProfile.Click();

            // Wait and input message in input area
            WaitForElement(driver, "Id", "chatTextBox", 10);
            ChatInputArea.SendKeys("Hi! Test!");
            Thread.Sleep(500);

            // Click on send button
            SendBtn.Click();
        }