code: public Object clickAndExpect(ExpectedCondition<?> expectedCondition) {
          dispatcher.beforeClick(this, expectedCondition);
  
          getElement().click();
          if (Boolean.parseBoolean(Config.getConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING))) {
              logUIAction(UIActions.CLICKED);
          }
          if (parent != null) {
              WebDriverWaitUtils.waitUntilPageIsLoaded(parent.getCurrentPage());
          }
          validatePresenceOfAlert();
          long timeout = Grid.getExecutionTimeoutValue() / 1000;
          WebDriverWait wait = new WebDriverWait(Grid.driver(), timeout);
          Object variable = wait.until(expectedCondition);
          processScreenShot();
  
          dispatcher.afterClick(this, expectedCondition);
  
          return variable;
      }
docs: The click function and wait based on the ExpectedCondition.
  
  @param expectedCondition
  ExpectedCondition<?> instance to be passed.
  
  @return The return value of
  {@link org.openqa.selenium.support.ui.FluentWait#until(com.google.common.base.Function)} if the function
  returned something different from null or false before the timeout expired.<br>
  
  <pre>
  Grid.driver().get(&quot;https://www.paypal.com&quot;);
  TextField userName = new TextField(&quot;login_email&quot;);
  TextField password = new TextField(&quot;login_password&quot;);
  Button btn = new Button(&quot;submit.x&quot;);
  
  userName.type(&quot;exampleId@paypal.com&quot;);
  password.type(&quot;123Abcde&quot;);
  btn.clickAndExpect(ExpectedConditions.titleIs(&quot;MyAccount - PayPal&quot;));
  </pre>