WebElement heightLabel = driver.findElement(By.xpath("//*[@id='app']/section/form/div/div/h1")); // Locate the textbox where username should be inputted WebElement heightUserBox = driver.findElement(withTagName("input") .below(heightLabel)); heightUserBox.sendKeys("user-name");