//To Do: Feed URL's public HomePage(WebDriverBackedSelenium webdriver, ParentTest test) { driver = webdriver; usStoreURL = test.baseURL; ukStoreURL = test.baseURL; //prod doesn't have a separate address for foreign languages beStoreURL = test.baseURL; digitalStoreURL = test.baseURL;//prod doesn't have a separate address for foreign languages dutchCategories = new string[3]; frenchCategories = new string[3]; driver.Open(usStoreURL); quality = new QualityCheck(test); Thread.Sleep(2000); searchInputText = driver.UnderlyingWebDriver.FindElement(By.Id("searchbox")); //By.XPath("//div[@id='search']//input[@name='keyWords']")); searchButton = driver.UnderlyingWebDriver.FindElement(By.ClassName("searchbutton")); //By.XPath("//div[@id='search']//input[@value='search']")); wishlistLink = driver.UnderlyingWebDriver.FindElement(By.LinkText("my cart")); //wishlistLink = driver.UnderlyingWebDriver.FindElement(By.LinkText("wish list")); //categoryDiv = driver.UnderlyingWebDriver.FindElement(By.Id("wrapper")); categoryDiv = driver.UnderlyingWebDriver.FindElement(By.Id("checkin")); //Investigate reworking URL's /* properties = SeleniumPropertyManager.getInstance(); usStoreURL = properties.getProperty("selenium.session.baseurl.us"); ukStoreURL = properties.getProperty("selenium.session.baseurl.uk"); beStoreURL = properties.getProperty("selenium.session.baseurl.be"); digitalStoreURL = properties.getProperty("selenium.session.baseurl.digital"); */ }
public BrowserStateTest(string url, WebDriverBackedSelenium webdriver, StringBuilder verrors) { base.id = "Browser State Test"; base.baseURL = url; base.selenium = webdriver; base.verificationErrors = verrors; }
public BillingAddressPage(WebDriverBackedSelenium webdriver, ParentTest test) { driver = webdriver; //continueButton = driver.UnderlyingWebDriver.FindElement(By.ClassName("checkout-button")); addressTable = new List<IWebElement>(); quality = new QualityCheck(test); }
public SingleSignOnTest(string url, WebDriverBackedSelenium webdriver, StringBuilder verrors) { base.id = "Single SignOn Test"; base.baseURL = url; base.selenium = webdriver; base.verificationErrors = verrors; }
public ConnectUtility(ParentTest test) { selenium = test.selenium; baseurl = test.baseURL; quality = test.quality; currenttest = test; }
public RegisterUserTest(string url, WebDriverBackedSelenium webdriver, StringBuilder verrors) { base.id = "Register User Test"; base.baseURL = url; base.selenium = webdriver; base.verificationErrors = verrors; }
public void beforeClass() { Driver = new FirefoxDriver(); Selenium = new WebDriverBackedSelenium(Driver, Utils.baseUrl); Selenium.Start(); Selenium.WindowMaximize(); }
public KenwoodFunctions(QualityCheck quality, WebDriverBackedSelenium driver) { var = Environment.GetEnvironmentVariable("locale"); selenium = quality; seleniumdriver = driver; browser = Environment.GetEnvironmentVariable("browser"); }
//To Do: Rework verification public Header(WebDriverBackedSelenium webdriver, ParentTest test) { driver = webdriver; /* headerDiv = driver.UnderlyingWebDriver.FindElement(By.LinkText("my account")); accountLink_US_UK = driver.UnderlyingWebDriver.FindElement(By.LinkText("nl_Votre compte")); accountLink_BE = driver.UnderlyingWebDriver.FindElement (By.XPath("//div[@id='account']/div/a[contains(@href, 'view-cart.ep')]")); */ en_headerText_CustomerLoggedIn = new string[3]; en_headerText_CustomerNotLoggedIn = new string[3]; fr_headerText_CustomerLoggedIn = new string[3]; fr_headerText_CustomerNotLoggedIn = new string[3]; du_headerText_CustomerLoggedIn = new string[4]; du_headerText_CustomerNotLoggedIn = new string[3]; en_headerText_CustomerNotLoggedIn[0] = "items in my cart"; en_headerText_CustomerNotLoggedIn[1] = "my account"; en_headerText_CustomerNotLoggedIn[2] = "wish list"; du_headerText_CustomerNotLoggedIn[0] = "nl_articles dans votre panier"; du_headerText_CustomerNotLoggedIn[1] = "nl_Votre compte"; du_headerText_CustomerNotLoggedIn[2] = "nl_Vos envies cadeaux"; fr_headerText_CustomerNotLoggedIn[0] = "articles dans votre panier"; fr_headerText_CustomerNotLoggedIn[1] = "Votre compte"; fr_headerText_CustomerNotLoggedIn[2] = "Vos envies cadeaux"; en_headerText_CustomerLoggedIn[0] = "items in my cart"; en_headerText_CustomerLoggedIn[1] = "my account"; en_headerText_CustomerLoggedIn[2] = "wish list"; //properties = SeleniumPropertyManager.getInstance(properties); //These will be set up separately //browser = properties.getProperty(); quality = new QualityCheck(test); }
public DeliveryOptionsPage(WebDriverBackedSelenium webdriver, ParentTest test) { driver = webdriver; /* continueBtn = driver.UnderlyingWebDriver.FindElement(By.ClassName("checkout-button")); */ quality = new QualityCheck(test); }
public ShippingAddressPage(WebDriverBackedSelenium webdriver, ParentTest test) { driver = webdriver; quality = new QualityCheck(test); /* newAddressOption = driver.UnderlyingWebDriver.FindElement(By.Id("newAddressRadio")); */ }
public MyGarmin_SignIn(string url, WebDriverBackedSelenium webdriver, StringBuilder verrors) { //****Enter in Script Name here**** base.id = "MyGarmin Sign In"; base.baseURL = url; base.selenium = webdriver; base.verificationErrors = verrors; }
public Buy_PurchaseTest(string url, WebDriverBackedSelenium webdriver, StringBuilder verrors) { //****Enter in Script Name here**** base.id = "Buy Purchase Test!!!"; base.baseURL = url; base.selenium = webdriver; base.verificationErrors = verrors; }
public CartPage(WebDriverBackedSelenium webdriver, ParentTest test) { driver = webdriver; /* checkoutBtn = driver.UnderlyingWebDriver.FindElement(By.Name("cartCheckout")); */ quality = new QualityCheck(test); }
public CreateAddressPage(Customer consumer, WebDriverBackedSelenium webdriver, ParentTest test) { driver = webdriver; this.customer = consumer; address = new Address(customer); customer.setAddress(address); quality = new QualityCheck(test); }
public ManageAccountPage(WebDriverBackedSelenium webdriver, ParentTest test) { driver = webdriver; quality = new QualityCheck(test); /* addAddressBtn_US_UK= driver.UnderlyingWebDriver.FindElement(By.XPath("//input[@value='Add Address']")); addAddressBtn_BE = driver.UnderlyingWebDriver.FindElement(By.XPath("//input[@value='nl_Ajouter Addresse']")); */ }
public SignInPage(WebDriverBackedSelenium webdriver, ParentTest test) { driver = webdriver; quality = new QualityCheck(test); /* accountDiv = driver.UnderlyingWebDriver.FindElement(By.Id("login-state-default")); registerButton = driver.UnderlyingWebDriver.FindElement(By.XPath("//div[@class='fieldset-footer']/input[@value='Register']")); registerButton_BE = driver.UnderlyingWebDriver.FindElement(By.XPath("//div[@class='fieldset-footer']/input[@value='nl_Registre']")); */ }
public Kenwood_Navigation(string url, WebDriverBackedSelenium webdriver, StringBuilder verrors) { //****Enter in Script Name here**** base.id = "Kenwood Navigation"; //Enter Test Name base.baseURL = url; //Be sure to update the selenium.Open command with baseURL base.selenium = webdriver; base.verificationErrors = verrors; base.quality = new QualityCheck(this); base.description = "**Place your description of the test purpose here for more clarity in reporting**"; }
public ProductPage(WebDriverBackedSelenium webdriver, ParentTest test) { driver = webdriver; /* price = driver.UnderlyingWebDriver.FindElement(By.Id("lowestPrice")); addToCartBtn = driver.UnderlyingWebDriver.FindElement(By.Id("addToCartSubmit")); productSku = driver.UnderlyingWebDriver.FindElement(By.Id("productSku")); */ qualtiy = new QualityCheck(test); }
public ConnectSignIn(string url, WebDriverBackedSelenium webdriver, StringBuilder verrors) { //****Enter in Script Name here**** base.id = "ConnectSignIn"; //Enter Test Name base.baseURL = url; //Be sure to update the selenium.Open command with baseURL base.selenium = webdriver; base.verificationErrors = verrors; base.quality = new QualityCheck(this); base.description = "**A simple Sign In test**"; }
public Connect_ManualActivity_DescriptionLimit(string url, WebDriverBackedSelenium webdriver, StringBuilder verrors) { //****Enter in Script Name here**** base.id = "Connect_ManualActivity_DescriptionLimit"; //Enter Test Name base.baseURL = url; //Be sure to update the selenium.Open command with baseURL base.selenium = webdriver; base.verificationErrors = verrors; base.quality = new QualityCheck(this); base.description = "**Check the validation limit of 2000 characters**"; utility = new ConnectUtility(this); }
public Kenwood_CheckEach_Other_DeviceType_fortheProductUpdates(string url, WebDriverBackedSelenium webdriver, StringBuilder verrors) { //****Enter in Script Name here**** base.id = "CheckEach_Other_DeviceType_fortheProductUpdates"; //Enter Test Name base.baseURL = url; //Be sure to update the selenium.Open command with baseURL base.selenium = webdriver; base.verificationErrors = verrors; base.quality = new QualityCheck(this); base.description = "**CheckEach_Other_DeviceType_fortheProductUpdates**"; ken = new KenwoodFunctions(quality, selenium); }
public Kenwood_ForgotUsername_ValidationTest(string url, WebDriverBackedSelenium webdriver, StringBuilder verrors) { //****Enter in Script Name here**** base.id = "Forgot Username Validation"; //Enter Test Name base.baseURL = url; //Be sure to update the selenium.Open command with baseURL base.selenium = webdriver; base.verificationErrors = verrors; base.quality = new QualityCheck(this); ken = new KenwoodFunctions(quality, selenium); base.description = "**Validate Forgot username functions**"; }
public Kenwood_MyAccount_TrafficSubscriptions_ActivateSubscriptionTest(string url, WebDriverBackedSelenium webdriver, StringBuilder verrors) { //****Enter in Script Name here**** base.id = "MyAccount_TrafficSubscriptions_ActivateSubscriptionTest"; //Enter Test Name base.baseURL = url; //Be sure to update the selenium.Open command with baseURL base.selenium = webdriver; base.verificationErrors = verrors; base.quality = new QualityCheck(this); base.description = "**Check to ensure subscription works**"; ken = new KenwoodFunctions(quality, selenium); }
public TheKenwood_CreateAccount_NewUserTest(string url, WebDriverBackedSelenium webdriver, StringBuilder verrors) { //****Enter in Script Name here**** base.id = "Create New User"; //Enter Test Name base.baseURL = url; //Be sure to update the selenium.Open command with baseURL base.selenium = webdriver; base.verificationErrors = verrors; base.quality = new QualityCheck(this); base.description = "**Validates creating a new account**"; ken = new KenwoodFunctions(quality, selenium); }
public Kenwood_ScanSD_CheckLatestMap_DeviceRequieresUpdates_DNX9980_Validation(string url, WebDriverBackedSelenium webdriver, StringBuilder verrors) { //****Enter in Script Name here**** base.id = "ScanSD_CheckLatestMap_DeviceRequieresUpdates_DNX9980_Validation"; //Enter Test Name base.baseURL = url; //Be sure to update the selenium.Open command with baseURL base.selenium = webdriver; base.verificationErrors = verrors; base.quality = new QualityCheck(this); base.description = "**Kenwood_ScanSD_CheckLatestMap_DeviceRequieresUpdates_DNX9980_Validation**"; ken = new KenwoodFunctions(quality, selenium); }
public Kenwood_NoScanSD_CheckAddToCart_TrafficService_UserNotLogged_Validation(string url, WebDriverBackedSelenium webdriver, StringBuilder verrors) { //****Enter in Script Name here**** base.id = "NoScanSD_CheckAddToCart_TrafficService_UserNotLogged_Validation"; //Enter Test Name base.baseURL = url; //Be sure to update the selenium.Open command with baseURL base.selenium = webdriver; base.verificationErrors = verrors; base.quality = new QualityCheck(this); base.description = "**NoScanSD_CheckAddToCart_TrafficService_UserNotLogged_Validation**"; ken = new KenwoodFunctions(quality, selenium); }
public Kenwood_OrderSummary_check(string url, WebDriverBackedSelenium webdriver, StringBuilder verrors) { //****Enter in Script Name here**** base.id = "OrderSummary_check"; //Enter Test Name base.baseURL = url; //Be sure to update the selenium.Open command with baseURL base.selenium = webdriver; base.verificationErrors = verrors; base.quality = new QualityCheck(this); base.description = "**OrderSummary_check**"; ken = new KenwoodFunctions(quality, selenium); }
public Kenwood_ScanSD_CheckTheSoftwareUpdates_FirmwareValidation(string url, WebDriverBackedSelenium webdriver, StringBuilder verrors) { //****Enter in Script Name here**** base.id = "ScanSD_CheckTheSoftwareUpdates_FirmwareValidation"; //Enter Test Name base.baseURL = url; //Be sure to update the selenium.Open command with baseURL base.selenium = webdriver; base.verificationErrors = verrors; base.quality = new QualityCheck(this); base.description = "**ScanSD and Check for Software updates/Firmware Validation**"; ken = new KenwoodFunctions(quality, selenium); }
public Connect_CheckFirmware_FR405CX(string url, WebDriverBackedSelenium webdriver, StringBuilder verrors) { //****Enter in Script Name here**** base.id = "CheckFirmware_FR405CX"; //Enter Test Name base.baseURL = url; //Be sure to update the selenium.Open command with baseURL base.selenium = webdriver; base.verificationErrors = verrors; base.quality = new QualityCheck(this); base.description = "**Create a user, upload a file from an FR405CX and check for the firmware update notice**"; utility = new ConnectUtility(this); }
static void Main(string[] args) { try { string baseUrl = "http://www.amazon.com/"; if (args.Length >= 1) { baseUrl = args[0]; } string filename; if (args.Length >= 2) { filename = args[1]; } else { Uri uri = new Uri(baseUrl); filename = uri.Host.Replace(".", "-") + @".har"; } // Uncomment to enable SSL support // Fiddler.CONFIG.IgnoreServerCertErrors = true; // FiddlerApplication.Prefs.SetBoolPref("fiddler.network.streaming.abortifclientaborts", true); // Varibale to store the list of items downloaded var sessions = new List <Fiddler.Session>(); var newSessions = new List <Fiddler.Session>(); int browserProcessId = -1; // As each HTTP item is downloaded add it to our list. // We will export this list later. Fiddler.FiddlerApplication.AfterSessionComplete += delegate(Fiddler.Session oS) { Monitor.Enter(sessions); // Only record HTTP traffic by our browser process if (browserProcessId == oS.LocalProcessID) { sessions.Add(oS); } Monitor.Exit(sessions); }; Fiddler.FiddlerApplication.BeforeRequest += delegate(Fiddler.Session oS) { // Record the process id for the first URL we go to, // this is the browser that we lanched with Selenium // Could also do extra verification here, for example // check that it is a child process, of this process. // That requires some heavy Win32 API usage, so I've // skipped it here. if (browserProcessId == -1 && oS.fullUrl == baseUrl) { browserProcessId = oS.LocalProcessID; } // Only record HTTP traffic by our browser process if (browserProcessId == oS.LocalProcessID) { Monitor.Enter(newSessions); newSessions.Add(oS); Monitor.Exit(newSessions); } }; // Start Fiddler on port 8877. // Register as the system wide proxy. Fiddler.FiddlerApplication.Startup(8877, FiddlerCoreStartupFlags.Default); ///////////////////////////////////////////////// // Begin selenium test ///////////////////////////////////////////////// var webDriver = new OpenQA.Selenium.Firefox.FirefoxDriver(); var selenium = new Selenium.WebDriverBackedSelenium(webDriver, baseUrl); selenium.Start(); selenium.Open(baseUrl); // Wait until 3 seconds of HTTP idle (no request being processed for 3 seconds) // or a 30 second timeout. // 'result' will be false if items are still being downloaded when the timeout // occurs. bool result = WaitHttpIdle(sessions, 3000, 30000); selenium.Stop(); ///////////////////////////////////////////////// // End selenium test ///////////////////////////////////////////////// // Load the HAR file exporter (this only has to be done once per process). // The following DLL was downloaded from: // https://www.fiddler2.com/dl/FiddlerCore-BasicFormats.zip // It is currently only loadable with FiddlerCode 2.2.9.9. String path = Path.Combine(Path.GetDirectoryName (Assembly.GetExecutingAssembly().Location), @"FiddlerCore-BasicFormats.dll"); FiddlerApplication.oTranscoders.ImportTranscoders(path); // Export fiddler sessions to HAR file Monitor.Enter(sessions); var oExportOptions = new Dictionary <string, object>(); oExportOptions.Add("Filename", filename); bool fiddler = Fiddler.FiddlerApplication.DoExport("HTTPArchive v1.2", sessions.ToArray(), oExportOptions, null); sessions.Clear(); Monitor.Exit(sessions); } finally { // Shutdown fiddler, this removes Fiddler as the system proxy. Fiddler.FiddlerApplication.Shutdown(); Thread.Sleep(500); } }
static void Main(string[] args) { try { string baseUrl = "http://www.webmetrics.com"; if (args.Length >= 1) { baseUrl = args[0]; } string filename; if (args.Length >= 2) { filename = args[1]; } else { Uri uri = new Uri(baseUrl); filename = uri.Host.Replace(".", "-") + @".har"; } // Uncomment to enable SSL support // Fiddler.CONFIG.IgnoreServerCertErrors = true; // FiddlerApplication.Prefs.SetBoolPref("fiddler.network.streaming.abortifclientaborts", true); // Varibale to store the list of items downloaded var sessions = new List <Fiddler.Session>(); // As each HTTP item is downloaded add it to our list. // We will export this list later. Fiddler.FiddlerApplication.AfterSessionComplete += delegate(Fiddler.Session oS) { Monitor.Enter(sessions); sessions.Add(oS); Monitor.Exit(sessions); }; // As each HTTP item is downloaded add it to our list. // We will export this list later. Fiddler.FiddlerApplication.BeforeRequest += delegate(Fiddler.Session oS) { if (!new Regex(baseUrl).IsMatch(oS.fullUrl)) { oS.utilCreateResponseAndBypassServer(); oS.responseCode = 200; } }; // Start Fiddler on port 8877. // Register as the system wide proxy. Fiddler.FiddlerApplication.Startup(8877, FiddlerCoreStartupFlags.Default); ///////////////////////////////////////////////// // Begin selenium test ///////////////////////////////////////////////// var webDriver = new OpenQA.Selenium.Firefox.FirefoxDriver(); var selenium = new Selenium.WebDriverBackedSelenium(webDriver, baseUrl); selenium.Start(); selenium.Open(baseUrl); selenium.WaitForPageToLoad("30000"); selenium.Stop(); ///////////////////////////////////////////////// // End selenium test ///////////////////////////////////////////////// // Load the HAR file exporter (this only has to be done once per process). // The following DLL was downloaded from: // https://www.fiddler2.com/dl/FiddlerCore-BasicFormats.zip // It is currently only loadable with FiddlerCode 2.2.9.9. String path = Path.Combine(Path.GetDirectoryName (Assembly.GetExecutingAssembly().Location), @"FiddlerCore-BasicFormats.dll"); FiddlerApplication.oTranscoders.ImportTranscoders(path); // Export fiddler sessions to HAR file Monitor.Enter(sessions); var oExportOptions = new Dictionary <string, object>(); oExportOptions.Add("Filename", filename); bool fiddler = Fiddler.FiddlerApplication.DoExport("HTTPArchive v1.2", sessions.ToArray(), oExportOptions, null); sessions.Clear(); Monitor.Exit(sessions); } finally { // Shutdown fiddler, this removes Fiddler as the system proxy. Fiddler.FiddlerApplication.Shutdown(); Thread.Sleep(500); } }