Currently, I am on the PayPal page and I need to automate clicking the agree button.
<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>
In order to click the element with id=button on this page, I have tried using xpath, css, and id for all elements, but I always encounter the error "Element is not clickable at point (353, 447). Other element would receive the click: ..."
Below is my code:
@FindBy(id="confirmButtonTop")
public static WebElement agreeButton;
WebDriver driver;
public PaypalReviewPage(WebDriver driver) {
this.driver = driver;
}
public void completePaypal() {
agreeButton.click();
}
If anyone has a solution, please help. Thank you.