/// <summary> /// Performs the playback of actions in this module. /// </summary> /// <remarks>You should not call this method directly, instead pass the module /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method /// that will in turn invoke this method.</remarks> void ITestModule.Run() { Mouse.DefaultMoveTime = 300; Keyboard.DefaultKeyPressTime = 100; Delay.SpeedFactor = 1.0; Report.Info("Click on cart option in Amazon Home page"); AmazonRepository repo = AmazonRepository.Instance; WebElement elmCart; bool clickOperation = true; do { if (!repo.Amazon.Header.CartInfo.Exists(5000, out elmCart)) { throw new RanorexException("Cart is not avaialable in the website"); } if (elmCart == null) { clickOperation = false; } else { elmCart.Click(); } }while(clickOperation == false); Report.Success("Cart has been click successfully"); }
/// <summary> /// Performs the playback of actions in this module. /// </summary> /// <remarks>You should not call this method directly, instead pass the module /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method /// that will in turn invoke this method.</remarks> void ITestModule.Run() { Mouse.DefaultMoveTime = 300; Keyboard.DefaultKeyPressTime = 100; Delay.SpeedFactor = 1.0; Mouse.Enabled = false; AmazonRepository repo = AmazonRepository.Instance; try { WebDocument myWebDocument = "/dom[@domain='" + URL + "']"; Validate.Exists(myWebDocument.GetPath()); myWebDocument.Close(); } catch { throw new RanorexException("Unable to find chrome with given application."); } }
/// <summary> /// Performs the playback of actions in this module. /// </summary> /// <remarks>You should not call this method directly, instead pass the module /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method /// that will in turn invoke this method.</remarks> void ITestModule.Run() { Mouse.DefaultMoveTime = 300; Keyboard.DefaultKeyPressTime = 100; Delay.SpeedFactor = 1.0; AmazonRepository repo = AmazonRepository.Instance; repo.rep_ItemName = ItemName; WebElement elmItems, elmParent, elmSibling, elmDelete; if (repo.Amazon.Body.CartView.ItemInfo.Exists(5000, out elmItems)) { elmParent = Helper.GetParent(elmItems, "Div", "SafeClass", "a-col-right"); //elmSibling = elmParent.NextSibling; if (elmParent.TryFindSingle(elmParent.GetPath().ToString() + "//input[@tagname='input' and @tagvalue='Delete']", 5000, out elmDelete)) { bool clickOperation = true; do { if (elmDelete == null) { clickOperation = false; } else { elmDelete.Click(); } }while(clickOperation == false); } else { throw new RanorexException("Delete button is not available"); } } else { throw new RanorexException("items is not avaialble in the cart"); } }