//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("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.DeviceSelectionPage(); //comment: Select an european device quality.Select("id=headUnitRegionFilter", "label=All"); quality.WaitForPageToLoad("30000"); quality.Select("id=headUnitRegionFilter", "label=Europe"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Select a Model", quality.GetTitle()); quality.Click("link=KNA-G620T"); quality.WaitForPageToLoad("30000"); ken.ProductUpdatesPage(true); // comment: Click on the "Real-Time Traffic" button quality.Click("//div[@id='productUpdates']/a[2]/div/div"); quality.WaitForPageToLoad("30000"); ken.TrafficSubscriptionPage(); // comment: Click on the first traffic subscription (EU) quality.Click("css=div.text"); quality.WaitForPageToLoad("30000"); // comment: Validate the Traffic Services for Kenwood page ken.TrafficServicesForkenwoodPage(); }
//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("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.DeviceSelectionPage(); quality.Select("id=headUnitRegionFilter", "label=All"); quality.WaitForPageToLoad("30000"); quality.Select("id=headUnitRegionFilter", "label=Other"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Select a Model", quality.GetTitle()); //comment: Select the same device like the one from the XML quality.Click("link=DNX7320"); try { selenium.Click("link=DNX7320"); } catch (Exception) { } quality.WaitForPageToLoad("30000"); ken.ProductUpdatesPage(false); // comment: The "Lastest Map" button is not activated quality.AreEqual("Latest Map", quality.GetText("css=div.noLink")); }
//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("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.DeviceSelectionPage(); //comment: Select the same device like the one from the XML quality.Select("id=headUnitRegionFilter", "label=All"); quality.WaitForPageToLoad("30000"); quality.Select("id=headUnitRegionFilter", "label=North America"); quality.WaitForPageToLoad("30000"); quality.Click("link=DNX7180"); quality.WaitForPageToLoad("30000"); ken.ModelIdentificationPage(); //comment: click on "Read Media" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Scan Portable Media", quality.GetTitle()); if (ken.CheckForTimeOut("Media Scan", "css=div.titleHeader-text", 61)) { failedcheck++; } quality.AreEqual("Media Scan", quality.GetText("css=div.titleHeader-text")); quality.AreEqual("Scanning Your Portable Storage Device... Please wait", quality.GetText("id=messageText")); ken.DeviceInformationFoundPage(true); // comment: Click on the "Continue" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.ProductUpdatesPage(true); // comment: Click on "Latest Map" button quality.Click("css=div.description > span"); quality.WaitForPageToLoad("30000"); //comment: Check the "Latest Map for Kenwood" ken.LatestMapForKenwoodPage(true); //comment: Click "Add to Cart" button without beeing logged-in quality.Click("css=a.button.left > span"); quality.WaitForPageToLoad("30000"); ken.ShoppingCartWithLatestMapToBuy(); // comment: Click the "Continue Shopping" button quality.Click("//form[@id='shoppingCartForm']/div[2]/div[4]/a/span"); quality.WaitForPageToLoad("30000"); ken.ProductUpdatesPage(true); }
//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("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.DeviceSelectionPage(); //comment: Select the same device like the one from the XML quality.Select("id=headUnitRegionFilter", "label=All"); quality.WaitForPageToLoad("30000"); quality.Select("id=headUnitRegionFilter", "label=North America"); quality.WaitForPageToLoad("30000"); quality.Click("link=DNX7180"); quality.WaitForPageToLoad("30000"); ken.ModelIdentificationPage(); //comment: click on "Read Media" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Scan Portable Media", quality.GetTitle()); for (int second = 0; second < 61; second++) { if (second >= 60) { quality.ErrorReport("timeout", CheckType.Warning); } try { if ("Media Scan" == quality.GetText("css=div.titleHeader-text")) { break; } } catch (Exception) { } Thread.Sleep(1000); } quality.AreEqual("Media Scan", quality.GetText("css=div.titleHeader-text")); quality.AreEqual("Scanning Your Portable Storage Device... Please wait", quality.GetText("id=messageText")); ken.DeviceInformationFoundPage(true); // comment: Click on the "Continue" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.ProductUpdatesPage(true); // comment: Click on the "Real-Time Traffic" button quality.Click("//div[@id='productUpdates']/a[2]/div/div"); quality.WaitForPageToLoad("30000"); ken.TrafficSubscriptionPage(); }
//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("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.DeviceSelectionPage(); //comment: Select the same device like the one from the XML quality.Select("id=headUnitRegionFilter", "label=All"); quality.WaitForPageToLoad("30000"); quality.Select("id=headUnitRegionFilter", "label=North America"); quality.WaitForPageToLoad("30000"); quality.Click("link=KNA-G610"); quality.WaitForPageToLoad("30000"); ken.ProductUpdatesPage(true); // comment: Click on the "Lastest Map" button quality.Click("css=div.description > span"); quality.WaitForPageToLoad("30000"); // comment: Validate the Latests Map for Kenwood page //not found in code. Need to revist //ken.LatestMapNotAvailableOnlinePage(quality); }
//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("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.DeviceSelectionPage(); quality.Select("id=headUnitRegionFilter", "label=All"); quality.WaitForPageToLoad("30000"); quality.Select("id=headUnitRegionFilter", "label=Europe"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Select a Model", quality.GetTitle()); //comment: Select the same device like the one from the XML quality.Click("link=DNX5220"); quality.WaitForPageToLoad("30000"); ken.ProductUpdatesPage(true); // comment: Click on "Real-Time Traffic" button quality.Click("//div[@id='productUpdates']/a[2]/div/div/div"); quality.WaitForPageToLoad("30000"); //comment: Check the "Latest Map for Kenwood" ken.TrafficSubscriptionPage(); //comment: Click on the first traffic subscription (North America) quality.Click("css=div.text"); quality.WaitForPageToLoad("30000"); ken.TrafficServicesForkenwoodPage(); //comment: Click "Add to Cart" button without beeing logged-in quality.Click("css=a.button.left > span"); quality.WaitForPageToLoad("30000"); ken.SignInPage(); ken.SignIn(username, password); /* * quality.Type("id=username", username); * quality.Type("id=password", password); * quality.Click("css=a.button"); * quality.WaitForPageToLoad("30000"); */ //comment: Validate the "Add to Cart: Traffic Subscription" page ken.AddToCartTrafficVerification(true); // comment: Click the "Cancel" button from the "Add to Cart: Traffic Subscription" quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.TrafficServicesForkenwoodPage(); ken.Logout(); }
//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("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.DeviceSelectionPage(); //comment: Select the same device like the one from the XML quality.Select("id=headUnitRegionFilter", "label=All"); quality.WaitForPageToLoad("30000"); quality.Select("id=headUnitRegionFilter", "label=North America"); quality.WaitForPageToLoad("30000"); quality.Click("link=KNA-G610"); quality.WaitForPageToLoad("30000"); ken.ProductUpdatesPage(false); // comment: Click on "Software Updates" button quality.Click("css=div.description.padding-top-10 > span"); quality.WaitForPageToLoad("30000"); ken.SoftwareUpdatePage(); // comment: Click on "Back To Updates" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Product Updates for Kenwood KNA-G610", quality.GetTitle()); //comment: Click on "Software Updates" button quality.Click("css=div.description.padding-top-10 > div.header"); quality.WaitForPageToLoad("30000"); ken.SoftwareUpdatePage(); // comment: Click on "Get Latest Navigation Software" button - first cancel the pop up and then click OK selenium.ChooseCancelOnNextConfirmation(); quality.Click("css=div.softwareUpdate > a.button > span"); //quality.AreEqual("You are being redirected to the software center to complete your request", quality.GetConfirmation()); quality.Click("css=div.softwareUpdate > a.button > span"); //quality.AreEqual("You are being redirected to the software center to complete your request", quality.GetConfirmation()); }
//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("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.DeviceSelectionPage(); quality.Select("id=headUnitRegionFilter", "label=All"); quality.WaitForPageToLoad("30000"); quality.Select("id=headUnitRegionFilter", "label=Other"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Select a Model", quality.GetTitle()); //comment: Select the same device like the one from the XML quality.Click("link=DNX7320"); quality.WaitForPageToLoad("30000"); ken.ProductUpdatesPage(false); // comment: Click on "Software Updates" button quality.Click("css=div.description.padding-top-10 > span"); quality.WaitForPageToLoad("30000"); ken.SoftwareUpdatePage(); // comment: Click on "Back To Updates" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Product Updates for Kenwood DNX7320", quality.GetTitle()); //comment: Click on "Software Updates" button quality.Click("css=div.description.padding-top-10 > div.header"); quality.WaitForPageToLoad("30000"); ken.SoftwareUpdatePage(); }
//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("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.DeviceSelectionPage(); quality.Select("id=headUnitRegionFilter", "label=All"); quality.WaitForPageToLoad("30000"); quality.Select("id=headUnitRegionFilter", "label=Other"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Select a Model", quality.GetTitle()); string availableOtherdevices = quality.GetText("css=div.itemSelectionBox"); char[] splits = { '\n', ' ' }; string[] Otherdevices = availableOtherdevices.Trim().Split(splits); List <string> l = new List <string>(); int i = 0; foreach (string s in Otherdevices) { if ((s != " ") && (s != "")) { l.Add(s); Console.WriteLine("i: " + i + " >> " + l[i]); i++; } } //check all the items from the list ignoring the elements which need SD card to be read for (int j = 0; j < i; j++) { Console.WriteLine("click on : " + l[j].ToString()); quality.Click("link=" + l[j] + ""); quality.WaitForPageToLoad("30000"); string title = quality.GetTitle(); Match match1 = Regex.Match(title, @"^(Product Updates for Kenwood.*)", RegexOptions.IgnoreCase); //if the Product Updates page is displayed try to click on the available features if (match1.Success) { //check if the "Latest Map" option is available and then click it if ((quality.IsElementPresent("css=div.productUpdate > div.description > div.header") == true) && (quality.IsTextPresent("Latest Map") == true) && (quality.IsElementPresent("css=div.noLink") != true)) { quality.Click("css=div.productUpdate > div.description > div.header"); quality.WaitForPageToLoad("30000"); quality.IsTrue(Regex.IsMatch(quality.GetText("css=div.titleHeader-text"), "Latest Map for Kenwood .*")); quality.AreEqual("« Back to Updates", quality.GetText("css=a.button > span")); //go back to product updates quality.Click("css=a.button > span"); } //check if the "Software Updates" option is available and then click it if ((quality.IsElementPresent("css=div.description.padding-top-10 > div.header") == true) && (quality.IsTextPresent("Software Updates") == true)) { quality.Click("css=div.description.padding-top-10 > div.header"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Software Update", quality.GetTitle()); quality.AreEqual("Software Update", quality.GetText("css=div.titleHeader-text")); quality.AreEqual("« Back to Updates", quality.GetText("css=a.button > span")); //go back to product updates quality.Click("css=a.button > span"); } //check if the "Real-Time Traffic" option is available and then click it if ((quality.IsElementPresent("//div[@id='productUpdates']/a[2]/div/div/div") == true) && (quality.IsTextPresent("Real-Time Traffic") == true)) { quality.Click("//div[@id='productUpdates']/a[2]/div/div/div"); quality.WaitForPageToLoad("30000"); quality.IsTrue(Regex.IsMatch(quality.GetText("css=div.titleHeader-text"), "Traffic Subscriptions for Your.*")); //click on the first available traffic subscription quality.Click("css=div.text"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Traffic Services for Kenwood", quality.GetTitle()); quality.AreEqual("« Back to Updates", quality.GetText("css=a.button > span")); //go back to product updates quality.Click("css=a.button > span"); } for (int second = 0; second < 61; second++) { if (second >= 60) { quality.ErrorReport("timeout", CheckType.Warning); } try { if (quality.IsElementPresent("link=Select Device")) { break; } } catch (Exception) { } Thread.Sleep(1000); } //go to "Select Model Device" page quality.Click("link=Select Device"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Select a Model", quality.GetTitle()); } //go to the next item else { for (int second = 0; second < 61; second++) { if (second >= 60) { quality.ErrorReport("timeout", CheckType.Warning); } try { if ("Select Device" == quality.GetText("link=Select Device")) { break; } } catch (Exception) { } Thread.Sleep(1000); } //go to "Select Model Device" page quality.Click("link=Select Device"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Select a Model", quality.GetTitle()); continue; } } }
//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("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.DeviceSelectionPage(); // comment: select different device from the one from garmin device xml quality.Click("link=DNX6040EX"); quality.WaitForPageToLoad("30000"); ken.ModelIdentificationPage(); //comment: click on "Read Media" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Scan Portable Media", quality.GetTitle()); if (ken.CheckForTimeOut("Media Scan", "css=div.titleHeader-text", 61)) { failedcheck++; } quality.AreEqual("Media Scan", quality.GetText("css=div.titleHeader-text")); quality.AreEqual("Scanning Your Portable Storage Device... Please wait", quality.GetText("id=messageText")); ken.DeviceInformationFoundPage(false); // comment: Click on "Start Over" button quality.Select("id=device", "Forerunner 910XT"); quality.Click("xpath=(//button[@type='button'])[2]"); //quality.Click("//div[@id='modelIdentificationConfirm']/a[3]/span"); quality.WaitForPageToLoad("30000"); ken.DeviceSelectionPage(); //quality.AreEqual("Select a Model", quality.GetTitle()); //comment: Select the same device like the one from the XML quality.Click("link=DNX6980"); quality.WaitForPageToLoad("30000"); ken.ModelIdentificationPage(); //comment: click on "Read Media" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Scan Portable Media", quality.GetTitle()); if (ken.CheckForTimeOut("Media Scan", "css=div.titleHeader-text", 61)) { failedcheck++; } quality.AreEqual("Media Scan", quality.GetText("css=div.titleHeader-text")); quality.AreEqual("Scanning Your Portable Storage Device... Please wait", quality.GetText("id=messageText")); ken.DeviceInformationFoundPage(true); // comment: Click on the "Continue" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.ProductUpdatesPage(true); // comment: Click on "Software Updates" button quality.Click("//div[@id='productUpdates']/a[2]/div"); quality.WaitForPageToLoad("30000"); ken.SoftwareUpdatePage(); // comment: Click on "Back To Updates" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Product Updates for Kenwood DNX6980", quality.GetTitle()); //comment: Click on "Software Updates" button quality.Click("css=div.description.padding-top-10 > div.header"); quality.WaitForPageToLoad("30000"); ken.SoftwareUpdatePage(); // comment: CLick on "Get Latest Navigation Software" button - first cancel the pop up and then click OK selenium.ChooseCancelOnNextConfirmation(); quality.Click("css=div.softwareUpdate > a.button > span"); //quality.AreEqual("You are being redirected to the software center to complete your request", quality.GetConfirmation()); quality.Click("css=div.softwareUpdate > a.button > span"); //quality.AreEqual("You are being redirected to the software center to complete your request", quality.GetConfirmation()); selenium.WaitForPopUp("", "30000"); // comment: Validate the "Firmware" page ken.ValidateFirmwarePage(); //// comment: Go back to Updates //quality.Click("css=a.button > span"); //quality.WaitForPageToLoad("30000"); //quality.AreEqual("Product Updates for Kenwood DNX6980", quality.GetTitle()); //// comment: Click on the "Real-Tme Traffic" button //quality.Click("css=a.updatesLink > div.productUpdate > div.description > div.header"); //quality.WaitForPageToLoad("30000"); //quality.AreEqual("Traffic Subscriptions", quality.GetTitle()); //quality.AreEqual("Traffic Subscriptions for Your Device", quality.GetText("css=div.titleHeader-text")); //quality.AreEqual("", quality.GetText("css=img.margin-rb10.left")); //quality.AreEqual("DNX6980", quality.GetText("css=div.header")); //quality.AreEqual("North America", quality.GetText("css=div.region")); //quality.AreEqual("Premium Traffic Subscription by Navteq – North America", quality.GetText("css=div.text")); //quality.AreEqual("", quality.GetText("css=img.margin-10.left")); //// comment: Click on the first traffic subscription (North America) //quality.Click("css=div.text"); //quality.WaitForPageToLoad("30000"); //// comment: Validate the Traffic Services for Kenwood page //quality.AreEqual("Traffic Services for Kenwood", quality.GetTitle()); //quality.AreEqual("Traffic Services for Kenwood", quality.GetText("css=div.titleHeader-text")); //quality.AreEqual("« Back to Updates", quality.GetText("css=a.button > span")); //quality.AreEqual("Download", quality.GetText("css=div.format.left")); //quality.AreEqual("Add to Cart", quality.GetText("css=a.button.left > span")); //quality.AreEqual("$49.99", quality.GetText("css=div.price")); //quality.AreEqual("Premium Traffic Subscription by Navteq – North America", quality.GetText("css=div.header")); //quality.AreEqual("", quality.GetText("css=img.left.margin-rb10")); //quality.AreEqual("Receive Real-time Traffic for North America", quality.GetText("css=h3")); //quality.AreEqual("Avoid traffic tie-ups in North America with a lifetime traffic subscription. Garmin, in partnership with NAVTEQ, delivers real-time traffic news and updates for all major routes directly to your compatible Garmin device.", quality.GetText("css=p")); //quality.AreEqual("Route Around Tie-ups. Avoid Delays", quality.GetText("//div[@id='bd']/div[4]/div[2]/h3[2]")); //quality.AreEqual("With a traffic subscription for North America and a traffic receiver, you’ll get the latest information on construction, accidents, lane closings and other obstructions that lie ahead on your route. Using your compatible Garmin, you can conveniently route around traffic to avoid delays — saving you drive time, gas and money!", quality.GetText("//div[@id='bd']/div[4]/div[2]/p[2]")); //quality.AreEqual("Requirements", quality.GetText("css=div.product > h3")); //quality.AreEqual("Terms and Conditions", quality.GetText("css=strong")); //quality.AreEqual("Lifetime traffic extends for the useful life of your Garmin traffic receiver (as long as you own a compatible Garmin GPS) or as long as Garmin receives traffic data from its traffic supplier, whichever is shorter. Traffic content not available for all areas.", quality.GetText("//div[@id='bd']/div[4]/p[2]")); //quality.AreEqual("About Coverage", quality.GetText("//div[@id='bd']/div[4]/h3[2]")); //quality.AreEqual("This lifetime subscription by NAVTEQ delivers real-time traffic news and updates for 98 metropolitan markets in North America, including Canada, directly to your compatible Garmin device.", quality.GetText("//div[@id='bd']/div[4]/p[3]")); //quality.AreEqual("View NAVTEQ's coverage map.", quality.GetText("//div[@id='bd']/div[4]/p[4]")); //quality.AreEqual("", quality.GetText("css=img[alt=\"Navteq Traffic\"]")); //quality.AreEqual("Add to Cart: Traffic Verification", quality.GetTitle()); //// comment: Click "Add to Cart" button without beeing logged-in //quality.Click("css=a.button.left > span"); //quality.WaitForPageToLoad("30000"); //quality.AreEqual("Sign In", quality.GetTitle()); //quality.Type("id=username", "testuser2012"); //quality.Type("id=password", "password"); //quality.Click("css=a.button"); //quality.WaitForPageToLoad("30000"); //// comment: Validate the "Add to Cart: Traffic Subscription" page //quality.AreEqual("Add to Cart: Traffic Subscription", quality.GetText("css=div.titleHeader-text")); //quality.AreEqual("To add this item to your cart, please complete the following", quality.GetText("id=verifyTrafficInstructions")); //quality.AreEqual("Unit ID", quality.GetText("css=div.inputIndicator-text")); //quality.AreEqual("", quality.GetText("id=unitId")); //quality.AreEqual("Your Unit ID is a 10-digit number located on your device under Settings > System > About.", quality.GetText("css=div.instructions")); //quality.AreEqual("", quality.GetText("id=trafficReceiverId")); //quality.AreEqual("Traffic Receiver ID", quality.GetText("//form[@id='verifyTrafficForm']/table/tbody/tr[4]/td/div/div[2]/div")); //quality.AreEqual("Your Traffic Receiver ID is a 10-digit number located on your device under Settings > Traffic > Subscriptions > Add.", quality.GetText("//form[@id='verifyTrafficForm']/table/tbody/tr[6]/td/div")); //quality.AreEqual("Cancel", quality.GetText("css=a.button > span")); //quality.AreEqual("Continue", quality.GetText("//form[@id='verifyTrafficForm']/table/tbody/tr[7]/td/a[2]/span")); //// comment: Validate the "Add to Cart: Traffic Subscription" - do not enter any value and press the Continue btn //quality.Click("//form[@id='verifyTrafficForm']/table/tbody/tr[7]/td/a[2]/span"); //quality.WaitForPageToLoad("30000"); //quality.AreEqual("Add to Cart: Traffic Verification", quality.GetTitle()); //quality.AreEqual("Traffic Receiver ID is required", quality.GetText("css=ul.error > li")); //quality.AreEqual("Unit ID is required", quality.GetText("//div[@id='bd']/ul/li[2]")); //// comment: special characters for Unit ID //quality.Type("id=unitId", "!@#$%@@%$$#@!$%#@!!$%$"); //quality.Click("//form[@id='verifyTrafficForm']/table/tbody/tr[7]/td/a[2]/span"); //quality.WaitForPageToLoad("30000"); //quality.AreEqual("Add to Cart: Traffic Verification", quality.GetTitle()); //quality.AreEqual("Traffic Receiver ID is required", quality.GetText("css=ul.error > li")); //quality.AreEqual("Please enter a valid Unit ID", quality.GetText("//div[@id='bd']/ul/li[2]")); //// comment: Type special characters for traffic receiver id //quality.Type("id=trafficReceiverId", "!@#$%@@%$$#@!$%#@!!$%$"); //quality.Click("//form[@id='verifyTrafficForm']/table/tbody/tr[7]/td/a[2]/span"); //quality.WaitForPageToLoad("30000"); //quality.AreEqual("Add to Cart: Traffic Verification", quality.GetTitle()); //quality.AreEqual("Please enter a valid Traffic Receiver ID", quality.GetText("css=ul.error > li")); //quality.AreEqual("Please enter a valid Unit ID", quality.GetText("//div[@id='bd']/ul/li[2]")); //// comment: Type string characters for Unit ID //quality.Type("id=unitId", "qweqrrqwerewqrwerweqrqwrwqrwrwq"); //quality.Type("id=trafficReceiverId", "qweqrrqwerewqrwerweqrqwrwqrwrwq"); //quality.Click("//form[@id='verifyTrafficForm']/table/tbody/tr[7]/td/a[2]/span"); //quality.WaitForPageToLoad("30000"); //quality.AreEqual("Add to Cart: Traffic Verification", quality.GetTitle()); //quality.AreEqual("Please enter a valid Traffic Receiver ID", quality.GetText("css=ul.error > li")); //quality.AreEqual("Please enter a valid Unit ID", quality.GetText("//div[@id='bd']/ul/li[2]")); //// comment: Type invalid values for Unit ID and Traffic Receiver ID //quality.Type("id=unitId", "-1"); //quality.Type("id=trafficReceiverId", "-1"); //quality.Click("//form[@id='verifyTrafficForm']/table/tbody/tr[7]/td/a[2]/span"); //quality.WaitForPageToLoad("30000"); //quality.AreEqual("Add to Cart: Traffic Verification", quality.GetTitle()); //quality.AreEqual("The Unit ID you entered is not valid", quality.GetText("css=ul.error > li")); //quality.AreEqual("The Traffic Receiver ID you entered is not valid", quality.GetText("//div[@id='bd']/ul/li[2]")); //// comment: Type a valid a Traffic Receiver ID and press "Continue" without a Unit ID //quality.Type("id=unitId", ""); //quality.Type("id=trafficReceiverId", "3422110080"); //quality.Click("//form[@id='verifyTrafficForm']/table/tbody/tr[7]/td/a[2]/span"); //quality.WaitForPageToLoad("30000"); //quality.AreEqual("Add to Cart: Traffic Verification", quality.GetTitle()); //quality.AreEqual("Unit ID is required", quality.GetText("css=ul.error > li")); //// comment: Type a valid Unit ID and leave empty the Traffic Receiver ID //quality.Type("id=unitId", "3422110080"); //quality.Type("id=trafficReceiverId", ""); //quality.Click("//form[@id='verifyTrafficForm']/table/tbody/tr[7]/td/a[2]/span"); //quality.WaitForPageToLoad("30000"); //quality.AreEqual("Add to Cart: Traffic Verification", quality.GetTitle()); //quality.AreEqual("Traffic Receiver ID is required", quality.GetText("css=ul.error > li")); //// comment: Type a Valid Unit ID and A valid Traffic Receiver ID //quality.Type("id=unitId", ""); //quality.Type("id=trafficReceiverId", ""); //quality.Type("id=unitId", "3422110080"); //quality.Type("id=trafficReceiverId", "3422110080"); //quality.Click("//form[@id='verifyTrafficForm']/table/tbody/tr[7]/td/a[2]/span"); //quality.WaitForPageToLoad("30000"); //quality.AreEqual("Shopping Cart", quality.GetTitle()); //quality.AreEqual("Shopping Cart", quality.GetText("css=div.titleHeader-text")); //quality.AreEqual("", quality.GetText("css=div.tableHeader-left")); //quality.AreEqual("Unit Price", quality.GetText("css=#price-hd > div.text")); //quality.AreEqual("Qty", quality.GetText("css=#quantity-hd > div.text")); //quality.AreEqual("Total", quality.GetText("css=#total-hd > div.text")); //quality.AreEqual("", quality.GetText("css=img.margin-r20")); //quality.AreEqual("Premium Traffic Subscription by Navteq – North America", quality.GetText("css=span.name")); //quality.AreEqual("$49.99", quality.GetText("id=price")); //quality.AreEqual("$49.99", quality.GetText("id=total")); //quality.AreEqual("Subtotal", quality.GetText("css=div.text.right")); //quality.AreEqual("$49.99", quality.GetText("css=strong")); //quality.AreEqual("remove", quality.GetText("link=remove")); //quality.AreEqual("Update", quality.GetText("css=a.button > span")); //quality.AreEqual("Continue Shopping", quality.GetText("//form[@id='shoppingCartForm']/div[2]/div[4]/a/span")); //quality.AreEqual("Checkout", quality.GetText("//form[@id='shoppingCartForm']/div[2]/div[4]/a[2]/span")); //// comment: Click "Update" button even if the QTY is disabled to be changed //quality.Click("css=a.button > span"); //quality.WaitForPageToLoad("30000"); //quality.AreEqual("Shopping Cart", quality.GetTitle()); //// comment: Click the "Checkout" button //quality.Click("//form[@id='shoppingCartForm']/div[2]/div[4]/a[2]/span"); //quality.WaitForPageToLoad("30000"); //quality.AreEqual("Checkout", quality.GetTitle()); //quality.AreEqual("Checkout", quality.GetText("css=div.titleHeader-text")); //quality.AreEqual("Shipping Address", quality.GetText("css=h2")); //quality.IsTrue(Regex.IsMatch(quality.GetText("css=span.required-field-msg"), "^[\\s\\S]* Required Field$")); //quality.AreEqual("Why We Need This", quality.GetText("link=Why We Need This")); //quality.IsTrue(Regex.IsMatch(quality.GetText("css=label"), "^First Name[\\s\\S]*$")); //quality.IsTrue(Regex.IsMatch(quality.GetText("css=#shippingAddress-last-name > div.formLabel > label > abbr.req"), "^[\\s\\S]*$")); //quality.IsTrue(Regex.IsMatch(quality.GetText("css=#shippingAddress-country-region > div.formLabel > label > abbr.req"), "^[\\s\\S]*$")); //quality.IsTrue(Regex.IsMatch(quality.GetText("css=#shippingAddress-address-line-1 > div.formLabel > label > abbr.req"), "^[\\s\\S]*$")); //quality.AreEqual("Address Line 2", quality.GetText("css=#shippingAddress-address-line-2 > div.formLabel > label")); //quality.IsTrue(Regex.IsMatch(quality.GetText("css=#shippingAddress-city > div.formLabel > label > abbr.req"), "^[\\s\\S]*$")); //quality.IsTrue(Regex.IsMatch(quality.GetText("css=#shippingAddress-state-province > div.formLabel > label > abbr.req"), "^[\\s\\S]*$")); //quality.IsTrue(Regex.IsMatch(quality.GetText("css=#shippingAddress-zip-postal-code > div.formLabel > label > abbr.req"), "^[\\s\\S]*$")); //quality.IsTrue(Regex.IsMatch(quality.GetText("css=#shippingAddress-phone > div.formLabel > label > abbr.req"), "^[\\s\\S]*$")); //quality.AreEqual("Select a Country/Region Afghanistan Aland Islands Albania American Samoa Andorra Antarctica Antigua and Barbuda Argentina Armenia Aruba Australia Austria Azerbaijan Bahrain Bangladesh Barbados Belarus Belgium Belize Bermuda Bhutan Bolivia Bosnia and Herzegovina Bouvet Island Brazil British Indian Ocean Territory Brunei Darussalam Bulgaria Cambodia Canada Chile Christmas Island Cocos (Keeling) Islands Colombia Congo Congo, The Democratic Republic of the Cook Islands Corsica Costa Rica Croatia Cyprus Czech Republic Denmark Djibouti Ecuador Egypt El Salvador Equatorial Guinea Estonia Ethiopia Falkland Islands (Malvinas) Faroe Islands Fiji Finland France France Guyana French Polynesia Gabon Georgia Germany Ghana Gibraltar Greece Greenland Guadeloupe Guam Guatemala Guernsey Guinea Guyana Heard Island and McDonald Islands Honduras Hong Kong Hungary Iceland India Indonesia Iraq Ireland Isle of Man Israel Italy Jamaica Japan Jersey Jordan Kazakhstan Kenya Kiribati Korea, Republic of Kuwait Kyrgyzstan Latvia Lebanon Lesotho Liberia Liechtenstein Lithuania Luxembourg Macedonia, The Former Yugoslav Republic of Madagascar Malawi Malaysia Maldives Mali Malta Marshall Islands Martinique Mauritius Mayotte Mexico Micronesia, Federated States of Moldova, Republic of Monaco Mongolia Montenegro Montserrat Morocco Mozambique Namibia Nauru Netherlands Netherlands Antilles New Caledonia New Zealand Nicaragua Niger Nigeria Niue Norfolk Island Northern Mariana Islands Norway Oman Pakistan Palau Palestinian Territory,Occupied Panama Papua New Guinea Peru Philippines Pitcairn Poland Portugal Puerto Rico Qatar Reunion Romania Russian Federation Rwanda Saint Helena Saint Kitts and Nevis Saint Lucia Samoa San Marino Sao Tome and Principe Saudi Arabia Senegal Serbia Serbia and Montenegro Seychelles Sierra Leone Singapore Slovakia Slovakia Slovenia Solomon Islands Somalia South Africa South Georgia and the South Sandwich Islands Spain Sri Lanka St Pierre + Miquelon Sudan Suriname Svalbard and Jan Mayen Swaziland Sweden Switzerland Taiwan Tajikistan Tanzania, United Republic of Thailand Togo Tokelau Tonga Tunisia Turkey Turkmenistan Tuvalu Uganda Ukraine United Arab Emirates United Kingdom United States United States Minor Outlying Islands Uruguay Uzbekistan Vanuatu Vatican City Venezuela Virgin Islands, U.S. Wallis + Futuna Island Yemen Zambia Zimbabwe", quality.GetText("id=shippingAddresscountry")); //quality.AreEqual("Select a State/Province --- AA AE AP Alabama Alaska Arizona Arkansas California Colorado Connecticut Delaware District of Columbia Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee Texas Utah Vermont Virginia Washington West Virginia Wisconsin Wyoming", quality.GetText("id=shippingAddressstate")); //quality.AreEqual("Continue", quality.GetText("id=continueBtn")); //quality.AreEqual("Back to Cart", quality.GetText("id=cancelBtn")); //quality.Type("id=shippingAddressfirstName", ""); //quality.Type("id=shippingAddressfirstName", "FirstName Tester"); //quality.Type("id=shippingAddresslastName", ""); //quality.Type("id=shippingAddresslastName", "LastName Tester"); //quality.Select("id=shippingAddresscountry", "label=Taiwan"); //quality.Select("id=shippingAddresscountry", "label=United States"); //quality.Type("id=shippingAddressaddress1", ""); //quality.Type("id=shippingAddressaddress1", "AddressLine1 tester's address"); //quality.Type("id=shippingAddressaddress2", ""); //quality.Type("id=shippingAddressaddress2", "AddressLine2 tester's address"); //quality.Type("id=shippingAddresscity", ""); //quality.Type("id=shippingAddresscity", "HILO"); //quality.Select("id=shippingAddressstate", "label=Arizona"); //quality.Select("id=shippingAddressstate", "label=Hawaii"); //quality.Type("id=shippingAddresszipPostal", ""); //quality.Type("id=shippingAddresszipPostal", "96720"); //quality.Type("id=shippingAddressphone", ""); //quality.Type("id=shippingAddressphone", "000-555-1212"); //// comment: Click on "Back to Cart" button //quality.Click("id=cancelBtn"); //quality.WaitForPageToLoad("30000"); //quality.AreEqual("Shopping Cart", quality.GetTitle()); //quality.AreEqual("Shopping Cart", quality.GetText("css=div.titleHeader-text")); //quality.AreEqual("", quality.GetText("css=div.tableHeader-left")); //quality.AreEqual("Unit Price", quality.GetText("css=#price-hd > div.text")); //quality.AreEqual("Qty", quality.GetText("css=#quantity-hd > div.text")); //quality.AreEqual("Total", quality.GetText("css=#total-hd > div.text")); //quality.AreEqual("", quality.GetText("css=img.margin-r20")); //quality.AreEqual("Premium Traffic Subscription by Navteq – North America", quality.GetText("css=span.name")); //quality.AreEqual("$49.99", quality.GetText("id=price")); //quality.AreEqual("$49.99", quality.GetText("id=total")); //quality.AreEqual("Subtotal", quality.GetText("css=div.text.right")); //quality.AreEqual("$49.99", quality.GetText("css=strong")); //quality.AreEqual("remove", quality.GetText("link=remove")); //quality.AreEqual("Update", quality.GetText("css=a.button > span")); //quality.AreEqual("Continue Shopping", quality.GetText("//form[@id='shoppingCartForm']/div[2]/div[4]/a/span")); //quality.AreEqual("Checkout", quality.GetText("//form[@id='shoppingCartForm']/div[2]/div[4]/a[2]/span")); //// comment: Click the "Checkout" button //quality.Click("//form[@id='shoppingCartForm']/div[2]/div[4]/a[2]/span"); //quality.WaitForPageToLoad("30000"); //quality.AreEqual("Checkout", quality.GetTitle()); //quality.Click("id=continueBtn"); //// comment: Check the "Shipping Address" section }
//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("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.DeviceSelectionPage(); //comment: Select the same device like the one from the XML quality.Select("id=headUnitRegionFilter", "label=All"); quality.WaitForPageToLoad("30000"); quality.Select("id=headUnitRegionFilter", "label=North America"); quality.WaitForPageToLoad("30000"); quality.Click("link=DNX7180"); quality.WaitForPageToLoad("30000"); ken.ModelIdentificationPage(); //comment: click on "Read Media" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Scan Portable Media", quality.GetTitle()); for (int second = 0; second < 61; second++) { if (second >= 60) { quality.ErrorReport("timeout", CheckType.Warning); } try { if ("Media Scan" == quality.GetText("css=div.titleHeader-text")) { break; } } catch (Exception) { } Thread.Sleep(1000); } quality.AreEqual("Media Scan", quality.GetText("css=div.titleHeader-text")); quality.AreEqual("Scanning Your Portable Storage Device... Please wait", quality.GetText("id=messageText")); ken.DeviceInformationFoundPage(true); // comment: Click on the "Continue" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.ProductUpdatesPage(true); // comment: Click on "Latest Map" button quality.Click("css=div.description > span"); quality.WaitForPageToLoad("30000"); //comment: Check the "Latest Map for Kenwood" ken.LatestMapForKenwoodPage(true); //comment: Click "Add to Cart" button without beeing logged-in quality.Click("css=a.button.left > span"); quality.WaitForPageToLoad("30000"); ken.ShoppingCartWithLatestMapToBuy(); // comment: Click "Update" button even if the QTY is disabled to be changed if (ken.IsQuantityEditable() == false) { failedcheck++; } else { passedcheck++; } quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.ShoppingCartWithLatestMapToBuy(); }
//this is the test code generated by selenium //****Paste test script here***** public override void RunTest() { selenium.Open(base.baseURL); Update_XML.WriteXML("DNX9980_XML"); //quality.SetSpeed("1300"); quality.AreEqual("Garmin Product Updates for Kenwood", quality.GetTitle()); quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.DeviceSelectionPage(); //comment: Select the same device like the one from the XML quality.Select("id=headUnitRegionFilter", "label=All"); quality.WaitForPageToLoad("30000"); quality.Select("id=headUnitRegionFilter", "label=North America"); quality.WaitForPageToLoad("30000"); quality.Click("link=DNX9980HD"); quality.WaitForPageToLoad("30000"); ken.ModelIdentificationPage(); //comment: click on "Read Media" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Scan Portable Media", quality.GetTitle()); if (ken.CheckForTimeOut("Media Scan", "css=div.titleHeader-text", 61)) { failedcheck++; } quality.AreEqual("Media Scan", quality.GetText("css=div.titleHeader-text")); quality.AreEqual("Scanning Your Portable Storage Device... Please wait", quality.GetText("id=messageText")); ken.DeviceInformationFoundPage(true); // comment: Click on the "Continue" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.ProductUpdatesPage(true); // comment: Click on "Lates map" button quality.Click("css=div.description > span"); quality.WaitForPageToLoad("30000"); ken.LatestMapForKenwoodPage(true); //comment: Click on "Add to Cart" button quality.Click("css=a.button.left > span"); quality.WaitForPageToLoad("30000"); ken.UpdateRequieredPage(); //comment: Click on the "Scan Portable Media" quality.Click("link=Scan Portable Media"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Model Identification", quality.GetTitle()); quality.AreEqual("The model you selected requires identification using portable media", quality.GetText("css=div.titleHeader-text")); // comment: Click on the "Continue" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Scan Portable Media", quality.GetTitle()); if (ken.CheckForTimeOut("Media Scan", "css=div.titleHeader-text", 61)) { failedcheck++; } quality.AreEqual("Media Scan", quality.GetText("css=div.titleHeader-text")); quality.AreEqual("Scanning Your Portable Storage Device... Please wait", quality.GetText("id=messageText")); for (int second = 0; second < 61; second++) { if (second >= 60) { quality.ErrorReport("timeout", CheckType.Warning); } try { if ("Device Information Found" == quality.GetText("css=div.titleHeader-text")) { break; } } catch (Exception) { } Thread.Sleep(1000); } quality.AreEqual("Device Found", quality.GetTitle()); quality.AreEqual("Device Information Found", quality.GetText("css=div.titleHeader-text")); // comment: Click on the "Continue" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); quality.IsTrue(Regex.IsMatch(quality.GetTitle(), "Product Updates for Kenwood .*")); quality.IsTrue(Regex.IsMatch(quality.GetText("css=div.titleHeader-text"), "Product Updates for Kenwood .*")); // comment: Click on "Lates map" button quality.Click("css=div.description > span"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Download: City Navigator® North America NT 2012 Map Update for Kenwood", quality.GetTitle()); quality.IsTrue(Regex.IsMatch(quality.GetText("css=div.titleHeader-text"), "(DNX|KNA-)(\\d{4})(.*)")); //comment: Click on "Add to Cart" button quality.Click("css=a.button.left > span"); quality.WaitForPageToLoad("30000"); ken.UpdateRequieredPage(); //comment: CLick on "Software Updates" link quality.Click("link=Software Updates"); Thread.Sleep(2000); quality.SelectWindow("Software Update"); quality.AreEqual("Software Update", quality.GetText("css=div.titleHeader-text")); quality.AreEqual("Kenwood Receiver Software for DNX9980HD", quality.GetText("css=p.header")); quality.AreEqual("« Back to Updates", quality.GetText("css=a.button > span")); quality.AreEqual("Get Latest Navigation Software", quality.GetText("css=div.softwareUpdate > a.button > span")); }
//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("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.DeviceSelectionPage(); //comment: Select the same device like the one from the XML quality.Select("id=headUnitRegionFilter", "label=All"); quality.WaitForPageToLoad("30000"); quality.Select("id=headUnitRegionFilter", "label=North America"); quality.WaitForPageToLoad("30000"); quality.Click("link=DNX7180"); quality.WaitForPageToLoad("30000"); ken.ModelIdentificationPage(); //comment: click on "Read Media" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Scan Portable Media", quality.GetTitle()); if (ken.CheckForTimeOut("Media Scan", "css=div.titleHeader-text", 61)) { failedcheck++; } quality.AreEqual("Media Scan", quality.GetText("css=div.titleHeader-text")); quality.AreEqual("Scanning Your Portable Storage Device... Please wait", quality.GetText("id=messageText")); ken.DeviceInformationFoundPage(true); // comment: Click on the "Continue" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.ProductUpdatesPage(true); // comment: Click on "Real-Time Traffic" button quality.Click("//div[@id='productUpdates']/a[2]/div/div/div"); quality.WaitForPageToLoad("30000"); //comment: Check the "Traffic subscription for Kenwood" ken.TrafficSubscriptionPage(); //comment: Click on the first traffic subscription (North America) quality.Click("css=div.text"); quality.WaitForPageToLoad("30000"); ken.TrafficServicesForkenwoodPage(); //comment: Click "Add to Cart" button without beeing logged-in quality.Click("css=a.button.left > span"); quality.WaitForPageToLoad("30000"); ken.SignInPage(); quality.Type("id=username", username); quality.Type("id=password", password); quality.Click("css=a.button"); quality.WaitForPageToLoad("30000"); //comment: Check the "Add to Cart: Traffic Pop Up for the already registered device" page ken.AddToCartTraffic_PopUp_AlreadyRegistered(); //comment: CLick on the "Continue" button from the popup quality.Click("//button[@type='button']"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Product Updates for Kenwood DNX7180", quality.GetTitle()); ken.ProductUpdatesPage(true); ken.Logout(); }
//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("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.DeviceSelectionPage(); quality.Select("id=headUnitRegionFilter", "label=All"); quality.WaitForPageToLoad("30000"); quality.Select("id=headUnitRegionFilter", "label=Europe"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Select a Model", quality.GetTitle()); //comment: Select a device quality.Click("link=DNX7220"); quality.WaitForPageToLoad("30000"); ken.ProductUpdatesPage(true); // comment: Click on "Real-Time Traffic" button quality.Click("//div[@id='productUpdates']/a[2]/div/div/div"); quality.WaitForPageToLoad("30000"); //comment: Check the "Latest Map for Kenwood" ken.TrafficSubscriptionPage(); //comment: Click on the first traffic subscription (North America) quality.Click("css=div.text"); quality.WaitForPageToLoad("30000"); ken.TrafficServicesForkenwoodPage(); //comment: Click "Add to Cart" button without beeing logged-in quality.Click("css=a.button.left > span"); quality.WaitForPageToLoad("30000"); ken.SignInPage(); quality.Type("id=username", username); quality.Type("id=password", password); quality.Click("css=a.button"); quality.WaitForPageToLoad("30000"); //comment: Validate the "Add to Cart: Traffic Subscription" page ken.AddToCartTrafficVerification(true); // comment: Type a Valid Unit ID quality.Type("id=unitId", ""); quality.Type("id=unitId", "3422110080"); quality.Click("//form[@id='verifyTrafficForm']/table/tbody/tr[5]/td/a[2]/span"); quality.WaitForPageToLoad("30000"); ken.ShoppingCartWithTrafficSubscriptionToBuy(true); // comment: Click the "Continue Shopping" button quality.Click("//form[@id='shoppingCartForm']/div[2]/div[4]/a/span"); quality.WaitForPageToLoad("30000"); ken.ProductUpdatesPage(true); // comment: Click on "Real-Time Traffic" button quality.Click("//div[@id='productUpdates']/a[2]/div/div/div"); quality.WaitForPageToLoad("30000"); //comment: Check the "Real traffic Subscription" ken.TrafficSubscriptionPage(); //comment: Click on the first traffic subscription quality.Click("css=div.text"); quality.WaitForPageToLoad("30000"); ken.TrafficServicesForkenwoodPage(); //comment: Click "Add to Cart" button without beeing logged-in quality.Click("css=a.button.left > span"); quality.WaitForPageToLoad("30000"); //comment: Validate the "Add to Cart: Traffic Subscription" page ken.AddToCartTrafficVerification(true); // comment: Type a Valid Unit ID quality.Type("id=unitId", ""); quality.Type("id=unitId", "3422110080"); quality.Click("//form[@id='verifyTrafficForm']/table/tbody/tr[5]/td/a[2]/span"); quality.WaitForPageToLoad("30000"); ken.ShoppingCartWithTrafficSubscriptionToBuy(false); ken.Logout(); }
//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("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.DeviceSelectionPage(); //comment: Select the same device like the one from the XML quality.Select("id=headUnitRegionFilter", "label=All"); quality.WaitForPageToLoad("30000"); quality.Select("id=headUnitRegionFilter", "label=North America"); quality.WaitForPageToLoad("30000"); quality.Click("link=DNX7180"); quality.WaitForPageToLoad("30000"); ken.ModelIdentificationPage(); //comment: click on "Read Media" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Scan Portable Media", quality.GetTitle()); for (int second = 0; second < 61; second++) { if (second >= 60) { quality.ErrorReport("timeout", CheckType.Warning); } try { if ("Media Scan" == quality.GetText("css=div.titleHeader-text")) { break; } } catch (Exception) { } Thread.Sleep(1000); } quality.AreEqual("Media Scan", quality.GetText("css=div.titleHeader-text")); quality.AreEqual("Scanning Your Portable Storage Device... Please wait", quality.GetText("id=messageText")); ken.DeviceInformationFoundPage(true); // comment: Click on the "Continue" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.ProductUpdatesPage(true); // comment: Click on "Software Updates" button quality.Click("css=div.description.padding-top-10 > span"); quality.WaitForPageToLoad("30000"); ken.SoftwareUpdatePage(); // comment: Click on "Back To Updates" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Product Updates for Kenwood DNX7180", quality.GetTitle()); //comment: Click on "Software Updates" button quality.Click("css=div.description.padding-top-10 > div.header"); quality.WaitForPageToLoad("30000"); ken.SoftwareUpdatePage(); // comment: Click on "Get Latest Navigation Software" button - first cancel the pop up and then click OK selenium.ChooseCancelOnNextConfirmation(); quality.Click("css=div.softwareUpdate > a.button > span"); quality.AreEqual("You are being redirected to the software center to complete your request", selenium.GetConfirmation()); quality.Click("css=div.softwareUpdate > a.button > span"); quality.AreEqual("You are being redirected to the software center to complete your request", selenium.GetConfirmation()); selenium.WaitForPopUp("", "30000"); // comment: Validate the "Firmware" page ken.ValidateFirmwarePage(); }
//this is the test code generated by selenium //****Paste test script here***** public override void RunTest() { selenium.Open(base.baseURL); Update_XML.WriteXML("DNX7180_XML"); //TheKenwood_ModelTest: DNX4210DAB iD: 1011105504 Update_XML.XMLEdit("Id", "1011105504"); selenium.SetSpeed("1300"); quality.AreEqual("Garmin Product Updates for Kenwood", quality.GetTitle()); quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.DeviceSelectionPage(); quality.Select("id=headUnitRegionFilter", "label=All"); quality.WaitForPageToLoad("30000"); quality.Select("id=headUnitRegionFilter", "label=Europe"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Select a Model", quality.GetTitle()); //comment: Select the same device like the one from the XML quality.Click("link=DNX4210DAB"); quality.WaitForPageToLoad("30000"); ken.ModelIdentificationPage(); //comment: click on "Read Media" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Scan Portable Media", quality.GetTitle()); if (ken.CheckForTimeOut("Media Scan", "css=div.titleHeader-text", 61)) { failedcheck++; } quality.AreEqual("Media Scan", quality.GetText("css=div.titleHeader-text")); quality.AreEqual("Scanning Your Portable Storage Device... Please wait", quality.GetText("id=messageText")); ken.DeviceInformationFoundPage(true); // comment: Click on the "Continue" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.ProductUpdatesPage_NoUpdates(); // comment: Click on "Real-Time Traffic" button quality.Click("css=a.updatesLink > div.productUpdate > div.description > div.header"); quality.WaitForPageToLoad("30000"); //comment: Check the "Traffic subscription for Kenwood" ken.TrafficSubscriptionPage(); //comment: Click on the first traffic subscription (North America) quality.Click("css=div.text"); quality.WaitForPageToLoad("30000"); ken.TrafficServicesForkenwoodPage(); //comment: Click "Add to Cart" button without beeing logged-in quality.Click("css=a.button.left > span"); quality.WaitForPageToLoad("30000"); ken.SignInPage(); quality.Type("id=username", username); quality.Type("id=password", password); quality.Click("css=a.button"); quality.WaitForPageToLoad("30000"); //check if the only the traffic receiver text box is display for this kind of device ken.TrafficReceiverOnlyPage(); //comment: do not enter any value and press the Continue btn quality.Click("//form[@id='verifyTrafficForm']/table/tbody/tr[5]/td/a[2]/span"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Add to Cart: Traffic Verification", quality.GetTitle()); quality.AreEqual("Traffic Receiver ID is required", quality.GetText("css=ul.error > li")); //comment: special characters for traffic receiver ID quality.Type("id=trafficReceiverId", "!@#$%@@%$$#@!$%#@!!$%$"); quality.Click("//form[@id='verifyTrafficForm']/table/tbody/tr[5]/td/a[2]/span"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Add to Cart: Traffic Verification", quality.GetTitle()); quality.AreEqual("Please enter a valid Traffic Receiver ID", quality.GetText("css=ul.error > li")); //comment: Type string characters for traffic receiver ID quality.Type("id=trafficReceiverId", "qweqrrqwerewqrwerweqrqwrwqrwrwq"); quality.Click("//form[@id='verifyTrafficForm']/table/tbody/tr[5]/td/a[2]/span"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Add to Cart: Traffic Verification", quality.GetTitle()); quality.AreEqual("Please enter a valid Traffic Receiver ID", quality.GetText("css=ul.error > li")); //comment: Type invalid values for Traffic Receiver ID quality.Type("id=trafficReceiverId", "-1"); quality.Click("//form[@id='verifyTrafficForm']/table/tbody/tr[5]/td/a[2]/span"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Add to Cart: Traffic Verification", quality.GetTitle()); quality.AreEqual("The Traffic Receiver ID you entered is not valid", quality.GetText("css=ul.error > li")); //comment: Type invalid values for Traffic Receiver ID quality.Type("id=trafficReceiverId", "-1"); quality.Click("//form[@id='verifyTrafficForm']/table/tbody/tr[5]/td/a[2]/span"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Add to Cart: Traffic Verification", quality.GetTitle()); quality.AreEqual("The Traffic Receiver ID you entered is not valid", quality.GetText("css=ul.error > li")); //comment: Type a valid traffic receiver id which is registered to another user account quality.Type("id=trafficReceiverId", unitIdRegistered); quality.Click("//form[@id='verifyTrafficForm']/table/tbody/tr[5]/td/a[2]/span"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Add to Cart: Traffic Verification", quality.GetTitle()); quality.AreEqual("This traffic receiver is currently registered to another user account", quality.GetText("css=ul.error > li")); //comment: Type a valid valid traffic receiver id quality.Type("id=trafficReceiverId", unitIdNotRegistered); quality.Click("//form[@id='verifyTrafficForm']/table/tbody/tr[5]/td/a[2]/span"); quality.WaitForPageToLoad("30000"); ken.ShoppingCartWithTrafficSubscriptionToBuy(true); ken.Logout(); }
//this is the test code generated by selenium //****Paste test script here***** public override void RunTest() { selenium.Open(base.baseURL); DateTime time = DateTime.Now; string current_year = time.Year.ToString(); string current_month = ""; quality.AreEqual("Garmin Product Updates for Kenwood", quality.GetTitle()); quality.Click("link=Sign In"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Sign In", quality.GetTitle()); ken.Login(username, password, fullname, false); //comment: Click on "Update" button from the "Product Updates" panel quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.DeviceSelectionPage(); //comment: Select the same device like the one from the XML quality.Select("id=headUnitRegionFilter", "label=All"); quality.WaitForPageToLoad("30000"); quality.Select("id=headUnitRegionFilter", "label=North America"); quality.WaitForPageToLoad("30000"); quality.Click("link=DNX7180"); quality.WaitForPageToLoad("30000"); ken.ModelIdentificationPage(); //comment: click on "Read Media" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Scan Portable Media", quality.GetTitle()); if (ken.CheckForTimeOut("Media Scan", "css=div.titleHeader-text", 61)) { failedcheck++; } quality.AreEqual("Media Scan", quality.GetText("css=div.titleHeader-text")); quality.AreEqual("Scanning Your Portable Storage Device... Please wait", quality.GetText("id=messageText")); ken.DeviceInformationFoundPage(true); // comment: Click on the "Continue" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); Thread.Sleep(5000); ken.ProductUpdatesPage(true); // comment: Click on "Latest Map" button quality.Click("css=div.description > span"); quality.WaitForPageToLoad("30000"); //comment: Check the "Latest Map for Kenwood" ken.LatestMapForKenwoodPage(true); //comment: Click "Add to Cart" button without beeing logged-in quality.Click("css=a.button.left > span"); quality.WaitForPageToLoad("30000"); ken.ShoppingCartWithLatestMapToBuy(); // comment: Click the "Checkout" button quality.Click("//form[@id='shoppingCartForm']/div[2]/div[4]/a[2]/span"); quality.WaitForPageToLoad("30000"); ken.CheckOutPage(); // comment: Update the Shipping address fields quality.Type("id=shippingAddressfirstName", "FirstName Tester"); quality.Type("id=shippingAddresslastName", "LastName Tester"); quality.Select("id=shippingAddresscountry", "label=Select a Country/Region"); quality.Select("id=shippingAddresscountry", "label=United States"); quality.Type("id=shippingAddressaddress1", "24285 Main"); quality.Type("id=shippingAddressaddress2", "AddressLine2 tester's address"); quality.Type("id=shippingAddresscity", ""); quality.Type("id=shippingAddresscity", "E PALO ALTO"); quality.Select("id=shippingAddressstate", "label=California"); quality.Type("id=shippingAddresszipPostal", ""); quality.Type("id=shippingAddresszipPostal", "94303"); quality.Type("id=shippingAddressphone", ""); quality.Type("id=shippingAddressphone", "000-555-1212"); quality.Click("id=continueBtn"); if (ken.CheckForTimeOut("Edit", "link=Edit", 61)) { failedcheck++; } // comment: Check that the "Billing Address" page is displayed ken.BillingAddressSection(); //string current_year = time.Year.ToString(); string year_builder = ""; for (int i = 0; i < 16; i++) { if (i <= 14) { year_builder += time.AddYears(i).Year.ToString() + " "; } else { year_builder += time.AddYears(i).Year.ToString(); } } quality.AreEqual(year_builder, quality.GetText("id=expYear")); //decrease speed of execution selenium.SetSpeed("1760"); quality.Select("name=cardType", "label=Master Card"); quality.Select("name=cardType", "label=Visa"); // comment: Type different values for "cardholder's name" text box and card number quality.Type("id=cardHolderName", "--//!@# $%$$#$%^&1312asda"); quality.Type("id=cardNumber", "-123456"); quality.Type("id=cardSecurityCode", "123"); quality.Select("id=expMonth", "label=09"); quality.Select("id=expYear", "label=2024"); quality.IsTrue(Regex.IsMatch(quality.GetText("link=What is this?"), "^What is this[\\s\\S]$")); quality.Click("id=submitOrder"); quality.AreEqual("Please enter a valid credit card number.", quality.GetText("css=#card-number > div.formAlert > div.alert > span")); Thread.Sleep(5000); //quality.AreEqual("Sorry, we cannot process orders at this time. Please try again later.", quality.GetText("css=div.error-message-item")); quality.Type("id=cardNumber", "123456789123456"); quality.Click("id=submitOrder"); //Thread.Sleep(5000); ////quality.AreEqual("invalid credit card number", quality.GetText("css=#card-number > div.formAlert > div.alert > span")); ////quality.AreEqual("We're sorry, but one or more fields are incomplete or incorrect.", quality.GetText("css=#card-number > div.formAlert > div.alert > span")); //for (int second = 0; ; second++) //{ // if (second >= 60) quality.Fail("timeout"); // try // { // if ("We're sorry, but one or more fields are incomplete or incorrect." == quality.GetText("css=div.error-message-title")) break; // } // catch (Exception) // { } // Thread.Sleep(1000); //} //quality.AreEqual("We're sorry, but one or more fields are incomplete or incorrect.", quality.GetText("css=div.error-message-title")); //quality.AreEqual("invalid credit card number", quality.GetText("css=div.error-message-item")); quality.AreEqual("Please enter a valid credit card number.", quality.GetText("css=#card-number > div.formAlert > div.alert > span")); quality.Select("name=cardType", "label=Master Card"); quality.Select("id=expYear", "label=2026"); quality.Type("id=cardNumber", "qweqgrevzqah"); quality.Click("id=submitOrder"); Thread.Sleep(5000); //CORECT //quality.AreEqual("Please enter a valid number.", quality.GetText("css=#card-number > div.formAlert > div.alert > span")); //WRONG quality.AreEqual("Please enter a valid number", quality.GetText("css=#card-number > div.formAlert > div.alert > span")); //for (int second = 0; ; second++) //{ // if (second >= 60) quality.Fail("timeout"); // try // { // if ("Sorry, we cannot process orders at this time. Please try again later." == quality.GetText("css=div.error-message-item")) break; // } // catch (Exception) // { } // Thread.Sleep(1000); //} //quality.AreEqual("Sorry, we cannot process orders at this time. Please try again later.", quality.GetText("css=div.error-message-item")); quality.Type("id=cardNumber", "!@#%$^^&*%$$)("); quality.Click("id=submitOrder"); Thread.Sleep(5000); //CORECT //quality.AreEqual("Please enter a valid number.", quality.GetText("css=#card-number > div.formAlert > div.alert > span")); //WRONG quality.AreEqual("Please enter a valid number", quality.GetText("css=#card-number > div.formAlert > div.alert > span")); //Check if the current month is not the first one in the year to be able to execute the expiration date of the card if (time.Month >= 2) { quality.Type("id=cardNumber", "5555555555554444"); quality.Select("id=expYear", "label=2024"); if (time.Month < 10 && time.Month > 1) { DateTime substractMonth = time.AddMonths(-1); int onlyMonth = substractMonth.Month; current_month = "0" + onlyMonth.ToString(); } else if (time.Month == 10) { current_month = "09"; } else if (time.Month > 10 && time.Month <= 12) { DateTime substractMonth = time.AddMonths(-1); int onlyMonth = substractMonth.Month; current_month = onlyMonth.ToString(); } quality.Select("id=expMonth", "label=" + current_month + ""); quality.Select("id=expYear", "label=" + current_year + ""); quality.Click("id=submitOrder"); Thread.Sleep(5000); quality.AreEqual("Expiration Date must be in the future", quality.GetText("css=#expiration-date > div.formAlert > div.alert > span")); } // comment: Insert some special characters in the CSC field quality.Select("name=cardType", "label=Discover"); quality.Type("id=cardHolderName", "holder name"); quality.Type("id=cardNumber", "6011111111111117"); quality.Type("id=cardSecurityCode", "!@#$"); quality.Select("id=expMonth", "label=03"); quality.Select("id=expYear", "label=" + time.AddYears(10).Year.ToString() + ""); quality.Click("id=submitOrder"); //quality.AreEqual("Please enter a valid number.", quality.GetText("css=#card-security-code > div.formAlert > div.alert > span")); //WRONG quality.AreEqual("Please enter a valid number", quality.GetText("css=#card-security-code > div.formAlert > div.alert > span")); quality.Type("id=cardSecurityCode", "qwer"); quality.Click("id=submitOrder"); //quality.AreEqual("Please enter a valid number.", quality.GetText("css=#card-security-code > div.formAlert > div.alert > span")); //WRONG quality.AreEqual("Please enter a valid number", quality.GetText("css=#card-security-code > div.formAlert > div.alert > span")); // comment: Select a VISA card with CSC 200 with Shipping address ZIP Code 94303 (AVSZIP = N) quality.Select("name=cardType", "label=Visa"); quality.Type("id=cardNumber", "4111111111111111"); quality.Type("id=cardSecurityCode", "200"); quality.Select("id=expMonth", "label=07"); quality.Select("id=expYear", "label=" + time.AddYears(13).Year.ToString() + ""); quality.Click("id=submitOrder"); Thread.Sleep(16000); quality.AreEqual("The zip code you have entered doesn't match the credit card information. Please re-enter your zip code or select a different form of payment.", quality.GetText("css=div.error-message-item")); // comment: Select a MASTERCARD and type number from a VISA card quality.Select("name=cardType", "label=Master Card"); quality.Type("id=cardNumber", "4111111111111111"); quality.Type("id=cardSecurityCode", "222"); quality.Select("id=expMonth", "label=07"); quality.Select("id=expYear", "label=" + time.AddYears(13).Year.ToString() + ""); quality.Click("id=submitOrder"); Thread.Sleep(16000); quality.AreEqual("There was a problem processing your credit card. Please confirm your billing and shipping address and try again. If the problem persists, please confirm that there are funds available or use a different payment method.", quality.GetText("css=div.error-message-item")); // comment: Select a DISCOVER card type and type an AMERICAN EXPRESS card number quality.Select("name=cardType", "label=Discover"); quality.Type("id=cardNumber", "378282246310005"); quality.Type("id=cardSecurityCode", "999"); quality.Select("id=expMonth", "label=02"); quality.Select("id=expYear", "label=" + time.AddYears(9).Year.ToString() + ""); quality.Click("id=submitOrder"); Thread.Sleep(5000); quality.AreEqual("There was a problem processing your credit card. Please confirm your billing and shipping address and try again. If the problem persists, please confirm that there are funds available or use a different payment method.", quality.GetText("css=div.error-message-item")); // comment: Update the Shipping address fields quality.Click("link=Edit"); //SET THIS TIME only on FF browser /* * if (browser == "FF") * { * quality.WaitForPageToLoad("30000"); * } */ quality.AreEqual("Checkout", quality.GetTitle()); quality.AreEqual("Checkout", quality.GetText("css=div.titleHeader-text")); quality.IsTrue(quality.IsTextPresent("Please fill out the form below to complete your transaction. Do not click your browser's Refresh or Back button because this transaction may be interrupted or terminated.")); quality.AreEqual("Shipping Address", quality.GetText("css=h2")); quality.Type("id=shippingAddressfirstName", "FirstName Tester"); quality.Type("id=shippingAddresslastName", "LastName Tester"); quality.Select("id=shippingAddresscountry", "label=Select a Country/Region"); quality.Select("id=shippingAddresscountry", "label=United States"); quality.Type("id=shippingAddressaddress1", "AddressLine1 tester's address"); quality.Type("id=shippingAddressaddress2", "AddressLine2 tester's address"); quality.Type("id=shippingAddresscity", ""); quality.Type("id=shippingAddresscity", "HILO"); quality.Select("id=shippingAddressstate", "label=Hawaii"); quality.Type("id=shippingAddresszipPostal", ""); quality.Type("id=shippingAddresszipPostal", "96720"); quality.Type("id=shippingAddressphone", ""); quality.Type("id=shippingAddressphone", "000-555-1212"); quality.Click("id=continueBtn"); // comment: Check that the "Billing Address" page is displayed if (ken.CheckForTimeOut("Edit", "link=Edit", 61)) { failedcheck++; } quality.AreEqual("Edit", quality.GetText("link=Edit")); quality.AreEqual("Shipping Address", quality.GetText("css=h2")); //quality.AreEqual("Delivery Options", quality.GetText("css=fieldset > div.formHead > h2")); quality.AreEqual("Billing Address", quality.GetText("css=#billing-address > fieldset > div.formHead > h2")); quality.AreEqual("Payment Information", quality.GetText("css=#payment-information > fieldset > div.formHead > h2")); quality.AreEqual("Place Secure Order", quality.GetText("id=submitOrder")); // comment: Return an invalid CSC error message quality.Select("name=cardType", "label=Discover"); quality.Type("id=cardHolderName", "holder name"); quality.Type("id=cardNumber", "6011111111111117"); quality.Type("id=cardSecurityCode", "333"); quality.Select("id=expMonth", "label=03"); quality.Select("id=expYear", "label=" + time.AddYears(10).Year.ToString() + ""); quality.Click("id=submitOrder"); Thread.Sleep(9000); quality.AreEqual("The CSC code you have entered is invalid. Please re-enter the CSC code or select a different form of payment.", quality.GetText("css=div.error-message-item")); //increase speed of test execution selenium.SetSpeed("600"); //---------------- // comment: Go back to Cart and remove the product quality.AreEqual("Back to Cart", quality.GetText("id=cancelBtn")); quality.Click("css=a.margin-l5"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Shopping Cart", quality.GetTitle()); try { quality.IsTrue(quality.IsTextPresent("remove")); } catch (Exception) { failedcheck++; } quality.Click("link=remove"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Shopping Cart", quality.GetTitle()); quality.AreEqual("Your Shopping Cart is currently empty", quality.GetText("css=div.cartEmpty")); ken.Logout(); }
//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("link=Sign In"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Sign In", quality.GetTitle()); ken.Login(username, password, fullname, false); //comment: Click on "Update" button from the "Product Updates" panel quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.DeviceSelectionPage(); //comment: Select the same device like the one from the XML quality.Select("id=headUnitRegionFilter", "label=All"); quality.WaitForPageToLoad("30000"); quality.Select("id=headUnitRegionFilter", "label=North America"); quality.WaitForPageToLoad("30000"); quality.Click("link=DNX7180"); quality.WaitForPageToLoad("30000"); ken.ModelIdentificationPage(); //comment: click on "Read Media" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Scan Portable Media", quality.GetTitle()); if (ken.CheckForTimeOut("Media Scan", "css=div.titleHeader-text", 61)) { failedcheck++; } quality.AreEqual("Media Scan", quality.GetText("css=div.titleHeader-text")); quality.AreEqual("Scanning Your Portable Storage Device... Please wait", quality.GetText("id=messageText")); ken.DeviceInformationFoundPage(true); // comment: Click on the "Continue" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.ProductUpdatesPage(true); // comment: Click on "Latest Map" button quality.Click("css=div.description > span"); quality.WaitForPageToLoad("30000"); //comment: Check the "Latest Map for Kenwood" ken.LatestMapForKenwoodPage(true); //comment: Click "Add to Cart" button without beeing logged-in quality.Click("css=a.button.left > span"); quality.WaitForPageToLoad("30000"); ken.ShoppingCartWithLatestMapToBuy(); // comment: Click the "Checkout" button quality.Click("//form[@id='shoppingCartForm']/div[2]/div[4]/a[2]/span"); quality.WaitForPageToLoad("30000"); ken.CheckOutPage(); // comment: Update the Shipping address fields quality.Type("id=shippingAddressfirstName", "FirstName Tester"); quality.Type("id=shippingAddresslastName", "LastName Tester"); quality.Select("id=shippingAddresscountry", "label=Select a Country/Region"); quality.Select("id=shippingAddresscountry", "label=United States"); quality.Type("id=shippingAddressaddress1", "AddressLine1 tester's address"); quality.Type("id=shippingAddressaddress2", "AddressLine2 tester's address"); quality.Type("id=shippingAddresscity", ""); quality.Type("id=shippingAddresscity", "HILO"); quality.Select("id=shippingAddressstate", "label=Hawaii"); quality.Type("id=shippingAddresszipPostal", ""); quality.Type("id=shippingAddresszipPostal", "96720"); quality.Type("id=shippingAddressphone", ""); quality.Type("id=shippingAddressphone", "000-555-1212"); quality.Click("id=continueBtn"); quality.WaitForPageToLoad("30000"); // comment: Check that the "Billing Address" page is displayed if (ken.CheckForTimeOut("Edit", "link=Edit", 61)) { failedcheck++; } quality.AreEqual("Edit", quality.GetText("link=Edit")); quality.AreEqual("Shipping Address", quality.GetText("css=h2")); quality.AreEqual("Billing Address", quality.GetText("css=fieldset > div.formHead > h2")); quality.AreEqual("Payment Information", quality.GetText("css=#payment-information > fieldset > div.formHead > h2")); quality.AreEqual("Place Secure Order", quality.GetText("id=submitOrder")); //complete the Payment Information section before testing the billing address section for getting all the error messages quality.Select("name=cardType", "label=Visa"); quality.Type("id=cardHolderName", "holder name"); quality.Type("id=cardNumber", "4111111111111111"); quality.Type("id=cardSecurityCode", "123"); quality.Select("id=expYear", "label=2027"); //uncheck the Billing address //get if a checkbox is checked or not string checkedOrNot = quality.GetValue("id=sameAsShipping-sameAddress"); if (checkedOrNot != "off") { quality.Click("id=sameAsShipping-sameAddress"); } //comment: Empty all the requiered fields and press the "Continue" button quality.Type("id=billingAddressfirstName", ""); quality.Type("id=billingAddresslastName", ""); quality.Select("id=billingAddresscountry", "label=Select a Country/Region"); quality.Type("id=billingAddressaddress1", ""); quality.Type("id=billingAddressaddress2", ""); quality.Type("id=billingAddresscity", ""); quality.Select("id=billingAddressstate", "label=Select a State/Province"); quality.Type("id=billingAddresszipPostal", ""); quality.Type("id=billingAddresszipPostal", ""); quality.Type("id=billingAddressphone", ""); quality.Type("id=billingAddressphone", ""); quality.Click("id=submitOrder"); if (ken.CheckForTimeOut("This field is required.", "css=div.alert > span", 61)) { failedcheck++; } quality.AreEqual("This field is required.", quality.GetText("css=div.alert > span")); quality.AreEqual("This field is required.", quality.GetText("css=#billingAddress-last-name > div.formAlert > div.alert > span")); quality.AreEqual("This field is required.", quality.GetText("css=#billingAddress-country-region > div.formAlert > div.alert > span")); quality.AreEqual("This field is required.", quality.GetText("css=#billingAddress-address-line-1 > div.formAlert > div.alert > span")); quality.AreEqual("This field is required.", quality.GetText("css=#billingAddress-city > div.formAlert > div.alert > span")); quality.AreEqual("This field is required.", quality.GetText("css=#billingAddress-state-province > div.formAlert > div.alert > span")); quality.AreEqual("This field is required.", quality.GetText("css=#billingAddress-zip-postal-code > div.formAlert > div.alert > span")); quality.AreEqual("This field is required.", quality.GetText("css=#billingAddress-phone > div.formAlert > div.alert > span")); // comment: State doesn't match the the zip code quality.Type("id=billingAddressfirstName", "ABC Tester"); quality.Type("id=billingAddresslastName", "EFG Tester"); quality.Select("id=billingAddresscountry", "label=Select a Country/Region"); quality.Select("id=billingAddresscountry", "label=United States"); quality.Type("id=billingAddressaddress1", "lololol tester's address"); quality.Type("id=billingAddressaddress2", "qwerty tester's address"); quality.Type("id=billingAddresscity", "HILO"); quality.Select("id=billingAddressstate", "label=Idaho"); quality.Type("id=billingAddresszipPostal", ""); quality.Type("id=billingAddresszipPostal", "96720"); quality.Type("id=billingAddressphone", ""); quality.Type("id=billingAddressphone", "789-555-888824"); quality.Click("id=submitOrder"); if (ken.CheckForTimeOut("State does not match zip/postal code.", "css=#billingAddress-state-province > div.formAlert > div.alert > span", 61)) { failedcheck++; } quality.AreEqual("State does not match zip/postal code.", quality.GetText("css=#billingAddress-state-province > div.formAlert > div.alert > span")); // comment: Zip code is not valid quality.Type("id=billingAddressfirstName", "ABC Tester"); quality.Type("id=billingAddresslastName", "EFG Tester"); quality.Select("id=billingAddresscountry", "label=Select a Country/Region"); quality.Select("id=billingAddresscountry", "label=United States"); quality.Type("id=billingAddressaddress1", "lololol tester's address"); quality.Type("id=billingAddressaddress2", "qwerty tester's address"); quality.Type("id=billingAddresscity", ""); quality.Type("id=billingAddresscity", "HILO"); quality.Select("id=billingAddressstate", "label=Hawaii"); quality.Type("id=billingAddresszipPostal", ""); quality.Type("id=billingAddresszipPostal", "12356"); quality.Type("id=billingAddressphone", ""); quality.Type("id=billingAddressphone", "789-555-888824"); quality.Click("id=submitOrder"); if (ken.CheckForTimeOut("Zip/postal code is not valid.", "css=#billingAddress-zip-postal-code > div.formAlert > div.alert > span", 61)) { failedcheck++; } quality.AreEqual("Zip/postal code is not valid.", quality.GetText("css=#billingAddress-zip-postal-code > div.formAlert > div.alert > span")); //comment: Type the maximum values for First Name, Last Name (100 characters) & Address1, Address2(200 characters) & Phone (20 characters) & City (100 characters) quality.Type("id=billingAddressfirstName", "FirstName TesterFirstName TesterFirstName TesterFirstName TesterFirstName TesterFirstName TesterFirs"); quality.Type("id=billingAddresslastName", "FirstName TesterFirstName TesterFirstName TesterFirstName TesterFirstName TesterFirstName TesterFirs"); quality.Select("id=billingAddresscountry", "label=Select a Country/Region"); quality.Select("id=billingAddresscountry", "label=Hong Kong"); quality.Type("id=billingAddressaddress1", "AddressLine1 tester's addressAddressLine1 tester's addressAddressLine1 tester's addressAddressLine1 tester's addressAddressLine1 tester's addressAddressLine1 tester's addressAddressLine1 tester's addr"); quality.Type("id=billingAddressaddress2", "AddressLine1 tester's addressAddressLine1 tester's addressAddressLine1 tester's addressAddressLine1 tester's addressAddressLine1 tester's addressAddressLine1 tester's addressAddressLine1 tester's addr"); quality.IsTrue(quality.IsElementPresent("id=billingAddressstate")); quality.Type("id=billingAddresscity", "HILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILO"); quality.Type("id=billingAddresszipPostal", "12351235498456564546163112316984565645461631123163"); quality.Type("id=billingAddressphone", "000-555-1212000-555-"); // comment: City doesn't match the the zip code quality.Type("id=billingAddressfirstName", "ABC Tester"); quality.Type("id=billingAddresslastName", "EFG Tester"); quality.Select("id=billingAddresscountry", "label=Select a Country/Region"); quality.Select("id=billingAddresscountry", "label=United States"); quality.Type("id=billingAddressaddress1", "lololol tester's address"); quality.Type("id=billingAddressaddress2", "qwerty tester's address"); quality.Type("id=billingAddresscity", "Cluj"); quality.Select("id=billingAddressstate", "label=Alaska"); quality.Type("id=billingAddresszipPostal", ""); quality.Type("id=billingAddresszipPostal", "99515"); quality.Type("id=billingAddressphone", ""); quality.Type("id=billingAddressphone", "789-555-888824"); quality.Click("id=submitOrder"); if (ken.CheckForTimeOut("City does not match zip/postal code. Please select a city from the list, or continue with the city you entered.", "css=#billingAddress-city > div.formAlert > div.alert > span", 61)) { failedcheck++; } quality.AreEqual("City does not match zip/postal code. Please select a city from the list, or continue with the city you entered.", quality.GetText("css=#billingAddress-city > div.formAlert > div.alert > span")); // comment: Go back to Cart and remove the product quality.AreEqual("Back to Cart", quality.GetText("id=cancelBtn")); quality.Click("css=a.margin-l5"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Shopping Cart", quality.GetTitle()); try { quality.IsTrue(quality.IsTextPresent("remove")); } catch (Exception) { failedcheck++; } quality.Click("link=remove"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Shopping Cart", quality.GetTitle()); quality.AreEqual("Your Shopping Cart is currently empty", quality.GetText("css=div.cartEmpty")); ken.Logout(); }
//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()); //comment: Login quality.Click("link=Sign In"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Sign In", quality.GetTitle()); ken.Login(username, password, fullname, false); //comment: Click on Product Updates quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); quality.ErrorReport("Ping 1", CheckType.Warning); ken.DeviceSelectionPage(); quality.Select("id=headUnitRegionFilter", "label=All"); quality.WaitForPageToLoad("30000"); Thread.Sleep(1000); quality.Select("id=headUnitRegionFilter", "label=Europe"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Select a Model", quality.GetTitle()); Thread.Sleep(1000); //comment: Select the same device like the one from the XML quality.Click("link=DNX5220"); quality.WaitForPageToLoad("30000"); quality.ErrorReport("Ping 2", CheckType.Warning); ken.ProductUpdatesPage(true); // comment: Click on "Real-Time Traffic" button quality.Click("//div[@id='productUpdates']/a[2]/div/div/div"); quality.WaitForPageToLoad("30000"); quality.ErrorReport("Ping 3", CheckType.Warning); ken.TrafficSubscriptionPage(); //comment: Click on the first traffic subscription (North America) quality.Click("css=div.text"); quality.WaitForPageToLoad("30000"); quality.ErrorReport("Ping 4", CheckType.Warning); ken.TrafficServicesForkenwoodPage(); //comment: Click "Add to Cart" button without beeing logged-in quality.Click("css=a.button.left > span"); quality.WaitForPageToLoad("30000"); quality.ErrorReport("Ping 5", CheckType.Warning); //comment: Validate the "Add to Cart: Traffic Subscription" page ken.AddToCartTrafficVerification(false); // comment: Type a Valid Unit ID and A valid Traffic Receiver ID quality.Type("id=unitId", ""); //quality.Type("id=trafficReceiverId", ""); quality.Type("id=unitId", unitId); //quality.Type("id=trafficReceiverId", unitId); quality.Click("link=Continue"); quality.WaitForPageToLoad("30000"); // ken.ShoppingCartWithTrafficSubscriptionToBuy(true); // comment: Click the "Checkout" button quality.Click("//form[@id='shoppingCartForm']/div[2]/div[4]/a[2]/span"); quality.WaitForPageToLoad("30000"); quality.ErrorReport("Ping 6", CheckType.Warning); //ken.CheckOutPage(); // comment: Update the Shipping address fields quality.Type("id=shippingAddressfirstName", "FirstName Tester"); quality.Type("id=shippingAddresslastName", "LastName Tester"); quality.Select("id=shippingAddresscountry", "label=Select a Country/Region"); quality.Select("id=shippingAddresscountry", "label=United States"); quality.Type("id=shippingAddressaddress1", "24285 Main"); quality.Type("id=shippingAddressaddress2", "AddressLine2 tester's address"); quality.Type("id=shippingAddresscity", ""); quality.Type("id=shippingAddresscity", "E PALO ALTO"); quality.Select("id=shippingAddressstate", "label=California"); quality.Type("id=shippingAddresszipPostal", ""); quality.Type("id=shippingAddresszipPostal", "94303"); quality.Type("id=shippingAddressphone", ""); quality.Type("id=shippingAddressphone", "000-555-1212"); quality.Click("id=continueBtn"); quality.ErrorReport("Ping 7", CheckType.Warning); if (ken.CheckForTimeOut("Edit", "link=Edit", 61)) { failedcheck++; } // comment: Check that the "Billing Address" page is displayed quality.AreEqual("Edit", quality.GetText("link=Edit")); quality.IsTextPresent("Shipping Address"); quality.AreEqual("Delivery Options", quality.GetText("css=fieldset > div.formHead > h2")); quality.AreEqual("Billing Address", quality.GetText("css=#billing-address > fieldset > div.formHead > h2")); quality.AreEqual("Payment Information", quality.GetText("css=#payment-information > fieldset > div.formHead > h2")); quality.AreEqual("Place Secure Order", quality.GetText("id=submitOrder")); //ken.DeliveryOptionsSection("FF"); ken.Logout(); }
//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("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.DeviceSelectionPage(); quality.Select("id=headUnitRegionFilter", "label=All"); quality.WaitForPageToLoad("30000"); quality.Select("id=headUnitRegionFilter", "label=Europe"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Select a Model", quality.GetTitle()); //comment: Select the same device like the one from the XML quality.Click("link=DNX7220"); quality.WaitForPageToLoad("30000"); ken.ProductUpdatesPage(true); // comment: Click on "Real-Time Traffic" button quality.Click("//div[@id='productUpdates']/a[2]/div/div/div"); quality.WaitForPageToLoad("30000"); //comment: Check the "Real Traffic for Kenwood" ken.TrafficSubscriptionPage(); //comment: Click on the first traffic subscription (North America) quality.Click("css=div.text"); quality.WaitForPageToLoad("30000"); ken.TrafficServicesForkenwoodPage(); //comment: Click "Add to Cart" button without beeing logged-in quality.Click("css=a.button.left > span"); quality.WaitForPageToLoad("30000"); ken.SignInPage(); quality.Type("id=username", username); quality.Type("id=password", password); quality.Click("css=a.button"); quality.WaitForPageToLoad("30000"); //comment: Validate the "Add to Cart: Traffic Subscription" page ken.AddToCartTrafficVerification(true); // comment: Type a Valid Unit ID quality.Type("id=unitId", ""); quality.Type("id=unitId", "3422110080"); quality.Click("//form[@id='verifyTrafficForm']/table/tbody/tr[5]/td/a[2]/span"); quality.WaitForPageToLoad("30000"); ken.ShoppingCartWithTrafficSubscriptionToBuy(true); // comment: Click "Update" button even if the QTY is disabled to be changed try { if (selenium.IsEditable("id=quantityDisabled") == false) { quality.ErrorReport("Quantity Cannot be changed", CheckType.Element); } } catch (Exception) { } quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.ShoppingCartWithTrafficSubscriptionToBuy(true); ken.Logout(); }
//this is the test code generated by selenium //****Paste test script here***** public override void RunTest() { Update_XML.XMLEdit("Id", "3422110115"); selenium.Open(base.baseURL); quality.AreEqual("Garmin Product Updates for Kenwood", quality.GetTitle()); quality.Click("link=Sign In"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Sign In", quality.GetTitle()); ken.Login(username, password, fullname, false); //comment: Click on "Update" button from the "Product Updates" panel quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.DeviceSelectionPage(); //comment: Select the same device like the one from the XML quality.Select("id=headUnitRegionFilter", "label=All"); quality.WaitForPageToLoad("30000"); quality.Select("id=headUnitRegionFilter", "label=Europe"); quality.WaitForPageToLoad("30000"); quality.Click("link=DNX7220"); quality.WaitForPageToLoad("30000"); /* * ken.ModelIdentificationPage(quality); * * //comment: click on "Read Media" button * quality.Click("css=a.button > span"); * quality.WaitForPageToLoad("30000"); * quality.AreEqual("Scan Portable Media", quality.GetTitle()); * * for (int second = 0; ; second++) * { * if (second >= 60) quality.Fail("timeout"); * try * { * if ("Media Scan" == quality.GetText("css=div.titleHeader-text")) break; * } * catch (Exception) * { } * Thread.Sleep(1000); * } * * quality.AreEqual("Media Scan", quality.GetText("css=div.titleHeader-text")); * quality.AreEqual("Scanning Your Portable Storage Device... Please wait", quality.GetText("id=messageText")); * * ken.DeviceInformationFoundPage(quality, true); * * // comment: Click on the "Continue" button * quality.Click("css=a.button > span"); * quality.WaitForPageToLoad("30000"); */ ken.ProductUpdatesPage(true); /* * // comment: Click on "Latest Map" button * quality.Click("css=div.description > span"); * quality.WaitForPageToLoad("30000"); * * //comment: Check the "Latest Map for Kenwood" * ken.LatestMapForKenwoodPage(quality); */ // comment: Click on "Real-Time Traffic" button quality.Click("//div[@id='productUpdates']/a[2]/div/div/div"); quality.WaitForPageToLoad("30000"); //comment: Check the "Traffic subscription for Kenwood" ken.TrafficSubscriptionPage(); //comment: Click on the first traffic subscription (North America) quality.Click("css=div.text"); quality.WaitForPageToLoad("30000"); ken.TrafficServicesForkenwoodPage(); //comment: Click "Add to Cart" button without beeing logged-in quality.Click("css=a.button.left > span"); quality.WaitForPageToLoad("30000"); //comment: Validate the "Add to Cart: Traffic Subscription" page ken.AddToCartTrafficVerification(true); quality.Type("id=unitId", "3422110115"); quality.Click("//form[@id='verifyTrafficForm']/table/tbody/tr[5]/td/a[2]/span"); quality.WaitForPageToLoad("30000"); //ken.ShoppingCartWithLatestMapToBuy(quality); ken.ShoppingCartWithTrafficSubscriptionToBuy(true); // comment: Click the "Checkout" button quality.Click("//form[@id='shoppingCartForm']/div[2]/div[4]/a[2]/span"); quality.WaitForPageToLoad("30000"); ken.CheckOutPage(); // comment: Update the Shipping address fields ken.Checkout("FirstName Tester", "LastName Tester", "label=United States", "AddressLine1 tester's address", "AddressLine2 tester's address", "HILO", "label=Hawaii", "96720", "000-555-1212"); // comment: Check that the "Billing Address" page is displayed /* * if (ken.CheckForTimeOut("Edit","link=Edit", 61)) * { * failedcheck++; * } */ ken.BillingAddressSection(); ken.PaymentInformationSection(); DateTime time = DateTime.Now; //string current_year = time.Year.ToString(); string year_builder = ""; for (int i = 0; i < 16; i++) { if (i <= 14) { year_builder += time.AddYears(i).Year.ToString() + " "; } else { year_builder += time.AddYears(i).Year.ToString(); } } quality.AreEqual(year_builder, quality.GetText("id=expYear")); //decrease speed of execution selenium.SetSpeed("1000"); quality.Select("name=cardType", "label=Master Card"); quality.Select("name=cardType", "label=Visa"); // comment: Complete Purchase workflow quality.Select("name=cardType", "label=Discover"); quality.Type("id=cardHolderName", "holder name"); quality.Type("id=cardNumber", "6011111111111117"); quality.Type("id=cardSecurityCode", "123"); quality.Select("id=expMonth", "label=03"); quality.Select("id=expYear", "label=2021"); //comment: Click on "Place Secure Order" button quality.Click("id=submitOrder"); quality.WaitForPageToLoad("30000"); Thread.Sleep(10000); // comment: Validate the Purchase Details /* * for (int second = 0; second < 61 ; second++) * { * if (second >= 60) quality.ErrorReport("timeout" , CheckType.Warning); * try * { * if (quality.IsTextPresent("Order Summary")) break; * } * catch (Exception) * { } * Thread.Sleep(1000); * } */ quality.AreEqual("Order Summary", quality.GetTitle()); quality.AreEqual("Order Summary", quality.GetText("css=div.titleHeader-text")); quality.AreEqual("Order Receipt:", quality.GetText("css=div.header")); string inputString = quality.GetText("css=strong"); /* * Match match = Regex.Match(inputString, @"Order\s\#\:\s\d{12}", RegexOptions.IgnoreCase); * * if (match.Success) * { * quality.True(true); * } */ //quality.IsTrue(quality.IsTextPresent("Order Date: February 6, 2012 8:06:48 AM EST")); //quality.IsTrue(quality.IsTextPresent("Total: $69.99")); quality.IsTrue(quality.IsTextPresent("Status: Order Placed")); quality.AreEqual("Payment Method:", quality.GetText("//div[@id='bd']/div[3]/div/div[2]/div")); string cardName_number = quality.GetText("//div[@id='bd']/div[3]/div/div[2]/div[2]"); /* * Match match1 = Regex.Match(cardName_number, @"\w{4}\s*.*\d{4}", RegexOptions.IgnoreCase); * * if (match1.Success) * { * quality.True(true); * } */ //quality.IsTrue(Regex.IsMatch(quality.GetText("//div[@id='bd']/div[3]/div/div[2]/div[2]"), "^VISA ************1111$")); quality.AreEqual("Billed To:", quality.GetText("//div[@id='bd']/div[3]/div[2]/div/div")); quality.IsTrue(quality.IsTextPresent("FirstName Tester LastName Tester")); quality.IsTrue(quality.IsTextPresent("AddressLine1 tester's address")); quality.IsTrue(quality.IsTextPresent("AddressLine2 tester's address")); quality.IsTrue(quality.IsTextPresent("HILO, HI")); quality.IsTrue(quality.IsTextPresent("US")); quality.IsTrue(quality.IsTextPresent("96720")); quality.IsTrue(quality.IsTextPresent("000-555-1212")); quality.AreEqual("Shipped To:", quality.GetText("//div[@id='bd']/div[3]/div[2]/div[2]/div")); quality.IsTrue(quality.IsTextPresent("FirstName Tester LastName Tester")); quality.IsTrue(quality.IsTextPresent("AddressLine1 tester's address")); quality.IsTrue(quality.IsTextPresent("AddressLine2 tester's address")); quality.IsTrue(quality.IsTextPresent("HILO, HI")); quality.IsTrue(quality.IsTextPresent("US")); quality.IsTrue(quality.IsTextPresent("96720")); quality.IsTrue(quality.IsTextPresent("000-555-1212")); quality.AreEqual("My Order:", quality.GetText("css=div.orderDetails > div.header")); quality.AreEqual("Item Description", quality.GetText("css=div.text")); quality.AreEqual("Unit Price", quality.GetText("css=#price-hd > div.text")); quality.AreEqual("Qty", quality.GetText("css=#quantity-hd > div.text")); quality.AreEqual("Total", quality.GetText("css=#total-hd > div.text")); //quality.AreEqual("City Navigator® North America NT 2012 Map Update for Kenwood Download", quality.GetText("css=span.name")); quality.AreEqual("Premium Traffic Subscription - Belgium", quality.GetText("css=span.name")); //quality.AreEqual("Item #010-D1207-00", quality.GetText("css=div.partNumber")); quality.AreEqual("Item #010-11356-10", quality.GetText("css=div.partNumber")); quality.AreEqual("", quality.GetText("css=img.margin-r20")); //quality.AreEqual("$69.99", quality.GetText("id=price")); //quality.IsTrue(Regex.IsMatch(quality.GetText("id=price"), ".*")); //quality.AreEqual("$69.99", quality.GetText("id=total")); //quality.IsTrue(Regex.IsMatch(quality.GetText("id=total"), ".*")); quality.AreEqual("Subtotal:", quality.GetText("css=div.labels")); //quality.AreEqual("$69.99", quality.GetText("css=div.prices.right > div.right")); //quality.IsTrue(Regex.IsMatch(quality.GetText("css=div.prices.right > div.right"), ".*")); quality.AreEqual("Total Charged:", quality.GetText("css=b")); //quality.AreEqual("$69.99", quality.GetText("css=div.right > b")); //quality.IsTrue(Regex.IsMatch(quality.GetText("css=div.right > b"), ".*")); // comment: Sign Out ken.Logout(); }
//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("link=Sign In"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Sign In", quality.GetTitle()); ken.Login(username, password, fullname, false); //comment: Click on "Update" button from the "Product Updates" panel quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.DeviceSelectionPage(); //comment: Select the same device like the one from the XML quality.Select("id=headUnitRegionFilter", "label=All"); quality.WaitForPageToLoad("30000"); quality.Select("id=headUnitRegionFilter", "label=North America"); quality.WaitForPageToLoad("30000"); quality.Click("link=DNX7180"); quality.WaitForPageToLoad("30000"); ken.ModelIdentificationPage(); //comment: click on "Read Media" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Scan Portable Media", quality.GetTitle()); if (ken.CheckForTimeOut("Media Scan", "css=div.titleHeader-text", 61)) { failedcheck++; } quality.AreEqual("Media Scan", quality.GetText("css=div.titleHeader-text")); quality.AreEqual("Scanning Your Portable Storage Device... Please wait", quality.GetText("id=messageText")); ken.DeviceInformationFoundPage(true); // comment: Click on the "Continue" button quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.ProductUpdatesPage(true); // comment: Click on "Latest Map" button quality.Click("css=div.description > span"); quality.WaitForPageToLoad("30000"); //comment: Check the "Latest Map for Kenwood" ken.LatestMapForKenwoodPage(true); //comment: Click "Add to Cart" button without beeing logged-in quality.Click("css=a.button.left > span"); quality.WaitForPageToLoad("30000"); ken.ShoppingCartWithLatestMapToBuy(); // comment: Click the "Checkout" button quality.Click("//form[@id='shoppingCartForm']/div[2]/div[4]/a[2]/span"); quality.WaitForPageToLoad("30000"); ken.CheckOutPage(); // comment: Update the Shipping address fields quality.Type("id=shippingAddressfirstName", "ABC Tester"); quality.Type("id=shippingAddresslastName", "EFG Tester"); quality.Select("id=shippingAddresscountry", "label=Select a Country/Region"); quality.Select("id=shippingAddresscountry", "label=United States"); quality.Type("id=shippingAddressaddress1", "lololol tester's address"); quality.Type("id=shippingAddressaddress2", "qwerty tester's address"); quality.Type("id=shippingAddresscity", ""); quality.Type("id=shippingAddresscity", "Cluj"); quality.Select("id=shippingAddressstate", "label=Alaska"); quality.Type("id=shippingAddresszipPostal", ""); quality.Type("id=shippingAddresszipPostal", "99515"); quality.Type("id=shippingAddressphone", ""); quality.Type("id=shippingAddressphone", "789-555-888824"); quality.Click("id=continueBtn"); if (ken.CheckForTimeOut("City does not match zip/postal code. Please select a city from the list, or continue with the city you entered.", "css=#shippingAddress-city > div.formAlert > div.alert > span", 61)) { failedcheck++; } quality.AreEqual("City does not match zip/postal code. Please select a city from the list, or continue with the city you entered.", quality.GetText("css=#shippingAddress-city > div.formAlert > div.alert > span")); //comment: Select the City typed quality.Select("id=shippingAddresscity", "label=Use what I entered"); quality.Click("id=continueBtn"); quality.WaitForPageToLoad("30000"); // comment: Check that the "Billing Address" page is displayed if (ken.CheckForTimeOut("Edit", "link=Edit", 61)) { } quality.AreEqual("Edit", quality.GetText("link=Edit")); quality.AreEqual("Shipping Address", quality.GetText("css=h2")); quality.AreEqual("Billing Address", quality.GetText("css=fieldset > div.formHead > h2")); quality.AreEqual("Payment Information", quality.GetText("css=#payment-information > fieldset > div.formHead > h2")); quality.AreEqual("Place Secure Order", quality.GetText("id=submitOrder")); //comment: Click on "Edit" button to edit the Shipping Address details quality.Click("link=Edit"); quality.WaitForPageToLoad("30000"); //comment: GO back to Shipping Address page ken.CheckOutPage(); // comment: Update the Shipping address fields quality.Type("id=shippingAddressfirstName", "FirstName Tester"); quality.Type("id=shippingAddresslastName", "LastName Tester"); quality.Select("id=shippingAddresscountry", "label=Select a Country/Region"); quality.Select("id=shippingAddresscountry", "label=United States"); quality.Type("id=shippingAddressaddress1", "AddressLine1 tester's address"); quality.Type("id=shippingAddressaddress2", "AddressLine2 tester's address"); quality.Type("id=shippingAddresscity", ""); quality.Type("id=shippingAddresscity", "HILO"); quality.Select("id=shippingAddressstate", "label=Hawaii"); quality.Type("id=shippingAddresszipPostal", ""); quality.Type("id=shippingAddresszipPostal", "96720"); quality.Type("id=shippingAddressphone", ""); quality.Type("id=shippingAddressphone", "000-555-1212"); quality.Click("id=continueBtn"); quality.WaitForPageToLoad("30000"); // comment: Check that the "Billing Address" page is displayed if (ken.CheckForTimeOut("Edit", "link=Edit", 61)) { } quality.AreEqual("Edit", quality.GetText("link=Edit")); quality.AreEqual("Shipping Address", quality.GetText("css=h2")); quality.AreEqual("Billing Address", quality.GetText("css=fieldset > div.formHead > h2")); quality.AreEqual("Payment Information", quality.GetText("css=#payment-information > fieldset > div.formHead > h2")); quality.AreEqual("Place Secure Order", quality.GetText("id=submitOrder")); // comment: Go back to Cart and remove the product quality.AreEqual("Back to Cart", quality.GetText("id=cancelBtn")); quality.Click("css=a.margin-l5"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Shopping Cart", quality.GetTitle()); try { quality.IsTrue(quality.IsTextPresent("remove")); } catch (Exception) { failedcheck++; quality.ErrorReport("remove not found", CheckType.Text); } quality.Click("link=remove"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Shopping Cart", quality.GetTitle()); quality.AreEqual("Your Shopping Cart is currently empty", quality.GetText("css=div.cartEmpty")); ken.Logout(); }
//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("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.DeviceSelectionPage(); quality.Select("id=headUnitRegionFilter", "label=All"); quality.WaitForPageToLoad("30000"); quality.Select("id=headUnitRegionFilter", "label=Europe"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Select a Model", quality.GetTitle()); //comment: Select the same device like the one from the XML quality.Click("link=DNX5220"); try { selenium.Click("link=DNX5220"); } catch (Exception) { } quality.WaitForPageToLoad("30000"); ken.ProductUpdatesPage(true); // comment: Click on "Real-Time Traffic" button quality.Click("//div[@id='productUpdates']/a[2]/div/div/div"); quality.WaitForPageToLoad("30000"); ken.TrafficSubscriptionPage(); //comment: Click on the first traffic subscription (North America) quality.Click("css=div.text"); quality.WaitForPageToLoad("30000"); ken.TrafficServicesForkenwoodPage(); //comment: Click "Add to Cart" button without beeing logged-in quality.Click("css=a.button.left > span"); quality.WaitForPageToLoad("30000"); ken.SignInPage(); quality.Type("id=username", username); quality.Type("id=password", password); quality.Click("css=a.button"); quality.WaitForPageToLoad("30000"); //comment: Validate the "Add to Cart: Traffic Subscription" page ken.AddToCartTrafficVerification(false); //comment: Validate the "Add to Cart: Traffic Subscription" - do not enter any value and press the Continue btn quality.Click("link=Continue"); quality.WaitForPageToLoad("30000"); //quality.IsTextPresent("Traffic Receiver ID is required"); quality.IsTextPresent("Unit ID is required"); //comment: special characters for Unit ID quality.Type("id=unitId", "!@#$%@@%$$#@!$%#@!!$%$"); quality.Click("link=Continue"); quality.WaitForPageToLoad("30000"); //quality.AreEqual("Add to Cart: Traffic Verification", quality.GetTitle()); //quality.IsTextPresent("Traffic Receiver ID is required"); quality.IsTextPresent("Please enter a valid Unit ID"); //comment: special caracters for unit Id and traffic receivcer ID quality.Type("id=unitId", "!@#$%@@%$$#@!$%#@!!$%$"); //quality.Type("id=trafficReceiverId", "!@#$%@@%$$#@!$%#@!!$%$"); quality.Click("link=Continue"); quality.WaitForPageToLoad("30000"); //quality.AreEqual("Add to Cart: Traffic Verification", quality.GetTitle()); //quality.IsTextPresent("Please enter a valid Traffic Receiver ID"); quality.IsTextPresent("Please enter a valid Unit ID"); //comment: Type special characters for traffic receiver id quality.Type("id=unitId", ""); //quality.Type("id=trafficReceiverId", "!@#$%@@%$$#@!$%#@!!$%$"); quality.Click("link=Continue"); quality.WaitForPageToLoad("30000"); //quality.AreEqual("Add to Cart: Traffic Verification", quality.GetTitle()); //quality.IsTextPresent("Please enter a valid Traffic Receiver ID"); quality.IsTextPresent("Unit ID is required"); //comment: Type string characters for Unit ID quality.Type("id=unitId", "qweqrrqwerewqrwerweqrqwrwqrwrwq"); //quality.Type("id=trafficReceiverId", "qweqrrqwerewqrwerweqrqwrwqrwrwq"); quality.Click("link=Continue"); quality.WaitForPageToLoad("30000"); //quality.AreEqual("Add to Cart: Traffic Verification", quality.GetTitle()); //quality.IsTextPresent("Please enter a valid Traffic Receiver ID"); quality.IsTextPresent("Please enter a valid Unit ID"); //comment: Type invalid values for Unit ID and Traffic Receiver ID quality.Type("id=unitId", "-1"); //quality.Type("id=trafficReceiverId", "-1"); quality.Click("link=Continue"); quality.WaitForPageToLoad("30000"); // quality.AreEqual("Add to Cart: Traffic Verification", quality.GetTitle()); quality.IsTextPresent("The Unit ID you entered is not valid"); //quality.AreEqual("The Traffic Receiver ID you entered is not valid", quality.GetText("//div[@id='bd']/ul/li[2]")); //comment: Type a valid a Traffic Receiver ID and press "Continue" without a Unit ID quality.Type("id=unitId", ""); //quality.Type("id=trafficReceiverId", unitIdNotRegistered); quality.Click("link=Continue"); quality.WaitForPageToLoad("30000"); // quality.AreEqual("Add to Cart: Traffic Verification", quality.GetTitle()); quality.IsTextPresent("Unit ID is required"); //comment: Type a valid Unit Id and a valid traffic receiver id which is registered to another user account quality.Type("id=unitId", ""); //quality.Type("id=trafficReceiverId", ""); quality.Type("id=unitId", unitIdRegistered); //quality.Type("id=trafficReceiverId", unitIdRegistered); quality.Click("link=Continue"); quality.WaitForPageToLoad("30000"); //quality.AreEqual("Add to Cart: Traffic Verification", quality.GetTitle()); quality.IsTextPresent("This device is currently registered to another user account"); //quality.AreEqual("This traffic receiver is currently registered to another user account", quality.GetText("//div[@id='bd']/ul/li[2]")); //comment: Type a valid Unit ID and leave empty the Traffic Receiver ID quality.Type("id=unitId", unitIdNotRegistered); //quality.Type("id=trafficReceiverId", ""); quality.Click("link=Continue"); quality.WaitForPageToLoad("30000"); //quality.AreEqual("Add to Cart: Traffic Verification", quality.GetTitle()); //quality.IsTextPresent("Traffic Receiver ID is required"); //ken.AddToCartTrafficVerification(quality, false); //ken.ShoppingCartWithTrafficSubscriptionToBuy(true); ken.Logout(); }
//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("link=Sign In"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Sign In", quality.GetTitle()); ken.Login(username, password, fullname, false); //comment: Click on "Update" button from the "Product Updates" panel quality.Click("css=a.button > span"); quality.WaitForPageToLoad("30000"); ken.DeviceSelectionPage(); quality.Select("id=headUnitRegionFilter", "label=All"); quality.WaitForPageToLoad("30000"); quality.Select("id=headUnitRegionFilter", "label=Europe"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Select a Model", quality.GetTitle()); //comment: Select a device quality.Click("link=DNX7220"); quality.WaitForPageToLoad("30000"); ken.ProductUpdatesPage(true); // comment: Click on "Real-Time Traffic" button quality.Click("//div[@id='productUpdates']/a[2]/div/div/div"); quality.WaitForPageToLoad("30000"); //comment: Check the "Real traffic Subscription" ken.TrafficSubscriptionPage(); //comment: Click on the first traffic subscription (North America) quality.Click("css=div.text"); quality.WaitForPageToLoad("30000"); ken.TrafficServicesForkenwoodPage(); //comment: Click "Add to Cart" button without beeing logged-in quality.Click("css=a.button.left > span"); quality.WaitForPageToLoad("30000"); //comment: Validate the "Add to Cart: Traffic Subscription" page ken.AddToCartTrafficVerification(true); // comment: Type a Valid Unit ID quality.Type("id=unitId", ""); quality.Type("id=unitId", "3422110080"); quality.Click("//form[@id='verifyTrafficForm']/table/tbody/tr[5]/td/a[2]/span"); quality.WaitForPageToLoad("30000"); ken.ShoppingCartWithTrafficSubscriptionToBuy(true); // comment: Click the "Checkout" button quality.Click("//form[@id='shoppingCartForm']/div[2]/div[4]/a[2]/span"); quality.WaitForPageToLoad("30000"); quality.Select("id=shippingAddresscountry", "label=United States"); ken.CheckOutPage(); //comment: Empty all the requiered fields and press the "Continue" button quality.Type("id=shippingAddressfirstName", ""); quality.Type("id=shippingAddresslastName", ""); quality.Select("id=shippingAddresscountry", "label=Select a Country/Region"); quality.Type("id=shippingAddressaddress1", ""); quality.Type("id=shippingAddressaddress2", ""); quality.Type("id=shippingAddresscity", ""); quality.Select("id=shippingAddressstate", "label=Select a State/Province"); quality.Type("id=shippingAddresszipPostal", ""); quality.Type("id=shippingAddresszipPostal", ""); quality.Type("id=shippingAddressphone", ""); quality.Type("id=shippingAddressphone", ""); quality.Click("id=continueBtn"); if (ken.CheckForTimeOut("This field is required.", "css=div.alert > span", 61)) { failedcheck++; } quality.AreEqual("This field is required.", quality.GetText("css=div.alert > span")); quality.AreEqual("This field is required.", quality.GetText("css=#shippingAddress-last-name > div.formAlert > div.alert > span")); quality.AreEqual("This field is required.", quality.GetText("css=#shippingAddress-country-region > div.formAlert > div.alert > span")); quality.AreEqual("This field is required.", quality.GetText("css=#shippingAddress-address-line-1 > div.formAlert > div.alert > span")); quality.AreEqual("This field is required.", quality.GetText("css=#shippingAddress-city > div.formAlert > div.alert > span")); quality.AreEqual("This field is required.", quality.GetText("css=#shippingAddress-state-province > div.formAlert > div.alert > span")); quality.AreEqual("This field is required.", quality.GetText("css=#shippingAddress-zip-postal-code > div.formAlert > div.alert > span")); quality.AreEqual("This field is required.", quality.GetText("css=#shippingAddress-phone > div.formAlert > div.alert > span")); // comment: State doesn't match the the zip code quality.Type("id=shippingAddressfirstName", "ABC Tester"); quality.Type("id=shippingAddresslastName", "EFG Tester"); quality.Select("id=shippingAddresscountry", "label=Select a Country/Region"); quality.Select("id=shippingAddresscountry", "label=United States"); quality.Type("id=shippingAddressaddress1", "lololol tester's address"); quality.Type("id=shippingAddressaddress2", "qwerty tester's address"); quality.Type("id=shippingAddresscity", "HILO"); quality.Select("id=shippingAddressstate", "label=Idaho"); quality.Type("id=shippingAddresszipPostal", ""); quality.Type("id=shippingAddresszipPostal", "96720"); quality.Type("id=shippingAddressphone", ""); quality.Type("id=shippingAddressphone", "789-555-888824"); quality.Click("id=continueBtn"); if (ken.CheckForTimeOut("State does not match zip/postal code.", "css=#shippingAddress-state-province > div.formAlert > div.alert > span", 61)) { failedcheck++; } quality.AreEqual("State does not match zip/postal code.", quality.GetText("css=#shippingAddress-state-province > div.formAlert > div.alert > span")); // comment: Zip code is not valid quality.Type("id=shippingAddressfirstName", "ABC Tester"); quality.Type("id=shippingAddresslastName", "EFG Tester"); quality.Select("id=shippingAddresscountry", "label=Select a Country/Region"); quality.Select("id=shippingAddresscountry", "label=United States"); quality.Type("id=shippingAddressaddress1", "lololol tester's address"); quality.Type("id=shippingAddressaddress2", "qwerty tester's address"); quality.Type("id=shippingAddresscity", ""); quality.Type("id=shippingAddresscity", "HILO"); quality.Select("id=shippingAddressstate", "label=Hawaii"); quality.Type("id=shippingAddresszipPostal", ""); quality.Type("id=shippingAddresszipPostal", "12356"); quality.Type("id=shippingAddressphone", ""); quality.Type("id=shippingAddressphone", "789-555-888824"); quality.Click("id=continueBtn"); if (ken.CheckForTimeOut("Zip/postal code is not valid.", "css=#shippingAddress-zip-postal-code > div.formAlert > div.alert > span", 61)) { failedcheck++; } quality.AreEqual("Zip/postal code is not valid.", quality.GetText("css=#shippingAddress-zip-postal-code > div.formAlert > div.alert > span")); //comment: Type the maximum values for First Name, Last Name (100 characters) & Address1, Address2(200 characters) & Phone (20 characters) & City (100 characters) quality.Type("id=shippingAddressfirstName", "FirstName TesterFirstName TesterFirstName TesterFirstName TesterFirstName TesterFirstName TesterFirs"); quality.Type("id=shippingAddresslastName", "FirstName TesterFirstName TesterFirstName TesterFirstName TesterFirstName TesterFirstName TesterFirs"); quality.Select("id=shippingAddresscountry", "label=Select a Country/Region"); quality.Select("id=shippingAddresscountry", "label=Hong Kong"); quality.Type("id=shippingAddressaddress1", "AddressLine1 tester's addressAddressLine1 tester's addressAddressLine1 tester's addressAddressLine1 tester's addressAddressLine1 tester's addressAddressLine1 tester's addressAddressLine1 tester's addr"); quality.Type("id=shippingAddressaddress2", "AddressLine1 tester's addressAddressLine1 tester's addressAddressLine1 tester's addressAddressLine1 tester's addressAddressLine1 tester's addressAddressLine1 tester's addressAddressLine1 tester's addr"); quality.IsTrue(quality.IsElementPresent("id=shippingAddressstate")); quality.Type("id=shippingAddresscity", "HILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILOHILO"); quality.Type("id=shippingAddresszipPostal", "12351235498456564546163112316984565645461631123163"); quality.Type("id=shippingAddressphone", "000-555-1212000-555-"); // comment: City doesn't match the the zip code quality.Type("id=shippingAddressfirstName", "ABC Tester"); quality.Type("id=shippingAddresslastName", "EFG Tester"); quality.Select("id=shippingAddresscountry", "label=Select a Country/Region"); quality.Select("id=shippingAddresscountry", "label=United States"); quality.Type("id=shippingAddressaddress1", "lololol tester's address"); quality.Type("id=shippingAddressaddress2", "qwerty tester's address"); quality.Type("id=shippingAddresscity", "Cluj"); quality.Select("id=shippingAddressstate", "label=Alaska"); quality.Type("id=shippingAddresszipPostal", ""); quality.Type("id=shippingAddresszipPostal", "99515"); quality.Type("id=shippingAddressphone", ""); quality.Type("id=shippingAddressphone", "789-555-888824"); quality.Click("id=continueBtn"); if (ken.CheckForTimeOut("City does not match zip/postal code. Please select a city from the list, or continue with the city you entered.", "css=#shippingAddress-city > div.formAlert > div.alert > span", 61)) { failedcheck++; } quality.AreEqual("City does not match zip/postal code. Please select a city from the list, or continue with the city you entered.", quality.GetText("css=#shippingAddress-city > div.formAlert > div.alert > span")); // comment: Go back to Cart and remove the product quality.AreEqual("Back to Cart", quality.GetText("id=cancelBtn")); quality.Click("css=a.margin-l5"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Shopping Cart", quality.GetTitle()); try { quality.IsTrue(quality.IsTextPresent("remove")); } catch (Exception) { failedcheck++; } quality.Click("link=remove"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Shopping Cart", quality.GetTitle()); quality.AreEqual("Your Shopping Cart is currently empty", quality.GetText("css=div.cartEmpty")); ken.Logout(); }