Skip to content

Instantly share code, notes, and snippets.

@zaynelt
Created December 21, 2020 20:49
Show Gist options
  • Save zaynelt/1c6d62916b0a26f9e173981edc27c98b to your computer and use it in GitHub Desktop.
Save zaynelt/1c6d62916b0a26f9e173981edc27c98b to your computer and use it in GitHub Desktop.
const ACCESSORS = {
username: '#username',
password: '#password',
form: '#login_form'
};
const PAGE_LOAD_TIMEOUT = 10 * 1000; // 10 seconds
await remote.URL("https://test.salesforce.com");
const form = await remote.$(ACCESSORS.form);
await form.waitForExist(PAGE_LOAD_TIMEOUT);
const usernameInput = await remote.$(ACCESSORS.username);
await usernameInput.setValue(<USERNAME>);
const passwordInput = await remote.$(ACCESSORS.password);
await passwordInput.setValue(<PASSOWRD>);
const loginButton = await remote.$('#Login');
await loginButton.click();
await remote.pause(5 * 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment