Пример #1
0
        //this is the test code generated by selenium
        //****Paste test script here*****
        public override void RunTest()
        {
            selenium.Open(base.baseURL);

            quality.AreEqual("Garmin Product Updates for Kenwood", quality.GetTitle());
            quality.Click("//div[@id='bd']/div[6]/div[2]/div/div/a/span");
            quality.WaitForPageToLoad("30000");

            ken.ActivateMapPage();

            //comment: Type valid data and obtain the unlock code
            quality.Type("id=unitId", "3563850818");
            quality.Type("id=validationCode", validationCode);
            quality.Type("id=productKey", productKey);
            quality.Click("css=a.button > span");
            quality.WaitForPageToLoad("30000");

            ken.MapSuccessfullyActivatedPage();
        }
Пример #2
0
        //this is the test code generated by selenium
        //****Paste test script here*****
        public override void RunTest()
        {
            selenium.Open(base.baseURL);

            quality.AreEqual("Garmin Product Updates for Kenwood", quality.GetTitle());
            quality.Click("//div[@id='bd']/div[6]/div[2]/div/div/a/span");
            quality.WaitForPageToLoad("30000");

            ken.ActivateMapPage();

            //get title of the current page for returning to it after the popup window is closed
            string title = quality.GetTitle();

            //comment: Click on "Print these instructions" link
            quality.Click("link=Print these instructions");
            selenium.WaitForPopUp("printPopup", "30000");
            quality.SelectWindow("name=printPopup");

            ken.PrintInstructionsPage();

            quality.SelectWindow(title);

            //comment: Click Activate Map button without entering any value for unit id, validation code, product key
            Thread.Sleep(3000);

            quality.Type("id=unitId", "");
            quality.Type("id=validationCode", "");
            quality.Type("id=productKey", "");
            quality.Click("css=a.button > span");
            quality.WaitForPageToLoad("30000");

            //quality.AreEqual("Validation Code is required", quality.GetText("css=ul.error > li"));
            //quality.AreEqual("Product Key is required", quality.GetText("//div[@id='bd']/div[3]/ul/li[2]"));
            //quality.AreEqual("UnitID is required", quality.GetText("//div[@id='bd']/div[3]/ul/li[3]"));

            //comment: Type an invalid Unit ID
            quality.Type("id=unitId", "3563850498");
            quality.Type("id=validationCode", validationCode);
            quality.Type("id=productKey", productKey);
            quality.Click("css=a.button > span");
            quality.WaitForPageToLoad("30000");

            quality.AreEqual("The information you entered is invalid, verify your entries and try again", quality.GetText("css=ul.error > li"));

            quality.Type("id=unitId", "");
            quality.Type("id=validationCode", "");
            quality.Type("id=productKey", "");
            quality.Click("css=a.button > span");
            quality.WaitForPageToLoad("30000");

            quality.IsTextPresent("Validation Code is required");
            quality.IsTextPresent("Product Key is required");
            quality.IsTextPresent("UnitID is required");

            //comment: Type a long integer invalid Unit ID
            quality.Type("id=unitId", "353563863863850435638638504356386385043563863850435638638504356386385043563863850435638638504356386385043563863850435638638504356385043563898");
            quality.Type("id=validationCode", validationCode);
            quality.Type("id=productKey", productKey);
            quality.Click("css=a.button > span");
            quality.WaitForPageToLoad("30000");

            quality.AreEqual("Please enter a valid Unit ID", quality.GetText("css=ul.error > li"));

            //comment: Type a negative integer invalid Unit ID
            quality.Type("id=unitId", "-3563850818");
            quality.Type("id=validationCode", validationCode);
            quality.Type("id=productKey", productKey);
            quality.Click("css=a.button > span");
            quality.WaitForPageToLoad("30000");

            quality.AreEqual("The information you entered is invalid, verify your entries and try again", quality.GetText("css=ul.error > li"));

            //comment: Type an invalid as set o characters Unit ID
            quality.Type("id=unitId", "asdfasfdasfdsfdsafsdafsdafas");
            quality.Type("id=validationCode", validationCode);
            quality.Type("id=productKey", productKey);
            quality.Click("css=a.button > span");
            quality.WaitForPageToLoad("30000");

            quality.AreEqual("Please enter a valid Unit ID", quality.GetText("css=ul.error > li"));

            //comment: Type special characters as Unit ID
            quality.Type("id=unitId", "!@#$#@$@#!");
            quality.Type("id=validationCode", validationCode);
            quality.Type("id=productKey", productKey);
            quality.Click("css=a.button > span");
            quality.WaitForPageToLoad("30000");

            quality.AreEqual("Please enter a proper Unit ID", quality.GetText("css=ul.error > li"));

            //comment: Type an long invalid validationCode
            quality.Type("id=unitId", unitId);
            quality.Type("id=validationCode", "BBKJBBKJBBKJBBKJBBKJBBKJBBKJBBKJBBKJBBKJBBKJBBKJBBKJBBKJBBKJBBKJBBKJBBKJBBKJ");
            quality.Type("id=productKey", productKey);
            quality.Click("css=a.button > span");
            quality.WaitForPageToLoad("30000");

            quality.AreEqual("Please enter a valid Validation Code", quality.GetText("css=ul.error > li"));


            //comment: Type an integer invalid validationCode
            quality.Type("id=unitId", unitId);
            quality.Type("id=validationCode", "1231313312341341234414");
            quality.Type("id=productKey", productKey);
            quality.Click("css=a.button > span");
            quality.WaitForPageToLoad("30000");

            quality.AreEqual("Please enter a valid Validation Code", quality.GetText("css=ul.error > li"));

            ////comment: Type special characters as validationCode
            //quality.Type("id=unitId", unitId);
            //quality.Type("id=validationCode", "!@##$@!@$$");
            //quality.Type("id=productKey", productKey);
            //quality.Click("css=a.button > span");
            //quality.WaitForPageToLoad("30000");

            ////ATTENTION: Here the validation code is not taken into consideration
            //quality.AreEqual("Please enter a valid Validation Code", quality.GetText("css=ul.error > li"));


            ////comment: Type an invalid validationCode
            //quality.Type("id=unitId", unitId);
            //quality.Type("id=validationCode", "YESR");
            //quality.Type("id=productKey", productKey);
            //quality.Click("css=a.button > span");
            //quality.WaitForPageToLoad("30000");

            ////ATTENTION: Here the validation code is not taken into consideration
            //quality.AreEqual("The information you entered is invalid, verify your entries and try again", quality.GetText("css=ul.error > li"));

            //comment: Type an invalid productKey
            quality.Type("id=unitId", unitId);
            quality.Type("id=validationCode", validationCode);
            quality.Type("id=productKey", "2RF5A7MT");
            quality.Click("css=a.button > span");
            quality.WaitForPageToLoad("30000");

            quality.AreEqual("An error has occurred, please try again", quality.GetText("css=ul.error > li"));

            //comment: Type an long invalid productKey
            quality.Type("id=unitId", unitId);
            quality.Type("id=validationCode", validationCode);
            quality.Type("id=productKey", "TKJEXZ7QTKJEXZ7QTKJEXZ7QTKJEXZ7QTKJEXZ7QTKJEXZ7QTKJEXZ7QTKJEXZ7QTKJEXZ7QTKJEXZ7QTKJEXZ7QTKJEXZ7QTKJEXZ7QTKJEXZ7QTKJEXZ7QTKJEXZ7QTKJEXZ7Q");
            quality.Click("css=a.button > span");
            quality.WaitForPageToLoad("30000");

            quality.AreEqual("Please enter a valid Product Key", quality.GetText("css=ul.error > li"));

            //comment: Type special characteres as productKey
            quality.Type("id=unitId", unitId);
            quality.Type("id=validationCode", validationCode);
            quality.Type("id=productKey", "!@#$%^^%$#");
            quality.Click("css=a.button > span");
            quality.WaitForPageToLoad("30000");

            quality.AreEqual("An error has occurred, please try again", quality.GetText("css=ul.error > li"));

            //comment: Type negative integer as productKey
            quality.Type("id=unitId", unitId);
            quality.Type("id=validationCode", validationCode);
            quality.Type("id=productKey", "-1");
            quality.Click("css=a.button > span");
            quality.WaitForPageToLoad("30000");

            quality.AreEqual("An error has occurred, please try again", quality.GetText("css=ul.error > li"));

            //comment: Type a random integer with 8 characters as productKey
            quality.Type("id=unitId", unitId);
            quality.Type("id=validationCode", validationCode);
            quality.Type("id=productKey", "12345678");
            quality.Click("css=a.button > span");
            quality.WaitForPageToLoad("30000");

            quality.AreEqual("An error has occurred, please try again", quality.GetText("css=ul.error > li"));
        }