title: Selenium Ebay Script
body: <p>I have logged into Ebay and want to click the hyperlink of 'My collections' which is under "G'day [username]". The issue is now I can not find the element of 'My collections'. The error message is "Unable to locate element: (//li[@id='gh-ucol']/a)</p>
  
  <p>Please refer to the below steps how I replicate:</p>
  
  <ul>
  <li>Open Ebay via Firefox</li>
  <li>Click Log in hyperlink</li>
  <li>Enter the user name password then click log in button</li>
  <li>Click "G'day [username]"</li>
  <li>Select 'My Collection' from the droplist</li>
  </ul>
  
  <p>This is my Selenium Java Script:</p>
  
  <pre><code>import org.openqa.selenium.By;
  import org.openqa.selenium.NoSuchElementException;
  import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.firefox.FirefoxDriver;
  
  
  
  
  public class KevinTest {
  
  public static void main(String[] args) throws InterruptedException{
  WebDriver driver = new FirefoxDriver();
  driver.get("http://www.ebay.com.au");
  driver.manage().window().maximize();
  Thread.sleep(20);
  
  
  
  driver.findElement(By.linkText("Sign in")).click();
  Thread.sleep(100);
  driver.findElement(By.xpath("(//input[@placeholder='Email or username'])[2]")).sendKeys("my@username");
  driver.findElement(By.xpath("(//input[@placeholder='Password'])[1]")).sendKeys("mypassword");
  driver.findElement(By.id("sgnBt")).click();
  boolean tf;
  try {
      driver.findElement(By.id("errf")).getText();    
      tf = true;
   }catch(NoSuchElementException e) {
      tf = false;
   }
  
  if (tf == true) {
      System.out.println("Incorrect Password");
      driver.close();
  }else {
      System.out.println("Log in successfully");
  }
  
  driver.findElement(By.id("gh-eb-u")).click();
  Thread.sleep(100);
  driver.findElement(By.xpath("(//*[@id='gh-ucol']/a)")).click();
  }}
  </code></pre>