const { Builder, By} = require('selenium-webdriver') const url = 'http://localhost:3000' function test01() { let driver = new Builder().forBrowser('chrome').build() driver.get(url) let baseInput = driver.findElement(By.xpath('//input[@id="base"]')) baseInput.sendKeys('30') let heightInput = driver.findElement(By.xpath('//input[@id="height"]')) heightInput.sendKeys(('35')) let calcButton = driver.findElement(By.xpath('//button[@id="calcButton"]')) calcButton.click() let areaInput = driver.findElement(By.xpath('//input[@id="area"]')) let areaPromise = areaInput.getAttribute('value') areaPromise.then(res => console.log(res)) } test01()