コード例 #1
0
        public void OpenFirstDocketFromGrid()
        {
            IsropaLogin.Login();
            SelectClerkMenuFromMainPage.SelectClerkMenu();

            //Double click the docket to open it
            var element = GenericHelper.WaitForElementAndGetIt(ObjectRepository.Driver, By.XPath("//table[@id='ctl00_ContentPlaceHolder1_productGridView']/descendant::tr[2]"));

            MouseActionsHelper.DoubleClick(element);
            BrowserHelper.SwitchToWindow(1);

            //locate the service table and pull all the services
            var ServicesList = ObjectRepository.Driver.FindElements(By.Id("ctl00_ContentPlaceHolder1_productGridView"));

            foreach (var item in ServicesList)
            {
                Console.WriteLine(item.Text);
            }

            //locate the first service and perform a right click on it
            var Service = GenericHelper.WaitForElementAndGetIt(ObjectRepository.Driver, By.XPath("//table[@id='ctl00_ContentPlaceHolder1_productGridView']/descendant::tr[2]"));

            MouseActionsHelper.RightClick(Service);
            Thread.Sleep(3000);
        }
コード例 #2
0
        public void getAllElements()
        {
            IsropaLogin.Login();
            SelectClerkMenuFromMainPage.SelectClerkMenu();

            var element = GenericHelper.WaitForElementAndGetIt(ObjectRepository.Driver, By.XPath("//table[@id='ctl00_ContentPlaceHolder1_productGridView']/descendant::tr[2]"));

            MouseActionsHelper.DoubleClick(element);
            Thread.Sleep(3000);


            //locate the table element
            IWebElement docketTable = ObjectRepository.Driver.FindElement(By.XPath("//table[@id='ctl00_ContentPlaceHolder1_productGridView']/child::tbody"));

            //locate the rows in the original table docketTable
            List <IWebElement> tableRows = new List <IWebElement>(docketTable.FindElements(By.TagName("tr")));

            Console.WriteLine("current table has .{0}", tableRows.Count);

            foreach (var colElement in tableRows)
            {
                //Getting Number of cols in row table

                IList <IWebElement> cols = new List <IWebElement>(colElement.FindElements(By.TagName("td")));

                if (cols.Count > 0)
                {
                    //Iterating through each cell

                    foreach (var cellData in cols)
                    {
                        //getting each cell data


                        if (cellData.Text == "CALF")
                        {
                            ServiceAbbr.Add(cellData);
                        }
                        //Console.WriteLine("Cell No " + data);
                    }
                }
            }
            Console.WriteLine("ServiceAbbr count Is.{0}", ServiceAbbr.Count);



            //   List<IWebElement>  CellsList = new List<IWebElement>(docketTable.FindElements(By.TagName("td")));

            //List<IWebElement> templist = new List<IWebElement>(tableRows[0].FindElements(By.TagName("td")));
        }
コード例 #3
0
ファイル: NazClerkMenu.cs プロジェクト: ekbassa/MyFramework
        public void SelectTheFirstDocktOfToday()
        {
            NazOpenFilesToday();
            //Actions act = new Actions(ObjectRepository.Driver);
            var elem = ObjectRepository.Driver.FindElement(By.XPath("//table[@id='ctl00_ContentPlaceHolder1_productGridView']/descendant::td[1]"));

            //  act.DoubleClick(elem);
            //  act.Build();
            //  act.Perform();

            MouseActionsHelper.DoubleClick(elem);



            Thread.Sleep(10000);
        }
コード例 #4
0
        public void SelectFirstDocket()
        {
            IsropaLogin.Login();
            SelectClerkMenuFromMainPage.SelectClerkMenu();

            var element = GenericHelper.WaitForElementAndGetIt(ObjectRepository.Driver, By.XPath("//table[@id='ctl00_ContentPlaceHolder1_productGridView']/descendant::tr[2]"));

            MouseActionsHelper.DoubleClick(element);
            Thread.Sleep(3000);

            //select all the docket services
            var ServicesList = ObjectRepository.Driver.FindElements(By.XPath("//table[@id='ctl00_ContentPlaceHolder1_productGridView']"));

            foreach (var item in ServicesList)
            {
                Console.WriteLine();
            }
        }