public static void  ScrollToBottomMC(IWebDriver driver)

        {
            for (int i = 1; i <= 100; i++)
            {
                try
                {
                    string si = driver.FindElement(By.XPath("//*[@class='si-overs' and text()=0.1]")).Text;

                    if (si.Contains("(0.1)"))

                    {
                        FunctionalLibrary.waitForElement(driver, "//*[@class='footer-link container']");
                        FunctionalLibrary.MouseOver(driver, "//*[@class='footer-link container']");
                        break;
                    }
                }


                catch
                {
                    FunctionalLibrary.waitForElement(driver, "//*[@class='footer-link container']");

                    IWebElement element = driver.FindElement(By.XPath("//*[@class='footer-link container']"));


                    FunctionalLibrary.MouseOver(driver, "//*[@class='footer-link container']");
                }
            }
        }
        public static void MouseOver(IWebDriver driver, string LocaterValue)

        {
            FunctionalLibrary.waitForElement(driver, LocaterValue);

            IWebElement element = driver.FindElement(By.XPath(LocaterValue));



            ((IJavaScriptExecutor)driver).ExecuteScript("arguments[0].scrollIntoView(); ", element);

            OpenQA.Selenium.Interactions.Actions action = new Actions(driver);

            action.MoveToElement(element).Perform();
        }
        public static int  ballCount(IWebDriver driver, string LocaterVaue)
        {
            string ballcount = FunctionalLibrary.ElementText(driver, LocaterVaue);
            string count1    = (ballcount.Substring(1, 2));

            string count2 = ballcount.Substring(4, 1);



            int Icount1 = Convert.ToInt32(count1);

            int Icount2 = Convert.ToInt32(count2);


            int Bcount = Icount1 * 6 + Icount2;


            return(Bcount);
        }
Esempio n. 4
0
        public void TestMethod1()
        {
            IWebDriver driver = new ChromeDriver();

            driver.Navigate().GoToUrl("https://siplayerhub.darwinbox.in/attendance");

            driver.Manage().Window.Maximize();

            FunctionalLibrary.TypeAction(driver, "UserLogin_username", "id", "SI2055");

            FunctionalLibrary.TypeAction(driver, "UserLogin_password", "id", "Sportz@123");

            FunctionalLibrary.DropDown(driver, "//*[@class='form-group db-form-group']/select", "Attendance");

            FunctionalLibrary.clickAction(driver, "login-submit", "id");

            //  string txt = FunctionalLibrary.ElementText(driver, "//span[contains(text(),'Absent')]");


            //string date = DateTime.Today.ToString();

            //string cdate = date.Substring(0, 2);

            //int date1 = Convert.ToInt32(cdate);


            //int Rdate = date1 - 1;

            //Console.WriteLine(Rdate);

            //Thread.Sleep(2000);

            FunctionalLibrary.waitForElement(driver, "//*[@id='attendance_request']");

            FunctionalLibrary.clickAction(driver, "attendance_request", "id");


            Thread.Sleep(2000);

            FunctionalLibrary.waitForElement(driver, "//*[@class='al-other-than-shift']/div/div");

            FunctionalLibrary.MouseOver(driver, "//*[@class='al-other-than-shift']/div/div");

            FunctionalLibrary.clickAction(driver, "//*[@class='al-other-than-shift']/div/div", "xpath");


            Thread.Sleep(2000);

            FunctionalLibrary.clickAction(driver, "//*[@class='al-other-than-shift']/div/div/div[2]/div[2]", "xpath");


            //FunctionalLibrary.clickAction(driver, "//*[@class='al-request-log-form-container']/div[1]", "xpath");

            //FunctionalLibrary.waitForElement(driver, "//a[contains(text(),'" + Rdate + "')]");

            //FunctionalLibrary.clickAction(driver, "//a[contains(text(),'" + Rdate + "')]", "xpath");

            //FunctionalLibrary.waitForElement(driver, "//input[@id='punchin-date-to']");

            //FunctionalLibrary.clickAction(driver, "//input[@id='punchin-date-to']", "xpath");

            //FunctionalLibrary.waitForElement(driver, "//a[@class='ui-state-default'][contains(text(),'" + Rdate + "')]");

            //FunctionalLibrary.clickAction(driver, "//a[@class='ui-state-default'][contains(text(),'" + Rdate + "')]", "xpath");


            FunctionalLibrary.clickAction(driver, "/html/body/div[2]/div[1]/div/div[11]/div/div/div/div[2]/form/div[1]/div[6]/div[3]/div/input", "xpath");

            FunctionalLibrary.waitForElement(driver, "/html/body/div[2]/div[1]/div/div[11]/div/div/div/div[2]/form/div[1]/div[6]/div[3]/div/div[2]/div[1]");

            FunctionalLibrary.clickAction(driver, "/html/body/div[2]/div[1]/div/div[11]/div/div/div/div[2]/form/div[1]/div[6]/div[3]/div/div[2]/div[1]", "xpath");


            Thread.Sleep(2000);

            FunctionalLibrary.TypeAction(driver, "//textarea[@id='AttendanceRequestForm_message']", "xpath", "Work form Home Request");



            FunctionalLibrary.clickAction(driver, "//input[@id='add_request_btn']", "xpath");
        }