Skip to content

Instantly share code, notes, and snippets.

@jimode
Last active July 25, 2018 13:31
Show Gist options
  • Save jimode/152a2bbac9ad8fe8a9c653debd4abdd5 to your computer and use it in GitHub Desktop.
Save jimode/152a2bbac9ad8fe8a9c653debd4abdd5 to your computer and use it in GitHub Desktop.
Get location co-ordinates of elements and get browser to scroll to it.
// Webdriver.IO
const [x, y] = Object.values(this.cardPaymentOption.getLocation());
browser.scroll(x, y);
this.cardPaymentOption.click();
const [x1, y1] = Object.values(this.ccSecureCheckoutText.getLocation());
browser.scroll(x1, y1);
this.ccSecureCheckoutText.waitForVisible();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment