private void TxtQTE_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { TxtDiscount.Focus(); } }
public void ClearTextBoxes() { TxtID.Clear(); TxtName.Clear(); TxtUnitMeasure.Clear(); TxtQuantity.Clear(); TxtUnitValue.Clear(); TxtIVA.Clear(); TxtWarehouseQuantity.Clear(); TxtDiscount.Clear(); TxtID.Focus(); }
public void SwitchWindowToPricingPopupToApplyDiscount(string discount) { string oldWindow = webDriver.CurrentWindowHandle; string popWindowHandle = null; WebDriverWait wait = new WebDriverWait(webDriver, new TimeSpan(0, 0, 5)); wait.Until((d) => webDriver.WindowHandles.Count == 2); var windowHandles = webDriver.WindowHandles; ReadOnlyCollection <string> handles = new ReadOnlyCollection <string>(windowHandles); foreach (string handle in handles) { if (handle != oldWindow) { popWindowHandle = handle; } } webDriver.SwitchTo().Window(popWindowHandle); TxtDiscount.Clear(); TxtDiscount.SendKeys(discount); BtnApplyChanges.SendKeys(Keys.Enter); webDriver.SwitchTo().Window(oldWindow); webDriver.WaitForPageLoad(TimeSpan.FromSeconds(30)); }