//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); ken.WelcomePage(); quality.Click("link=Sign In"); quality.WaitForPageToLoad("30000"); //comment: Go to Sing In page ken.SignInPage(); ken.SignIn("asdfgh", "qasdasdfsfgsd"); // comment: Insert any username and password quality.AreEqual("Sign In", selenium.GetTitle()); quality.AreEqual("The username/password combination is not valid", selenium.GetText("css=ul.error > li")); // comment: Enter only username ken.SignIn("qwerty", ""); quality.AreEqual("Sign In", selenium.GetTitle()); quality.AreEqual("Password is required to login", selenium.GetText("css=ul.error > li")); // comment: Sign in without entering any information ken.SignIn("", ""); quality.AreEqual("Sign In", selenium.GetTitle()); quality.AreEqual("Username is required to login", selenium.GetText("css=ul.error > li")); quality.AreEqual("Password is required to login", selenium.GetText("//div[@id='bd']/ul/li[2]")); // comment: Enter only password ken.SignIn("", "asfdsffgdfgs"); quality.AreEqual("Sign In", selenium.GetTitle()); quality.AreEqual("Username is required to login", selenium.GetText("css=ul.error > li")); // comment: Enter more than 25 characters in both fields ken.SignIn("as!@#!@# 21sasdasdasadasdadaaasdadassasdasdasadasdadaaasdad\\\\", "as!@#!@# 21sasdasdasadasdadaaasdadassasdasdasadasdadaaasdad\\\\"); quality.AreEqual("Sign In", selenium.GetTitle()); quality.AreEqual("Username is invalid", selenium.GetText("css=ul.error > li")); quality.AreEqual("Password is invalid", selenium.GetText("//div[@id='bd']/ul/li[2]")); // comment: Insert less than 25 characters in both fields ken.SignIn("as!@#!@# 21sasdasdasad", "as!@#!@# 21sasdasdasad"); quality.AreEqual("Sign In", selenium.GetTitle()); quality.AreEqual("The username/password combination is not valid", selenium.GetText("css=ul.error > li")); // comment: Click on Forgot Username link quality.Click("link=Forgot username"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Forgot Username", selenium.GetTitle()); quality.AreEqual("Forgot Username", selenium.GetText("css=div.titleHeader-text")); quality.AreEqual("To retrieve your username, enter the email address that you saved in your myGarmin account. If you did not save an email address in your account or you do not remember it, please contact Product Support.", selenium.GetText("css=p.prompt")); quality.AreEqual("Product Support", quality.GetText("link=Product Support")); quality.AreEqual("Email Address", selenium.GetText("css=div.inputIndicator-text")); quality.AreEqual("", selenium.GetText("id=email")); quality.AreEqual("Submit", selenium.GetText("css=a.button > span")); // comment: Go Back to Sign in page quality.Click("link=Sign In"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Sign In", selenium.GetTitle()); // comment: Click on Forgot Password selenium.Click("link=Forgot password"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Forgot Password", selenium.GetTitle()); quality.AreEqual("Forgot Password", selenium.GetText("css=div.titleHeader-text")); quality.AreEqual("To reset your password, enter the username of your myGarmin account. If you do not remember your username, please contact Product Support.", selenium.GetText("css=p.prompt")); quality.AreEqual("Product Support", quality.GetText("link=Product Support")); quality.AreEqual("Username", selenium.GetText("css=div.inputIndicator-text")); //quality.AreEqual("", selenium.GetValue("css=div.inputIndicator-text")); quality.AreEqual("Submit", selenium.GetText("css=a.button > span")); // comment: Go Back to Sign in page quality.Click("link=Sign In"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Sign In", selenium.GetTitle()); // comment: Click on Create Account button quality.Click("css=div.left > a.button > span"); quality.WaitForPageToLoad("30000"); ken.CreateAccountPage(); // comment: Go Back to Sign in page quality.Click("link=Sign In"); quality.WaitForPageToLoad("30000"); quality.AreEqual("Sign In", selenium.GetTitle()); // comment: Enter more than 25 characters in User Name and nothing for password ken.SignIn("as!@#!@# 21sasdasdasadasdadaaasdadassasdasdasadasdadaaasdad\\\\", ""); quality.AreEqual("Sign In", selenium.GetTitle()); quality.AreEqual("Username is invalid", selenium.GetText("css=ul.error > li")); quality.AreEqual("Password is required to login", selenium.GetText("//div[@id='bd']/ul/li[2]")); // comment: Enter more than 25 characters in password field and nothing for User Name ken.SignIn("", "as!@#!@# 21sasdasdasadasdadaaasdadassasdasdasadasdadaaasdad\\\\"); quality.AreEqual("Sign In", selenium.GetTitle()); quality.AreEqual("Username is required to login", selenium.GetText("css=ul.error > li")); quality.AreEqual("Password is invalid", selenium.GetText("//div[@id='bd']/ul/li[2]")); // comment: Enter valid credentials ken.Login(username, password, fullname, false); // comment: SignOut ken.Logout(); }