const { Builder, By, Key, until } = require("selenium-webdriver"); require('chromedriver'); function triangleTest() { let driver = new Builder().forBrowser("chrome").build(); driver.get('http://localhost:3002'); driver.findElement(By.id('base')).sendKeys('30'); driver.findElement(By.id('height')).sendKeys('35'); driver.findElement(By.id('calcButton')).click(); const areaPromise = driver.findElement(By.id('area')).getAttribute('value'); areaPromise.then(res => console.log(res)); driver.close(); } triangleTest();