I am automating below scenario.
Pre-condition: User is not logged in.
- Navigate to a shopping site
- Add a product to cart. Product added to basket.
- Navigate to basket page and select payment option(Pay with card or Amazon Pay). Login page is displayed since user is trying to pay without logging into account.
- Now the user logs in with valid credentials and navigates to Basket Page again
- Now the user again clicks on Pay with card/amazon pay option and is navigated to Address Selection page.
My problem here is that sometimes in Step-3, the user is not navigates to basket page at times whereas sometimes it does and instead directly navigates to Address selection page. Because of this, the flow is interrupted with Selector not found exception.
I tried putting “If” condition with GetAttribute activity using url in GetAttribute but that didn’t work and I cannot come up with much ideas. I am still in learning process.
Please let me know what conditions should I put in so that if basket page in step 3 is not displayed, the user should be taken to Address selection page without any exception.
Note: Sorry for the long post.