コード例 #1
0
        public void CurrentAgroforestry()
        {
            // "Species Group" Menu
            gMethods.FindAndClick(By.XPath("/html/body/div[2]/div[3]/table[1]/tbody/tr/td[1]/div/div[1]/div/div[1]/div[1]/div[2]/div[1]"), driver, true);

            // "Maples"
            gMethods.FindAndClick(By.XPath("/html/body/div[11]/div/ul/li[2]"), driver, true);

            gMethods.AddDelay(500);

            // "Species" Menu
            gMethods.FindAndClick(By.XPath("/html/body/div[2]/div[3]/table[1]/tbody/tr/td[1]/div/div[1]/div/div[2]/div[1]/div[2]/div[1]"), driver, true);

            // "Other Maple"
            gMethods.FindAndClick(By.XPath("/html/body/div[12]/div/ul/li[3]"), driver, true);

            gMethods.AddDelay(500);

            // "Address Query" box
            gMethods.FindAndInput("30", By.XPath("/html/body/div[2]/div[3]/table[1]/tbody/tr/td[1]/div/div[1]/div/div[3]/div[1]/input"), driver, true, false);

            // "Address Query" box
            gMethods.FindAndInput("500", By.XPath("/html/body/div[2]/div[3]/table[1]/tbody/tr/td[1]/div/div[1]/div/div[5]/div[1]/input"), driver, true, false);

            // "Add Species" Button
            gMethods.FindAndClick(By.XPath("/html/body/div[2]/div[3]/table[1]/tbody/tr/td[1]/div/div[1]/div/div[6]/em/button"), driver, true);

            // "Next" Button
            gMethods.FindAndClick(By.XPath("/html/body/div[2]/div[4]/div[2]/span/a/span[2]"), driver, true);
        }
コード例 #2
0
        public void CurrentAgroforestry(CFarmXmlLister.AgroforestrySpecies species)
        {
            gMethods.AddDelay(500);

            // "Species Group" Menu
            gMethods.FindAndClick(By.XPath("//div[contains(@id, 'species group-triggerWrap')]"), driver, true);

            // "Maples"
            gMethods.FindAndClick(By.XPath("//div/ul/li[contains(.,'" + species.SpeciesGroup + "')]"), driver, true);

            gMethods.AddDelay(500);

            // "Species" Menu
            gMethods.FindAndClick(By.XPath("//div[contains(@id, 'species-triggerWrap')]"), driver, true);

            // "Other Maple"
            gMethods.FindAndClick(By.XPath("//div/ul/li[contains(.,'" + species.SpeciesName + "')]"), driver, true);

            gMethods.AddDelay(500);

            // "DBH"
            gMethods.FindAndInput(species.Dbh, By.XPath("/html/body/div[2]/div[3]/table[1]/tbody/tr/td[1]/div/div[1]/div/div[3]/div[1]/input"), driver, true, false);

            if (species.Dbh == "")
            {
                // "Age"
                gMethods.FindAndInput(species.Age, By.XPath("/html/body/div[2]/div[3]/table[1]/tbody/tr/td[1]/div/div[1]/div/div[4]/div[1]/input"), driver, true, false);
            }

            // "Total Number"
            gMethods.FindAndInput(species.TotalNumber, By.XPath("/html/body/div[2]/div[3]/table[1]/tbody/tr/td[1]/div/div[1]/div/div[5]/div[1]/input"), driver, true, false);

            // "Add Species" Button
            gMethods.FindAndClick(By.XPath("//div[contains(@id, 'AddSpeciesButton')]"), driver, true);
        }
コード例 #3
0
ファイル: CFarmXmlTest.cs プロジェクト: CSU-RSF/CometTester
        /// <summary>
        /// Goes through Home Page and Sign in
        /// </summary>
        public void CFarmIntro(string username, string url)
        {
            driver.Driver.Navigate().GoToUrl(url);
            //driver.Driver.Navigate().GoToUrl("http://cfarm-dev1.nrel.colostate.edu/Home");
            //driver.Driver.Manage().Window.Maximize();


            // "Close" button
            gMethods.FindAndClick(By.XPath("//button[contains(.,'Close')]"), driver, true);

            // "Start" button
            gMethods.FindAndClick(By.Id("getstartedbutton"), driver, true);

            // Username
            //different username per browser
            gMethods.FindAndInput(username, By.Id("username"), driver, true, false);

            // Password
            gMethods.FindAndInput("skeebop", By.Id("password"), driver, true, false);

            // "Sign In" button
            gMethods.FindAndClick(By.Id("signInButton"), driver, true);

            gMethods.AddDelay(1000);
        }
コード例 #4
0
ファイル: CFarmTest.cs プロジェクト: CSU-RSF/CometTester
        public void CFarmIntro()
        {
            driver.Driver.Navigate().GoToUrl("http://cometfarm.nrel.colostate.edu/");
            //driver.Driver.Navigate().GoToUrl("http://cfarm-dev1.nrel.colostate.edu/Home");
            if (_whichBrowser != "Internet Explorer")
            {
                driver.Driver.Manage().Window.Maximize();
            }
            // "Close" button
            gMethods.FindAndClick(By.XPath("//button[contains(.,'Close')]"), driver, true);

            // "Start" button
            gMethods.FindAndClick(By.Id("getstartedbutton"), driver, true);

            // Username
            gMethods.FindAndInput("Tester", By.Id("username"), driver, true, false);

            // Password
            gMethods.FindAndInput("skeebop", By.Id("password"), driver, true, false);

            // "Sign In" button
            gMethods.FindAndClick(By.Id("signInButton"), driver, true);

            gMethods.AddDelay(1000);
        }
コード例 #5
0
        public void ParcelLocationsPage()
        {
            // "Address Query" box
            gMethods.FindAndInput("34.351406, -89.621763", By.XPath("//div[contains(@id,'addressText')]/div[1]/input"), driver, true, false);

            // "Go to Location" button
            gMethods.FindAndClick(By.XPath("/html/body/div[10]/div[2]/div/div[1]/div[3]/div/span/a"), driver, true);

            gMethods.AddDelay(500);

            gMethods.ClickOnPage(By.Id("OpenLayers.Layer.Vector_53_svgRoot"), driver, 400, 100, "drag", 100, 100);

            gMethods.AddDelay(500);

            //gMethods.clickOnPage(By.Id("OpenLayers.Layer.Vector_53_svgRoot"), driver, 400, 400, "drag", -400, -400);

            //gMethods.addDelay(500);

            //gMethods.clickOnPage(By.Id("OpenLayers.Layer.Vector_53_svgRoot"), driver, 400, 400, "drag", -400, -400);

            // "Add Parcel by Polygon" button
            gMethods.FindAndClick(By.Id("addPolygon"), driver, true);

            gMethods.ClickOnPage(By.Id("OpenLayers.Map_5_events"), driver, 900, 130, "single", 0, 0);

            gMethods.AddDelay(700);

            gMethods.ClickOnPage(By.Id("OpenLayers.Map_5_events"), driver, 960, 400, "single", 0, 0);

            gMethods.AddDelay(700);

            gMethods.ClickOnPage(By.Id("OpenLayers.Map_5_events"), driver, 720, 480, "single", 0, 0);

            gMethods.AddDelay(700);

            gMethods.ClickOnPage(By.Id("OpenLayers.Map_5_events"), driver, 430, 345, "single", 0, 0);

            gMethods.AddDelay(700);

            gMethods.ClickOnPage(By.Id("OpenLayers.Map_5_events"), driver, 430, 105, "double", 0, 0);

            gMethods.AddDelay(700);

            // "Save" button
            gMethods.FindAndClick(By.Id("button-1073-btnEl"), driver, true);

            gMethods.AddDelay(1000);

            // "I am done defining parcels" button
            gMethods.FindAndClick(By.Id("nextparcelbutton"), driver, true);
        }
コード例 #6
0
ファイル: CFarmCroplands.cs プロジェクト: CSU-RSF/CometTester
        public void ParcelLocationsPage()
        {
            // "Address Query" box
            gMethods.FindAndInput("40.381856, -101.708146", By.XPath("//div[contains(@id,'addressText')]/div[1]/input"), driver, true, false);

            // "Go to Location" button
            gMethods.FindAndClick(By.XPath("/html/body/div[10]/div[2]/div/div[1]/div[3]/div/span/a"), driver, true);

            gMethods.AddDelay(500);

            gMethods.ClickOnPage(By.Id("OpenLayers.Layer.Vector_53_svgRoot"), driver, 400, 100, "drag", 0, 400);

            gMethods.AddDelay(500);

            //gMethods.clickOnPage(By.Id("OpenLayers.Layer.Vector_53_svgRoot"), driver, 400, 400, "drag", -400, -400);

            //gMethods.addDelay(500);

            //gMethods.clickOnPage(By.Id("OpenLayers.Layer.Vector_53_svgRoot"), driver, 400, 400, "drag", -400, -400);

            // "Add Parcel by Polygon" button
            gMethods.FindAndClick(By.Id("addPoint"), driver, true);

            gMethods.ClickOnPage(By.Id("OpenLayers.Map_5_events"), driver, 545, 315, "single", 0, 0);

            gMethods.AddDelay(1000);

            // Area Input
            gMethods.FindAndInput("129", By.XPath("//div[contains(@id,'area')]/div[1]/input"), driver, true, false);

            // "Save" button
            gMethods.FindAndClick(By.Id("button-1073-btnEl"), driver, true);

            gMethods.AddDelay(1000);

            // "I am done defining parcels" button
            gMethods.FindAndClick(By.Id("nextparcelbutton"), driver, true);
        }
コード例 #7
0
        public void ParcelLocationsPage()
        {
            int parcelCount = 1;

            foreach (var parcel in xmlForestry.ForestryParcelList)
            {
                // Find Location Button
                if (parcelCount != 1)
                {
                    gMethods.FindAndClick(By.XPath("//button[contains(@id, 'goToLoc')]"), driver, true);
                }
                parcelCount++;

                // "Address Query" box
                gMethods.FindAndInput(parcel.GpsCoordinates, By.XPath("//input[contains(@id,'locationName')]"), driver, true, false);

                // "Go to Location" button
                gMethods.FindAndClick(By.XPath("//input[contains(@id,'locationGo')]"), driver, true);

                WaitTillMask();

                gMethods.AddDelay(1000);

                if (parcel.Scroll != "")
                {
                    if (Int16.Parse(parcel.Scroll) > 0)
                    {
                        for (int i = 0; i < Int16.Parse(parcel.Scroll); i++)
                        {
                            gMethods.FindAndClick(By.XPath("//button[contains(@class,'ol-zoom-in')]"), driver, true);

                            gMethods.AddDelay(500);
                        }
                    }
                    if (Int16.Parse(parcel.Scroll) < 0)
                    {
                        for (int i = 0; i > Int16.Parse(parcel.Scroll); i--)
                        {
                            gMethods.FindAndClick(By.XPath("//button[contains(@class,'ol-zoom-out')]"), driver, true);

                            gMethods.AddDelay(500);
                        }
                    }
                }

                string resString = gMethods.ElementSize(By.XPath("//div[contains(@id,'olmap')]"), driver, true);
                var    resSplit  = resString.Split(new string[] { "{Width=", ", Height=", "}" }, StringSplitOptions.RemoveEmptyEntries);

                int resAdjustX = (Int32.Parse(resSplit[0]) - 1095) / 2;
                int resAdjustY = (Int32.Parse(resSplit[1]) - 715) / 2;

                if (parcel.DragAdjust != "")
                {
                    string[] dragOffset = parcel.DragAdjust.Split(',');

                    for (int i = 0; i < Int32.Parse(parcel.DragCount); i++)
                    {
                        gMethods.ClickOnPage(By.XPath("//div[contains(@class,'ol-viewport')]"), driver, Int32.Parse(dragOffset[0]) + resAdjustX, Int32.Parse(dragOffset[1]) + resAdjustY, "drag", Int32.Parse(dragOffset[2]), Int32.Parse(dragOffset[3]));
                    }
                }

                gMethods.AddDelay(500);

                // "Add Parcel by Point/Polygon" button

                if (parcel.PointAcres != "")
                {
                    gMethods.FindAndClick(By.Id("addPointButton"), driver, true);

                    string[] pointOffset = parcel.PointAdjust.Split(',');

                    gMethods.ClickOnPage(By.Id("OpenLayers.Map_5_events"), driver, Int32.Parse(pointOffset[0]) + resAdjustX, Int32.Parse(pointOffset[1]) + resAdjustY, "single", 0, 0);

                    gMethods.AddDelay(1000);

                    // Area Input
                    gMethods.FindAndInput(parcel.PointAcres, By.XPath("//div[contains(@id,'area')]/div[1]/input"), driver, true, false);
                }
                else
                {
                    gMethods.FindAndClick(By.Id("addPolygonStandButton"), driver, true);

                    string[] pointOffset = parcel.PolygonVertices.Split(',');

                    for (int i = 0; i < pointOffset.Length - 2; i += 2)
                    {
                        gMethods.ClickOnPage(By.Id("olmap"), driver, Int32.Parse(pointOffset[i]) + resAdjustX, Int32.Parse(pointOffset[i + 1]) + resAdjustY, "single", 0, 0);
                    }

                    gMethods.ClickOnPage(By.Id("olmap"), driver, Int32.Parse(pointOffset[0]) + resAdjustX, Int32.Parse(pointOffset[1]) + resAdjustY, "single", 0, 0);
                    //gMethods.ClickOnPage(By.Id("olmap"), driver, Int32.Parse(pointOffset[pointOffset.Length - 2]) + resAdjustX, Int32.Parse(pointOffset[pointOffset.Length - 1]) + resAdjustY, "double", 0, 0);
                }

                // "Save" button
                gMethods.FindAndClick(By.Id("locationAttSave"), driver, true);

                gMethods.AddDelay(10000);
            }

            // "I am done defining parcels" button
            gMethods.FindAndClick(By.Id("doneStandsButton"), driver, true);
        }
コード例 #8
0
ファイル: CFarmAnimalAg.cs プロジェクト: CSU-RSF/CometTester
        public void PropertyLocation()
        {
            gMethods.AddDelay(1500);

            gMethods.FindAndClick(By.Id("ZipCode"), driver, true);

            gMethods.EnterKeys(By.Id("ZipCode"), driver, Keys.Backspace, null, null, false, 5);

            // "Address Query" box
            gMethods.FindAndInput("80631", By.Id("ZipCode"), driver, true, false);

            gMethods.AddDelay(1000);

            // "Unit" Select - metric
            gMethods.FindAndClick(By.XPath("/html/body/div[2]/div[3]/div[2]/div[1]/div[2]/table/tbody/tr[4]/td/div[1]/select/option[contains(@value,'Metric')]"), driver, true);

            gMethods.AddDelay(1500);

            SaveButton();
        }