title: LoadableComponent in Selenium: isLoaded method is not used when class object comes from another class
body: <p>First time poster..</p>
  
  <p>I just started using LoadableComponent model from Selenium and it sounds like a great idea. However, I don't quite understand how isLoaded method is being called. Let me give you my example:</p>
  
  <p>I have two model classes MainPage and SignIn, SignIn page is being loaded when clicking "Sign In" link in MainPage. Here is the code for MainPage:</p>
  
  <pre><code>public class MainPage extends LoadableComponent&lt;MainPage&gt;
  {
  private final WebDriver driver;
  @FindBy(linkText = "Sign In")
  WebElement              signIn;
  
  public MainPage(WebDriver driver)
  {
      this.driver = driver;
      PageFactory.initElements(driver, this);
  
  }
  
  @Override
  public void isLoaded() throws Error
  {
      System.out.println("isLoaded main page being called");
      assertEquals(
              driver.getTitle(),
              "Main page title",
              "Invalid title for Home page");
  
  }
  
  @Override
  public void load()
  {
      driver.get(Constants.URL_HOME);
  
  }
  
  public SignInPage signIn()
  {
      signIn.click();
      return new SignInPage(driver);
  }
  </code></pre>
  
  <p>Here's the code for SignInPage:</p>
  
  <pre><code>public class SignInPage extends LoadableComponent&lt;SignInPage&gt;
  {
  private final WebDriver driver;
  @FindBy(xpath = "//a[@class='action-link registration']")
  WebElement              register;
  
  public SignInPage(WebDriver driver)
  {
      this.driver = driver;
      PageFactory.initElements(driver, this);
  
  }
  
  @Override
  public void isLoaded() throws Error
  {
      System.out.println("Calling isLoaded()...");
      String url = driver.getCurrentUrl();
      assertTrue(url.endsWith("account/signIn"));
      WebElement h1 = driver.findElement(By.xpath("//span[@data-label='SIGN_IN']"));
      assertTrue(h1.getText().equals("THIS SHOULD REALLY FAIL"));
  }
  
  @Override
  public void load()
  {
      driver.get(Constants.URL_SIGNIN);
  
  }
  
  public UserRegistrationPage register()
  {
      register.click();
      return new UserRegistrationPage(driver);
  }
  
  public String getTitle()
  {
      return driver.getTitle();
  }
  }
  </code></pre>
  
  <p><strong>Now</strong> the test is quite basic, I am loading the MainPage and clicking on SignIn link. I would expect to see that isLoaded() method is called once for MainPage and once for SignIn page. However, isLoaded() is being called twice for MainPage and never for SignIn page. I fail to understand why...
  Here's the test:</p>
  
  <pre><code>@Test
  public void newRegistration()
  {
      MainPage mainpage = new MainPage(driver).get();
      SignInPage signInPage = mainpage.signIn();
      UserRegistrationPage userRegPage = signInPage.register();
  
  }
  </code></pre>