Selenium Model View Controller Test Framework Part 4 - Base Framework
Part 4 Base Framework:
Source code for each class
AppConstant.Java
package com.seleniummaster.qa.framework;
public class AppConstant {
public static final String HOMEVALUE="500000";
public static final String CREDITPROFILE="Excellent";
public static final String DOWNPAYMENT="80000";
public static final String LOANPURPOSE="New Purchase";
public static final String INTERESTRATE="5";
public static final String LOANTERM="30";
public static final String STARTMONTH="Dec";
public static final String STARTYEAR="2012";
public static final String PROPERTYTAX="1.25";
public static final String PMI="0.5";
}
ScriptBase.Java
package com.seleniummaster.qa.framework;
import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import com.thoughtworks.selenium.DefaultSelenium;
import com.thoughtworks.selenium.Selenium;
public class ScriptBase {
protected Selenium selenium=null;
@Before
public void setUp() throws Exception {
selenium=new DefaultSelenium("localhost",4444,"*firefox","http://www.seleniummaster.com");
selenium.start();
selenium.setTimeout("60000");
selenium.setSpeed("3000");
selenium.windowMaximize();
selenium.open("/seleniummctest/mortgagecalculator.aspx");
selenium.waitForPageToLoad("60000");
}
@After
public void tearDown() throws Exception {
selenium.close();
selenium.stop();
}
}