**Update**

I've trying to sign in in this website:

[Salesforce Trailhead](https://trailhead.salesforce.com/en/home)

Unfortunately, I have not been successful. Here's my code:

```
WebDriver driver = new HtmlUnitDriver();

driver.get("https://trailhead.salesforce.com/en/home");
System.out.println(driver.getTitle());

WebElement btnLogin = driver.findElement(By.xpath("//*[@id=\"main-wrapper\"]/header/div[1]/div[2]/span[2]/div/span/button"));
System.out.println(btnLogin);

driver.quit();

```

I'm trying to get the Login button from the header but, I cannot find the Element this is the exception message that I'm getting:

> 
> Exception in thread "main" org.openqa.selenium.NoSuchElementException:
>  Unable to locate a node using
>  //\*[@id="main-wrapper"]/header/div[1](https://trailhead.salesforce.com/en/home)/div[2]/span[2]/div/span/button
> 
> 
> 

I'm trying to test the answer from below but, I've not been successful. I would like to understand better how the WebDriverWait works and the until() method.

Thanks.