I've started a few WebDriver projects in Eclipse Juno but i'm not satisfied with my structure, i think is to stupid and not efficient at all.
Beneath you can see my project three now. The TEST_xxx.java files are functions to trigger the files in the test package.
Here is an example of one function in a TEST_xxx.java file:
public void a_search_product_by_sku(String sku) throws InterruptedException {
System.out.println("Running Testsuite 3 - Navigation - Testcase 1 - Search product by SKU");
tests.navigation nav = new tests.navigation(BASE_URL, driver);
nav.search_product_by_sku(sku);
}
This calls the function search_product_by_sku() that is inside the navigation class inside the test package. This function look like this:
public void search_product_by_sku(String sku) throws InterruptedException {
driver.get(url + "/k/k.aspx");
driver.findElement(By.id("q")).clear();
driver.findElement(By.id("q")).sendKeys(sku);
driver.findElement(By.cssSelector("input.submit")).click();
boolean status = driver.findElement(By.cssSelector("BODY")).getText().matches("^[\\s\\S]*Status:[\\s\\S]*$");
Assert.assertEquals(true, status);
}
All this seems too hard to maintain, and since I'm not a very experienced programmer I'm really out of ideas and i hoped that someone here could help me.
Thanks in advance!