Created
November 11, 2019 20:30
-
-
Save IntranetFactory/59c796b1a6b7870b7840c20e8ae426b1 to your computer and use it in GitHub Desktop.
login to my.digitalassistant.app test tenant
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const puppeteer = require('puppeteer'); | |
const username = 'test'; | |
const password = 'bratwurst'; | |
(async () => { | |
const browser = await puppeteer.launch({ headless: false }); | |
const page = await browser.newPage(); | |
await page.goto('https://my.digitalassistant.app/Users/Account/Login', {waitUntil: 'networkidle2'}); | |
const usernameInput = await page.evaluateHandle(`document.querySelector("#ue").shadowRoot.querySelector("#input-1 > input")`); | |
const passwordInput = await page.evaluateHandle(`document.querySelector("#visibleForm > form > paper-input:nth-child(2)").shadowRoot.querySelector("#input-2 > input[type=password]")`); | |
const loginButton = await page.evaluateHandle('document.querySelector("#login")'); | |
await usernameInput.focus(); | |
await usernameInput.type(`${username}`); | |
await passwordInput.focus(); | |
await passwordInput.type(`${password}`); | |
loginButton.click(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment