@@ -0,0 +1,1915 @@
+package com.seleniumtests.webpage;%0A%0Aimport com.seleniumtests.dataobject.User;%0Aimport com.seleniumtests.driver.web.WebUXDriver;%0Aimport com.seleniumtests.driver.web.element.Button;%0Aimport com.seleniumtests.driver.web.element.Link;%0Aimport com.seleniumtests.driver.web.element.TextField;%0Aimport com.seleniumtests.driver.web.element.WebPage;%0Aimport org.openqa.selenium.By;%0A%0A/**%0A * User: tbhadauria%0A * Date: 10/2/13%0A * Time: 6:15 PM%0A */%0Apublic class TestLinkLoginPage extends WebPage %7B%0A%0A    private static final String PAGE_URL = %22http://www.seleniumtests.com/2013/08/demo-test-link-site.html%22;%0A%0A    // Page identifier field is set to seleniumtests.com as TestLink appears in iframe%0A    private static Link seleniumTrainingLink = new Link(%22Selenium Training Link%22, By.linkText(%22Free Selenium Training%22));%0A    private static TextField loginTextBox = new TextField(%22Login Text Box%22, By.id(%22login%22));%0A%0A%0A    public TestLinkLoginPage() throws Exception %7B%0A        // verifies that loginTextBox appears on login page else test would not make sense%0A        super(loginTextBox);%0A    %7D%0A%0A    /**%0A     * Opens log in page%0A     * @param openPageUrl%0A     * @throws Exception%0A     */%0A    public TestLinkLoginPage (boolean openPageUrl) throws Exception %7B%0A        super(seleniumTrainingLink, openPageUrl ? PAGE_URL : null, true);%0A        getDriver().switchTo().frame(getDriver().findElement(By.id(%22testlink%22))); // Switch to test link frame%0A    %7D%0A%0A    private TextField passwordTextBox = new TextField(%22Password Te  xt Box%22, By.name(%22tl_password%22));%0A    private Button loginButton = new Button(%22Login Button%22, By.name(%22login_submit%22));%0A%0A%0A    public AdminHomePage login(User user) throws Exception %7B%0A        loginTextBox.clear();%0A        loginTextBox.sendKeys(user.getUserID());%0A        passwordTextBox.clear();%0A        passwordTextBox.sendKeys(user.getPassword());%0A        loginButton.submit();%0A        return new AdminHomePage();%0A    %7D%0A%7D

switch to testlink frame