예제 #1
0
        public static Boolean ClickByText(this ChromeDriver driver, String key, String keyToFind = "", Boolean isContained = false)
        {
            String translation = "translate(text(),'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')";

            if (isContained)
            {
                return(driver.Click($"//*[contains({translation}, '{key}')]", key, keyToFind));
            }
            else
            {
                return(driver.Click($"//*[{translation} = '{key}']", key, keyToFind));
            }
        }
예제 #2
0
        private static Boolean pollingEmail(KeyWordDetailInfo keyWordDetail, ChromeDriver driver, String url)
        {
            Boolean success = false;

            keyWordDetail.Comments = String.Empty;
            try
            {
                driver.Navigate().GoToUrl(url);
                keyWordDetail.Update(driver);
                if (String.IsNullOrEmpty(keyWordDetail.Email))
                {
                    success = driver.Click("//*[text()='Contact Us']");
                    keyWordDetail.Update(driver);
                }
            }
            catch (Exception ex)
            {
                keyWordDetail.Comments = ex.Message;
            }
            return(success);
        }