@Test(groups = "P2", singleThreaded = true)
 void validateChangeOrderIdAlreadyExists() {
   setupTest();
   changeOrderActions.createCompleteChangeOrder("3B1", "10", "4B2");
   // (3140)Verify that adding trailing and leading spaces in Change Order ID to get deposit
   // displays results.
   receiptActions.doReceipt(" 3B1 ", "2");
   Assert.assertTrue(session.existsNow(ChangeOrderReceiptLocators.COUNTER_NAME));
   commonActions.navigateTo(NavMenuLink.CHANGE_ORDER_RECEIPT);
   commonActions.selectContentFrame();
   Assert.assertTrue(session.existsNow(ChangeOrderReceiptLocators.CHANGE_ORDER_ID_LBL));
   session.setText(ChangeOrderReceiptLocators.CHANGE_ORDER_TXT_BOX, "3B1");
   session.click(ChangeOrderReceiptLocators.GET_DEPOSIT_BTN);
   waits.waitUntilVisible(ChangeOrderReceiptLocators.ERROR_CHANGE_ORDER_ALREADY_EXISTS);
 }
  @Override
  public void searchForProduct(ProductSearch search) {
    commonActions.navigateTo(NavMenuLink.PRODUCT_TYPES);
    commonActions.selectContentFrame();

    // the default is checked
    if (search.isActive().isPresent()) {
      session.setChecked(ACTIVE_CHK_BOX, search.isActive().get());
    }

    // the default is un-checked
    if (search.isInActive().isPresent()) {
      if (search.isInActive().get() == true) {
        if (!session.existsNow(CHECKED_INACTIVE_CHK_BOX)) {
          session.click(INACTIVE_CHK_BOX);
        }
      }
      if (search.isInActive().get() == false) {
        if (session.existsNow(CHECKED_INACTIVE_CHK_BOX)) {
          session.click(INACTIVE_CHK_BOX);
        }
      }
    }

    session.setText(SEARCH_FLD, search.getProductName());

    if (search.getUpcs().isPresent()) {
      session.clear(SEARCH_FLD);
      session.setText(UPCS_FLD, Joiners.COMMA.join(search.getUpcs().get()));
    }

    if (search.getRowsPerPage().isPresent()) {
      session.selectDropDownText(
          ROWS_PER_PAGE, String.valueOf(search.getRowsPerPage().get().getRowsPerPage()));
    }

    if (search.getProductTypes().isPresent()) {
      for (ProductType type : search.getProductTypes().get()) {
        session.selectDropDownText(AVAILABLE_PRODUCT_TYPES, type.getText());
        session.click(PRODUCT_TYPE_SELECT_BTN);
      }
    }
    waits.waitForElementToClick(SUBMIT_BTN);
    session.click(SUBMIT_BTN);
  }
 @Override
 public boolean cashDrawerExists(CashDrawer drawer) {
   commonActions.navigateTo(NavMenuLink.CASH_DRAWER);
   commonActions.selectContentFrame();
   if (session.existsNow(CashDrawerLocators.verifyRow(drawer))) {
     return true;
   }
   return false;
 }
 @Override
 public void verifyPageNavigateToLocateProduct(Product product, String esnNumbers[]) {
   search.searchForProduct(
       ProductSearch.builder()
           .productName(product.getName().get())
           .active(true)
           .inActive(true)
           .create());
   session.click(FIRST_EDIT_PRODUCT_BTN);
   waits.waitUntilVisible(ProductLocators.TITLE_EDITING_PRODUCT_TYPE);
   session.click(PRODUCT_INVENTORY_TAB);
   waits.waitUntilVisible(TITLE_PRODUCT_INVENTORY);
   session.click(getEditButton(esnNumbers[0]));
   waits.waitUntilVisible(verifyEsnAtLocateProduct(esnNumbers[0]));
   if (session.existsNow(getDefaultPrice(product.getDefaultPrice().get()))) {
     waits.waitUntilVisible(getDefaultPrice(product.getDefaultPrice().get()));
   }
   waits.waitUntilVisible(verifyCategory(product.getCategoryText().get()));
   waits.waitUntilVisible(verifyShortDescription(product.getShortDescription().get()));
   waits.waitUntilVisible(verifyStoreName(LoginData.STORE.value()));
 }
  private void login(final String userName, final String password, final String storeName) {

    checkNotNull(userName);
    checkNotNull(password);
    checkNotNull(storeName);

    // assumes you are on the login page.
    selectMainWindow();
    waitForTime(2);
    selectContentFrame();
    waitForTime(2);
    waits.waitUntilVisible(By.xpath("//span[contains(text(),'Login')]"));

    annoyingWaitHack();

    session.setText(By.id("userName"), userName);

    waits.waitUntilVisible(By.xpath("//div//span[contains(text(),'Login')]"));

    annoyingWaitHack();

    session.setText(By.id("password"), password);

    annoyingWaitHack();

    if (session.existsNow(By.id("autoCompleteField"))) {
      session.setText(By.id("autoCompleteField"), storeName);
    } else {
      session.selectDropDownText(By.id("store"), storeName);
    }
    session.findNow(DEFAULT_SUBMIT_0).click();
    try {
      Thread.sleep(10000);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
  }