View source | Discuss page | Page history | Printable version   
ADVERTISEMENT
Accounting eLearning Courses
Partnerships
SourceForge.net Logo
Openbravo ERP at SourceForge

SourceForge.net Logo
Openbravo POS at SourceForge

Open Solution Alliance Logo
Openbravo at Open Solutions Alliance

Automated Testing at Openbravo/login

 
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import static org.junit.Assert.*;
 
 import com.thoughtworks.selenium.*;
 
 /**
  * Test login process
  */
 public class Login {
 	
 	/**
 	 * Browser used to test the application
 	 */
 	private Selenium selenium;
 
 	/**
 	 * Prepare the browser for the execution
 	 * @throws Exception
 	 */
 	@Before
 	public void setUp() throws Exception {
 		selenium = new DefaultSelenium("localhost", 4444, 
 				"*firefox", 
 				"http://localhost:8180/");
  		selenium.start();
 		selenium.windowMaximize();
 	}
 	
 	/**
 	 * Test login
 	 */
 	@Test
 	public void testLogin() {
 		// Perform login
 		// open login page
 		selenium.open("openbravo/security/Login_FS.html");
 		// enter the user name
 		selenium.type("user", "Openbravo");
 		// enter the password
 		selenium.type("password", "openbravo");
 		// click login button
 		selenium.click("buttonOK");
 		// wait for the main page to load		
 		selenium.waitForPageToLoad("30000");
 	}
 
 	/**
 	 * Close the browser 
 	 * @throws java.lang.Exception
 	 */
 	@After 
 	public void tearDown() throws Exception {
 		selenium.stop();
 	}
 }

Retrieved from "http://wiki.openbravo.com/wiki/Automated_Testing_at_Openbravo/login"

This page has been accessed 708 times. This page was last modified 08:40, 13 May 2009. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.


Category: Automated Testing ERP