简体   繁体   中英

Button not click able with intellij automation java

iam on paypal page and i need to click agree button with automation

 <form id="ryiForm" class="proceed ng-pristine ng-valid" ng-class="{true: 'validated'}[validated]" ng-submit="confirm.$valid && onPay()" novalidate="novalidate" name="confirm"> <!-- {@if cond="'{data.updated}' === 'bmlSuccess'" } --> <!-- ngIf: merchantMsg --> <div class="reviews ng-scope" ng-if="merchantMsg"></div> <!-- end ngIf: merchantMsg --> <!-- ngIf: showShippingAddress --> <div class="reviews"></div> <div class="offers"></div> <!-- inc/bmlLearnMore --> <div></div> <!-- Action button --> <!-- ngIf: showPaypalPolicies --> <p class="paypalPoliciesLink disclaimer ng-binding ng-scope" ng-if="showPaypalPolicies" data-ng-bind-html="htmlContent('memberReview.viewPaypalPolicies')"></p> <!-- end ngIf: showPaypalPolicies --> <!-- checkoutSession.isRT need to review this --> <!-- ngIf: showReviewLater --> <!-- ngIf: checkoutSession.isAuthRequired --> <!-- ngIf: showPolicyAgreement --> <!-- ngIf: showFixedButton() --> <div id="button" class="buttons reviewButton"> <input id="confirmButtonTop" class="btn full confirmButton continueButton" type="submit" ng-click="setValidated()" value="Agree & Continue" track-submit=""></input> </div> <!-- ngIf: checkoutSession.plan.soft_descriptor --> <!-- ngIf: checkoutSession.displayBankChargeDisclaimer… --> <!-- ngIf: checkoutAppData.flags.billing_address_conse… --> <!-- ngIf: checkoutSession.plan.isAuthSignupEnabled ||…--> <!-- ngIf: checkoutAppData.flags.display_buyer_email_p… --> </form> 

from this page i need to click id=button. i used xpath,css,id all elements but its alwaysgive error " Element is not clickable at point (353, 447). Other element would receive the click: ... "

my code is

@FindBy(id="confirmButtonTop")
 public static WebElement agreeButton;
WebDriver driver;

public PaypalReviewPage(WebDriver driver) {
    this.driver = driver;
}

public void completePaypal() {
     agreeButton.click();
}

if some one have solution please help thanks

i had just change small code

public boolean completePaypal() throws Exception {
try {
    Thread.sleep(10000);
    WebDriverWait wait = new WebDriverWait(driver, 60);
    WebElement PayPalAgreeContinueBtn = wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//*[@id='confirmButtonTop']")));
    PayPalAgreeContinueBtn.click();
    Thread.sleep(5000);
    return true;
} catch (Exception e) {

    return false;
}

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM