// [Test, Description("DepartmentPlan")] public void TC08_DepartmentPlanTest() { VersionConrol._initTestData(TestContext.CurrentContext.Test.MethodName); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.StartTime.ToString(), VersionConrol.getTimeStamp()); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.ApplictionName.ToString(), "DepartmentPlan"); launchApplication(); string qtpversion = getAppVersion(); Reporter.ReportEvent("DepartmentPlan Version: ", qtpversion); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.Version.ToString(), qtpversion); VersionConrol.addApplication("DepartmentPlan", qtpversion); clickFile(); selectSection(); selectPLanLevel(); selectSeason(); clickGo(); waitSomeTime(20); selectableProductGrid(); waitSomeTime(3); dataConfirmation(); createPlan(); Console.WriteLine("Success"); waitSomeTime(10); app.DepartmentPlanWindow.Close(); }
// [Test, Description("VPS Flow")] public void TC10_VPS_Flow() { string SeasonToBeSelected = "5-2017"; var sdept = "1111"; VersionConrol._initTestData(TestContext.CurrentContext.Test.MethodName); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.StartTime.ToString(), VersionConrol.getTimeStamp()); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.ApplictionName.ToString(), "VPS"); launchapp(); string qtpversion = getAppVersion(); Reporter.ReportEvent("VPS Version: ", qtpversion); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.Version.ToString(), qtpversion); VersionConrol.addApplication("VPS", qtpversion); var defaultSeason = AppObj.VPSWindow.BoardcardExplorerWindow.PlanningSeason.GetVisibleText(); if (SeasonToBeSelected == defaultSeason) { AppObj.VPSWindow.BoardcardExplorerWindow.PlanningSeason.Click(); Keyboard.SendString(SeasonToBeSelected); Keyboard.SendString(SeasonToBeSelected); } AppObj.VPSWindow.BoardcardExplorerWindow.PlanningSeason.Click(); Keyboard.SendString(SeasonToBeSelected); Reporter.ReportEvent("Season Selection", "User selected seaon as 5-2017", HP.LFT.Report.Status.Passed); Thread.Sleep(1000); // var sdept = "1111"; var vNodes = AppObj.VPSWindow.BoardcardExplorerWindow.TreeDepartmentsList.NativeObject.Nodes[0].Nodes; var scount = vNodes.Count; // var scount = sNodemebers1.Nodes[0].Nodes.Count; Thread.Sleep(2000); bool bNodefound = false; for (int i = 0; i <= scount - 1; i++) { // sNodeName = appModel.HMOrderWindow.OrderExplorerWindow.UltraTreeDepartmentsUiObject.NativeObject.Nodes[0].Nodes[i].Key; var sNodeName = vNodes[i].Key; if (sNodeName == sdept) { AppObj.VPSWindow.BoardcardExplorerWindow.TreeDepartmentsList.NativeObject.Nodes[0].Nodes[i].Selected = true; //sNodemebers1.Nodes[0].Nodes[i].Selected = true; bNodefound = true; break; } } if (bNodefound == true) { Reporter.ReportEvent("VPS Department Node Selection", "1111 VPS Department Node Selected - ", HP.LFT.Report.Status.Passed); } else { Reporter.ReportEvent("VPS Department Node Selection", "1111 VPS Department Node Selected -", HP.LFT.Report.Status.Failed); } Thread.Sleep(16000); AppObj.VPSWindow.Close(); }
public void TearDown() { // Clean up after each test string result = TestContext.CurrentContext.Result.Outcome.ToString(); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.EndTime.ToString(), VersionConrol.getTimeStamp()); VersionConrol.addTestDataValue(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.TestResult.ToString(), result); }
// [Test, Category("FFRegression1")] public Boolean TC07_PercentAdminToolVerificaton() { bool finalResult = false; Initial_Setup("TC07_PercentAdminToolVerificaton"); VersionConrol._initTestData(TestContext.CurrentContext.Test.MethodName); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.StartTime.ToString(), VersionConrol.getTimeStamp()); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.ApplictionName.ToString(), "PercentPMAdminTool"); try { System.Environment.SetEnvironmentVariable("TestObjective", "This test case is to verify Percent admin tool."); //-------------------Launch URL---------------------------------------- // Driver.Navigate().GoToUrl(ConfigUtils.Read("PERCENTADMINTOOL_URL")); //------------------Core Test Case------------------------------------- POM_PercentageAdminTool pHomepage = new POM_PercentageAdminTool(BrowserName, Driver, logStack); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.Version.ToString(), pHomepage.versionInfo.GetAttribute("textContent")); VersionConrol._initTestData(pHomepage.versionInfo.GetAttribute("textContent")); Assert.IsTrue(pHomepage.PercentPMToolVerification(iExcel.ReadData(irownumber, "Season"), iExcel.ReadData(irownumber, "Brand"), iExcel.ReadData(irownumber, "SubIndex"), iExcel.ReadData(irownumber, "Department"), iExcel.ReadData(irownumber, "Version"))); test.Log(LogStatus.Pass, "PercentPMToolVerification", "<font color = 'green'><strong>PASS</strong> </font>"); //------------------------------ REPORTING----------------------------------------------------------- Generate_Report_And_Close_Browser("TC07_PercentAdminToolVerificaton"); finalResult = true; VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.TestResult.ToString(), "Pass"); return(finalResult); } catch (Exception e) { // Handle_Exception("TC08_PercentAdminToolVerificaton", ex.StackTrace); System.Environment.SetEnvironmentVariable("Endtime", DateTime.Now.ToString("yyyy:MM:dd_HH:mm:ss")); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.EndTime.ToString(), VersionConrol.getTimeStamp()); TestBase.sbrowsertype = System.Environment.GetEnvironmentVariable("Browser2"); TestBase.sTestName = stestcaseid; ReportCustom swriteresult = new ReportCustom(); swriteresult.WriteResults(stestcaseid, logStack, finalResult); Console.WriteLine("StackTrace from Test Class :" + e.StackTrace); Console.WriteLine("Message from Test Class" + e.Message); //stopVideoRecording(); TestBase.DriverCleardown = Driver; VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.TestResult.ToString(), "Fail"); return(finalResult); } }
// [Test] public void CreateArticle() { Process assortmentPlanProcess; assortmentPlanProcess = OpenApplication(); VersionConrol._initTestData("AssortmentPlan"); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.StartTime.ToString(), VersionConrol.getTimeStamp()); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.ApplictionName.ToString(), "AssortmentPlan"); string qtpversion = getAppVersion(); Reporter.ReportEvent("Assortment Plan Vesion: ", qtpversion); VersionConrol.addSubKey("AssortmentPlan", subKeys.keySet.Version.ToString(), qtpversion); VersionConrol.addApplication("Assortment Plan", qtpversion); assortmentPlanModel.APWindow.AddArticleButton.Highlight(); assortmentPlanModel.APWindow.AddArticleButton.Click(); Reporter.ReportEvent("Create Article", "Article Created Successfully", HP.LFT.Report.Status.Passed); CloseApplication(assortmentPlanProcess); VerifyCirrus(); }
// [Test] public void FenixFlow() { VersionConrol._initTestData(TestContext.CurrentContext.Test.MethodName); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.StartTime.ToString(), VersionConrol.getTimeStamp()); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.ApplictionName.ToString(), "Fenix"); string apppath = "C:\\Program Files (x86)\\H & M Hennes & Mauritz AB\\H & M Fenix Client\\HM.Plan.Fenix.exe"; var appname = FileVersionInfo.GetVersionInfo(apppath); var appver = appname.FileVersion; VersionConrol.addApplication("Fenix", appver); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.Version.ToString(), appver); //launch application Process process = Process.Start(apppath); if (app.ReadOnlySeasonWindow.Exists()) { app.ReadOnlySeasonWindow.OkButton.Click(); } app.FenixWindow.Highlight(); //var AT = app.FenixWindow.GetTextLocations("Assortment Triangle"); //int x = Convert.ToInt32((AT[0].Width) / 2.0 ) + app.FenixWindow.Location.X; //int y = Convert.ToInt32(AT[0].Height / 2.0 ) + app.FenixWindow.Location.Y; //Mouse.Click(new System.Drawing.Point(x, y)); app.FenixWindow.ForwardSeasonComboBox.Click(); app.FenixWindow.ForwardSeasonComboBox.Select(3); //app.FenixWindow.Div02PreEarlyCollection1926Button.Click(); //var treeviewtext = app.FenixWindow.SelectionTreeView.GetVisibleText(); //string depttoselect = "H&M.;Div 03 Ladies Everyday;Ladies Everyday"; //selectDepartment(depttoselect); app.FenixWindow.Close(); }
public void SetUp() { // Before each test VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.StartTime.ToString(), VersionConrol.getTimeStamp()); }
public Boolean TC06_MarketOptimizationAdminTool_FF() { bool finalResult = false; Initial_Setup("TC06_MarketOptimizationAdminTool_FF"); VersionConrol._initTestData(TestContext.CurrentContext.Test.MethodName); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.StartTime.ToString(), VersionConrol.getTimeStamp()); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.ApplictionName.ToString(), "MarketOptAdminTool"); try { System.Environment.SetEnvironmentVariable("TestObjective", "Test cases to check on environment testrunup."); //--------------------------------TEST DATA GENERATOR------------------------------------------------------------------------------------------- // TestDataGenerator testgen = new TestDataGenerator(BrowserName, Driver, logStack, iExcel.ReadData(irownumber, "ProductificationBuildStatus"), iExcel.ReadData(irownumber, "Season"), iExcel.ReadData(irownumber, "SeasoninYYYYMM"), iExcel.ReadData(irownumber, "PlanMarketcode")); //--------------------------------------------------------------------------------------------------------- POM_MarketOptimizationAdminToolPage moatpage = new POM_MarketOptimizationAdminToolPage(BrowserName, Driver, logStack); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.Version.ToString(), moatpage.versionInfo.GetAttribute("textContent")); VersionConrol.addApplication("MarketOptimizationAdminTool", moatpage.versionInfo.GetAttribute("textContent")); moatpage.gettabnames(); moatpage.clickManagetab(); moatpage.clickAddSection(); moatpage.clickDDButton(); moatpage.checkDivSection(); moatpage.clickDDButton(); moatpage.clickOKButton(); moatpage.clickSaveUpdateButton(); moatpage.clickSPPperTab(); moatpage.checkDIVSECinSPPPPER(); moatpage.clickBuyperTab(); moatpage.checkDIVSECinBUYPER(); //------------------------------ REPORTING----------------------------------------------------------- System.Environment.SetEnvironmentVariable("Endtime", DateTime.Now.ToString("yyyy:MM:dd_HH:mm:ss")); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.EndTime.ToString(), VersionConrol.getTimeStamp()); TestBase.sTestName = stestcaseid; ReportCustom swriteresult = new ReportCustom(); swriteresult.WriteResults(stestcaseid, logStack); TestBase.sbrowsertype = System.Environment.GetEnvironmentVariable("Browser1"); TestBase.DriverCleardown = Driver; //----------------------VIDEO RECORDING END-------------------------------- //stopVideoRecording(); //------------------------------------------------------------------------- finalResult = true; VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.TestResult.ToString(), "Pass"); return(finalResult); } catch (Exception e) { System.Environment.SetEnvironmentVariable("Endtime", DateTime.Now.ToString("yyyy:MM:dd_HH:mm:ss")); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.EndTime.ToString(), VersionConrol.getTimeStamp()); TestBase.sbrowsertype = System.Environment.GetEnvironmentVariable("Browser2"); TestBase.sTestName = stestcaseid; ReportCustom swriteresult = new ReportCustom(); swriteresult.WriteResults(stestcaseid, logStack, finalResult); Console.WriteLine("StackTrace from Test Class :" + e.StackTrace); Console.WriteLine("Message from Test Class" + e.Message); //stopVideoRecording(); TestBase.DriverCleardown = Driver; VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.TestResult.ToString(), "Fail"); return(finalResult); } }
//------------------------------------------------------------------------------------------------------------------------------------------------------------------ //[Test,Description("QPT Test")] public void TC09_QPTFlow() { //SDK.Init(new SdkConfiguration()); //Reporter.Init(new ReportConfiguration //{ // Title = "Execution Report", // Description = "Feasibility Test Results", // IsOverrideExisting = true, // ReportFolder = "TestResults", // ReportLevel = ReportLevel.All, // SnapshotsLevel = CaptureLevel.All, //}); try { VersionConrol._initTestData(TestContext.CurrentContext.Test.MethodName); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.StartTime.ToString(), VersionConrol.getTimeStamp()); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.ApplictionName.ToString(), "QPT"); var applaunchflag = launchApplication(); if (applaunchflag != 1) { string qtpversion = getAppVersion(); Reporter.ReportEvent("QTP Version: ", qtpversion); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.Version.ToString(), qtpversion); VersionConrol.addApplication("QPT", qtpversion); clickRadioButton("store"); string sSeasonDepartment = sSeason + ";" + sDepartment; selectDepartment(sSeasonDepartment); app.QptExplorerWindow.NewButton.Click(); string testName = getUniqueName(); app.NewFolderWindow.NameEditField.SetText(testName); app.NewFolderWindow.FolderDescription.SetText("Creating Folder for Automation Testing purpose"); app.NewFolderWindow.Save.Click(); waitSomeTime(3); string folderName = sSeasonDepartment + ";" + testName; selectDepartment(folderName); var men = app.QptExplorerWindow.NewMenu.BuildMenuPath("New;Store One.*"); waitSomeTime(2); var oMenu = app.QptExplorerWindow.QuantificationNewButton; oMenu.Click(); var IDProp = As.RegExp(@".*Two Seasons.*"); var sStoreOneQuantification = oMenu.Describe <IUiObject>(new UiObjectDescription { ObjectName = "Store One Season Quantification", FullNamePath = "Store One Season Quantification;Store One Season Quantification;PART_SubMenuScrollViewer;" }); var sStoreTwoQuantification = oMenu.Describe <IUiObject>(new UiObjectDescription { ObjectName = IDProp, FullNamePath = IDProp }); sStoreOneQuantification.Click(); app.NewQuantificationWindow.CreateButton.Click(); waitSomeTime(3); app.MainQuantificationWindowID.Click(); if (app.MainQuantificationWindowID.Exists()) { app.MainQuantificationWindowID.Level1TabControlTabStrip.Click(); int tabcount = app.MainQuantificationWindowID.Level1TabControlTabStrip.Tabs.Count; Console.WriteLine("tabcount: " + tabcount); app.MainQuantificationWindowID.SelectProductButton.Click(); try { if (app.QPTErrorWindow.Exists()) { Reporter.ReportEvent("Error Occured", " List is empty", Status.Failed); Environment.Exit(0); app.QPTErrorWindow.Close(); app.MainQuantificationWindowID.Close(); app.QptExplorerWindow.Close(); } } catch (Exception e) { Reporter.ReportEvent("Exceptopn", e.Message); } try { var itemscount = app.MainQuantificationWindowID.DepartmentsListBoxComboBox.Items[0].Count(); if (itemscount == 1) { Reporter.ReportEvent("Selected Department in product", " List is empty", Status.Failed); } }catch (Exception e) { Reporter.ReportEvent("Exceptopn", e.Message); } waitSomeTime(5); selectableProductGridChild(); app.MainQuantificationWindowID.QuantifyButton.Click(); waitSomeTime(10); // app.MainQuantificationWindowID.SaveButton.Highlight(); app.MainQuantificationWindowID.SaveButton.Click(); waitSomeTime(10); app.MainQuantificationWindowID.Level2TabControlTabStrip.Select("SE-01"); app.MainQuantificationWindowID.TimeHeaderTableUiObject.Highlight(); app.MainQuantificationWindowID.Close(); Reporter.ReportEvent("Test Name selected: ", testName); app.QptExplorerWindow.DeleteButton.Click(); app.DeleteQuantificationFolderWindow.YesButton.Click(); Reporter.ReportEvent(testName, " Deleted Successfully"); app.QptExplorerWindow.Close(); Reporter.ReportEvent("QTP application ", "closed successfully", Status.Passed); // Reporter.GenerateReport(); // SDK.Cleanup(); } else { return; } } }catch (HP.LFT.SDK.GeneralReplayException) { Reporter.ReportEvent("Exceptopn", Status.Failed.ToString()); } }
public static void createExcel456789() { VersionConrol.convertDicToDataTable(); }
public Boolean TC03_SellPriceTool_IE() { bool finalResult = false; Initial_Setup("TC03_SellPriceTool_IE"); VersionConrol._initTestData(TestContext.CurrentContext.Test.MethodName); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.StartTime.ToString(), VersionConrol.getTimeStamp()); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.ApplictionName.ToString(), "SellPriceTool"); try { System.Environment.SetEnvironmentVariable("TestObjective", "Test cases to check on environment testrunup."); //--------------------------------TEST DATA GENERATOR------------------------------------------------------------------------------------------- // TestDataGenerator testgen = new TestDataGenerator(BrowserName, Driver, logStack, iExcel.ReadData(irownumber, "ProductificationBuildStatus"), iExcel.ReadData(irownumber, "Season"), iExcel.ReadData(irownumber, "SeasoninYYYYMM"), iExcel.ReadData(irownumber, "PlanMarketcode")); //--------------------------------------------------------------------------------------------------------- POM_SellPriceToolPage Sptpage = new POM_SellPriceToolPage(BrowserName, Driver, logStack); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.Version.ToString(), Sptpage.versionInfo.GetAttribute("textContent")); VersionConrol.addApplication("SellPriceTool", Sptpage.versionInfo.GetAttribute("textContent")); Sptpage.selectFiscalTab(); Sptpage.selectingSeason(iExcel.ReadData(irownumber, "Season")); Sptpage.selectingBrand(iExcel.ReadData(irownumber, "Brand")); Sptpage.selectingChannel(iExcel.ReadData(irownumber, "Channel")); Sptpage.selectingFiscalCountry(iExcel.ReadData(irownumber, "Fiscal country")); Sptpage.enterSellPrice(); Sptpage.saveSellPrice(); Sptpage.confirmSaveSellPrice(); Sptpage.deleteSellPrice(); Sptpage.confirmDeleteSellPrice(); Sptpage.saveSellPrice(); Sptpage.confirmSaveSellPrice(); //------------------------------ REPORTING----------------------------------------------------------- System.Environment.SetEnvironmentVariable("Endtime", DateTime.Now.ToString("yyyy:MM:dd_HH:mm:ss")); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.EndTime.ToString(), VersionConrol.getTimeStamp()); TestBase.sTestName = stestcaseid; ReportCustom swriteresult = new ReportCustom(); swriteresult.WriteResults(stestcaseid, logStack); TestBase.sbrowsertype = System.Environment.GetEnvironmentVariable("Browser1"); TestBase.DriverCleardown = Driver; //----------------------VIDEO RECORDING END-------------------------------- //stopVideoRecording(); //------------------------------------------------------------------------- finalResult = true; VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.TestResult.ToString(), "Pass"); return(finalResult); } catch (Exception e) { System.Environment.SetEnvironmentVariable("Endtime", DateTime.Now.ToString("yyyy:MM:dd_HH:mm:ss")); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.EndTime.ToString(), VersionConrol.getTimeStamp()); TestBase.sbrowsertype = System.Environment.GetEnvironmentVariable("Browser2"); TestBase.sTestName = stestcaseid; ReportCustom swriteresult = new ReportCustom(); swriteresult.WriteResults(stestcaseid, logStack, finalResult); Console.WriteLine("StackTrace from Test Class :" + e.StackTrace); Console.WriteLine("Message from Test Class" + e.Message); //stopVideoRecording(); TestBase.DriverCleardown = Driver; VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.TestResult.ToString(), "Fail"); // throw e; return(finalResult); } }
public Boolean TC05_AllocatedAssortmentTool_FF() { bool finalResult = false; Initial_Setup("TC05_AllocatedAssortmentTool_FF"); VersionConrol._initTestData(TestContext.CurrentContext.Test.MethodName); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.StartTime.ToString(), VersionConrol.getTimeStamp()); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.ApplictionName.ToString(), "AllocatedAssortmentTool"); try { System.Environment.SetEnvironmentVariable("TestObjective", "Test cases to check on environment testrunup."); //--------------------------------TEST DATA GENERATOR------------------------------------------------------------------------------------------- // TestDataGenerator testgen = new TestDataGenerator(BrowserName, Driver, logStack, iExcel.ReadData(irownumber, "ProductificationBuildStatus"), iExcel.ReadData(irownumber, "Season"), iExcel.ReadData(irownumber, "SeasoninYYYYMM"), iExcel.ReadData(irownumber, "PlanMarketcode")); //--------------------------------------------------------------------------------------------------------- POM_AllocatedAssortmentToolPage aatpage = new POM_AllocatedAssortmentToolPage(BrowserName, Driver, logStack); aatpage.showBuildinfo(); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.Version.ToString(), aatpage.checkVersion.GetAttribute("textContent")); VersionConrol.addApplication("AllocatedAssortmentTool", aatpage.checkVersion.Text); aatpage.pickanyindex(); aatpage.enterDataonpub(); aatpage.republish(); aatpage.clearCache(); aatpage.selectingBrand(iExcel.ReadData(irownumber, "Brand")); aatpage.selectingSeason(iExcel.ReadData(irownumber, "Season")); aatpage.selectingPM(iExcel.ReadData(irownumber, "Planning Market")); aatpage.selectingIndex(iExcel.ReadData(irownumber, "Index")); aatpage.nonpublished(); aatpage.clickCheckbox(); aatpage.enterSize(); aatpage.enterData(); aatpage.clickSave(); aatpage.clearCache(); aatpage.selectingBrand(iExcel.ReadData(irownumber, "Brand")); aatpage.selectingSeason(iExcel.ReadData(irownumber, "Season")); aatpage.selectingPM(iExcel.ReadData(irownumber, "Planning Market")); aatpage.selectingIndex(iExcel.ReadData(irownumber, "Index")); aatpage.picknonpublished(); aatpage.clearSize(); aatpage.clearData(); aatpage.clickSave(); aatpage.clearCache(); //------------------------------ REPORTING----------------------------------------------------------- System.Environment.SetEnvironmentVariable("Endtime", DateTime.Now.ToString("yyyy:MM:dd_HH:mm:ss")); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.EndTime.ToString(), VersionConrol.getTimeStamp()); TestBase.sTestName = stestcaseid; ReportCustom swriteresult = new ReportCustom(); swriteresult.WriteResults(stestcaseid, logStack); TestBase.sbrowsertype = System.Environment.GetEnvironmentVariable("Browser1"); TestBase.DriverCleardown = Driver; //----------------------VIDEO RECORDING END-------------------------------- //stopVideoRecording(); //------------------------------------------------------------------------- finalResult = true; VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.TestResult.ToString(), "Pass"); return(finalResult); } catch (Exception e) { System.Environment.SetEnvironmentVariable("Endtime", DateTime.Now.ToString("yyyy:MM:dd_HH:mm:ss")); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.EndTime.ToString(), VersionConrol.getTimeStamp()); TestBase.sbrowsertype = System.Environment.GetEnvironmentVariable("Browser2"); TestBase.sTestName = stestcaseid; ReportCustom swriteresult = new ReportCustom(); swriteresult.WriteResults(stestcaseid, logStack, finalResult); Console.WriteLine("StackTrace from Test Class :" + e.StackTrace); Console.WriteLine("Message from Test Class" + e.Message); //stopVideoRecording(); TestBase.DriverCleardown = Driver; VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.TestResult.ToString(), "Fail"); return(finalResult); } }
public Boolean TC02_SizeCurveTool_IE() { bool finalResult = false; Initial_Setup("TC02_SizeCurveTool_IE"); VersionConrol._initTestData(TestContext.CurrentContext.Test.MethodName); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.StartTime.ToString(), VersionConrol.getTimeStamp()); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.ApplictionName.ToString(), "SizeCurveTool"); try { System.Environment.SetEnvironmentVariable("TestObjective", "Test cases to check on environment testrunup."); //--------------------------------TEST DATA GENERATOR------------------------------------------------------------------------------------------- // TestDataGenerator testgen = new TestDataGenerator(BrowserName, Driver, logStack, iExcel.ReadData(irownumber, "ProductificationBuildStatus"), iExcel.ReadData(irownumber, "Season"), iExcel.ReadData(irownumber, "SeasoninYYYYMM"), iExcel.ReadData(irownumber, "PlanMarketcode")); //--------------------------------------------------------------------------------------------------------- POM_SizeCurveToolPage Sctpage = new POM_SizeCurveToolPage(BrowserName, Driver, logStack); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.Version.ToString(), Sctpage.checkVersion.GetAttribute("textContent")); Sctpage.showBuildinfo(); VersionConrol.addApplication("SizeCurveTool", Sctpage.checkVersion.GetAttribute("textContent")); Sctpage.selectingSeason(iExcel.ReadData(irownumber, "Season")); Sctpage.selectingSection(iExcel.ReadData(irownumber, "Section")); Sctpage.selectingDepartment(iExcel.ReadData(irownumber, "Department")); Sctpage.createNewComparision(); Sctpage.clearComparision(); Sctpage.enteringComparisionname(); Sctpage.selectSizeScale(iExcel.ReadData(irownumber, "SizeScale")); Sctpage.createComparision(); Sctpage.createNewCurvegrp(); Sctpage.clickCreateNewCurvegrp(); Sctpage.clickEditbutton(); Sctpage.productCheck(); Sctpage.clickAnalysisButton(); Sctpage.saveCurveGroup(); Sctpage.closeComp(); Sctpage.deletecomp(); //------------------------------ REPORTING----------------------------------------------------------- System.Environment.SetEnvironmentVariable("Endtime", DateTime.Now.ToString("yyyy:MM:dd_HH:mm:ss")); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.EndTime.ToString(), VersionConrol.getTimeStamp()); TestBase.sTestName = stestcaseid; ReportCustom swriteresult = new ReportCustom(); swriteresult.WriteResults(stestcaseid, logStack); TestBase.sbrowsertype = System.Environment.GetEnvironmentVariable("Browser1"); TestBase.DriverCleardown = Driver; //----------------------VIDEO RECORDING END-------------------------------- //stopVideoRecording(); //------------------------------------------------------------------------- finalResult = true; VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.TestResult.ToString(), "Pass"); return(finalResult); } catch (Exception e) { System.Environment.SetEnvironmentVariable("Endtime", DateTime.Now.ToString("yyyy:MM:dd_HH:mm:ss")); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.EndTime.ToString(), VersionConrol.getTimeStamp()); TestBase.sbrowsertype = System.Environment.GetEnvironmentVariable("Browser2"); TestBase.sTestName = stestcaseid; ReportCustom swriteresult = new ReportCustom(); swriteresult.WriteResults(stestcaseid, logStack, finalResult); Console.WriteLine("StackTrace from Test Class :" + e.StackTrace); Console.WriteLine("Message from Test Class" + e.Message); //stopVideoRecording(); TestBase.DriverCleardown = Driver; VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.TestResult.ToString(), "Fail"); return(finalResult); } }
public Boolean TC04_ProductPlan_IEBrowser() { bool finalResult = false; Initial_Setup("TC04_ProductPlan_IEBrowser"); VersionConrol._initTestData(TestContext.CurrentContext.Test.MethodName); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.StartTime.ToString(), VersionConrol.getTimeStamp()); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.ApplictionName.ToString(), "ProductPlan"); try { POM_ProductPlanPage pPlanPage = new POM_ProductPlanPage(BrowserName, Driver, logStack); this.driver = Driver; string directive = "20 - H&M Man"; string directiveOther = "18 - Ladies Trend"; string season = "7-2018"; string tabName = "5262 - Jacket"; string changeseason = "6-2017"; //try //{ //driver.Manage().Window.Maximize(); //driver.Navigate().GoToUrl("http://productplan.sit.hm.com"); // pPlanPage.waitForPageToLoad(); // pPlanPage.waitForSpinnerToDisappear(); Thread.Sleep(4000); if (!pPlanPage.seasonButtonStatus.Text.Contains(season)) { pPlanPage.get_seasonSelectionDirectiveButton(season).Click(); } ReportCustom.Report(logStack, driver, "Season selected : " + season, "Season selected : " + season); // ReportCustom.ReportEvent("Season selected", "Season selected : " + season, HP.LFT.Report.Status.Passed); pPlanPage.waitForPageToLoad(); Assert.IsTrue(pPlanPage.get_ProductNameTableHeaderElement().Displayed); if (!pPlanPage.SectionDirectrivesDropDownElementSelectedElement.Text.Contains(directive)) { SelectElement ele = new SelectElement(pPlanPage.SectionDirectrivesDropDownElement); ele.SelectByText(directive); } ReportCustom.Report(logStack, driver, "Directive selected from dropdown : " + directive, "Directive selected from dropdown : " + directive); // ReportCustom.ReportEvent("Directive selected from dropdown", "Directive selected from dropdown : " + directive, // HP.LFT.Report.Status.Passed); if (pPlanPage.get_departmentTabElement(tabName).Displayed) { if (!pPlanPage.DepartmentTabActivElement.Text.Contains(tabName)) { pPlanPage.get_departmentTabElement(tabName).Click(); pPlanPage.waitForPageToLoad(); pPlanPage.waitForSpinnerToDisappear(); } } ReportCustom.Report(logStack, driver, "Tab selected : " + tabName, "Tab selected : " + tabName); // ReportCustom.ReportEvent("Tab selected", "Tab selected : " + tabName, HP.LFT.Report.Status.Passed); Thread.Sleep(4000); // pPlanPage.get_TotalBuyStatusIconExpand().Click(); try { driver.FindElement(By.XPath("//button[text()='Full']")).Click(); pPlanPage.waitForPageToLoad(); pPlanPage.waitForSpinnerToDisappear(); } catch { } VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.Version.ToString(), pPlanPage.versionInfo.GetAttribute("textContent")); VersionConrol.addApplication("ProductPlan", pPlanPage.versionInfo.GetAttribute("textContent")); var str1 = pPlanPage.get_TotalBuyStatusIconExpand().GetAttribute("title"); var str2 = "Show Total Buying Status"; if (str1 == str2) { pPlanPage.get_TotalBuyStatusIconExpand().Click(); } String s = pPlanPage.get_TotalBuyStatusTableLastColumnPercentKeys()[1].Text; Assert.IsTrue(pPlanPage.get_TotalBuyStatusTableLastColumnPercentKeys().Count > 5); Assert.IsTrue(pPlanPage.get_ProductNameTableHeaderElement().Displayed); //pPlanPage.waitForSpinnerToDisappear(); //if cont more than one scroll pPlanPage.get_CreateProductTextBox(); string productName = "AutoTest" + (DateTime.Now.ToString("yyyyhhmmssffff")); pPlanPage.CreateProductNameTextBoxElement.SendKeys(productName); pPlanPage.CreateProductNameTextBoxElement.SendKeys(Keys.Enter); ReportCustom.Report(logStack, driver, "Product name enter in text box : " + productName, "Product name enter in text box : " + productName); // ReportCustom.ReportEvent("Product name enter in text box", "Product name enter in text box : " + productName, // HP.LFT.Report.Status.Passed); Thread.Sleep(2000); Assert.IsTrue(pPlanPage.get_ProductNameFromLeftColumn(productName).Displayed); ReportCustom.Report(logStack, driver, "Product Name display and created", "Product Name display and created"); // ReportCustom.ReportEvent("Product Name display and created ", "Product Name display and created", // HP.LFT.Report.Status.Passed); Thread.Sleep(2000); pPlanPage.get_productExpandButton(productName).Click(); pPlanPage.get_ArticleCodeArea(productName).Click(); pPlanPage.get_ArticleCodeAreaTextBox().Clear(); pPlanPage.get_ArticleCodeAreaTextBox().Click(); pPlanPage.get_ArticleCodeAreaTextBox().SendKeys("09-101"); driver.FindElement(By.XPath("//ul//*[contains(text(),'09-101')]")).Click(); Thread.Sleep(2000); pPlanPage.rightClickOnProductName(productName); pPlanPage.get_Save().Click(); pPlanPage.waitForSpinnerToDisappear(); pPlanPage.waitForPageToLoad(); pPlanPage.rightClickOnProductName(productName); pPlanPage.get_Delete().Click(); pPlanPage.get_DeleteConfirmation().Click(); pPlanPage.SaveButtonHeaderElement.Click(); pPlanPage.waitForSpinnerToDisappear(); pPlanPage.waitForPageToLoad(); pPlanPage.get_UnSelectedTabs()[pPlanPage.get_UnSelectedTabs().Count - 1].Click(); pPlanPage.waitForSpinnerToDisappear(); pPlanPage.waitForPageToLoad(); // Thread.Sleep(4000); //pPlanPage.get_TotalBuyStatusIconExpand().Click(); //pPlanPage.get_TotalBuyStatusTableLastColumnPercentKeys()[1].Click(); //Assert.IsTrue(pPlanPage.get_TotalBuyStatusTableLastColumnPercentKeys().Count > 5); if (!pPlanPage.seasonButtonStatus.Text.Contains(season)) { pPlanPage.get_seasonSelectionDirectiveButton(season).Click(); } ReportCustom.Report(logStack, driver, "Season selected : " + season, "Season selected : " + season); // ReportCustom.ReportEvent("Season selected", "Season selected : " + season, HP.LFT.Report.Status.Passed); pPlanPage.waitForPageToLoad(); Assert.IsTrue(pPlanPage.get_ProductNameTableHeaderElement().Displayed); if (!pPlanPage.SectionDirectrivesDropDownElementSelectedElement.Text.Contains(directiveOther)) { SelectElement ele = new SelectElement(pPlanPage.SectionDirectrivesDropDownElement); ele.SelectByText(directiveOther); } pPlanPage.waitForSpinnerToDisappear(); pPlanPage.waitForPageToLoad(); pPlanPage.get_UnSelectedTabs()[pPlanPage.get_UnSelectedTabs().Count - 1].Click(); //pPlanPage.waitForSpinnerToDisappear(); pPlanPage.waitForPageToLoad(); Thread.Sleep(4000); pPlanPage.get_seasonSelectionDirectiveButton(changeseason).Click(); ReportCustom.Report(logStack, driver, "Season selected : " + changeseason, "Season selected : " + changeseason); pPlanPage.waitForPageToLoad(); Thread.Sleep(5000); Assert.IsTrue(pPlanPage.get_ProductNameTableHeaderElement().Displayed); // pPlanPage.get_TotalBuyStatusIconExpand().Click(); // pPlanPage.get_TotalBuyStatusTableLastColumnPercentKeys()[1].Click(); //Assert.IsTrue(pPlanPage.get_TotalBuyStatusTableLastColumnPercentKeys().Count > 5); //------------------------------ REPORTING----------------------------------------------------------- System.Environment.SetEnvironmentVariable("Endtime", DateTime.Now.ToString("yyyy:MM:dd_HH:mm:ss")); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.EndTime.ToString(), VersionConrol.getTimeStamp()); TestBase.sTestName = stestcaseid; ReportCustom swriteresult = new ReportCustom(); swriteresult.WriteResults(stestcaseid, logStack); TestBase.sbrowsertype = System.Environment.GetEnvironmentVariable("Browser1"); TestBase.DriverCleardown = Driver; //----------------------VIDEO RECORDING END-------------------------------- //stopVideoRecording(); //------------------------------------------------------------------------- finalResult = true; VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.TestResult.ToString(), "Pass"); return(finalResult); } catch (Exception e) { System.Environment.SetEnvironmentVariable("Endtime", DateTime.Now.ToString("yyyy:MM:dd_HH:mm:ss")); VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.EndTime.ToString(), VersionConrol.getTimeStamp()); TestBase.sbrowsertype = System.Environment.GetEnvironmentVariable("Browser2"); TestBase.sTestName = stestcaseid; ReportCustom swriteresult = new ReportCustom(); swriteresult.WriteResults(stestcaseid, logStack, finalResult); Console.WriteLine("StackTrace from Test Class :" + e.StackTrace); Console.WriteLine("Message from Test Class" + e.Message); System.Diagnostics.Debug.WriteLine ("StackTrace from Test Class :" + e.StackTrace); System.Diagnostics.Debug.WriteLine("Message from Test Class" + e.Message); //stopVideoRecording(); TestBase.DriverCleardown = Driver; VersionConrol.addSubKey(TestContext.CurrentContext.Test.MethodName, subKeys.keySet.TestResult.ToString(), "Fail"); return(finalResult); } }