Advertisement
Guest User

Forms

a guest
May 28th, 2015
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1.  
  2. package basics;
  3.  
  4. import org.openqa.selenium.WebDriver;
  5.  
  6. public class Forms {
  7. static WebDriver myDriver;//don't actually need this anymore, doesn't hurt though.
  8. static String page = "Forms";//Making this so we can say what page on the page, instead of putting it as a parameter
  9. public Forms(){
  10.  
  11. }
  12.  
  13. public static void run(WebDriver driver) throws InterruptedException{
  14. //System.out.println("Running test for Forms");
  15. driver.get("http://www.disasterassistance.gov/get-assistance/forms");//There wasn't any direction to the forms page
  16. //Header.run(driver, page);
  17. assistanceForms(driver,page);
  18. driver.get("http://www.disasterassistance.gov/");//Reset it to the homepage for each test for consistency
  19. }
  20.  
  21. public static void assistanceForms(WebDriver driver, String page) throws InterruptedException{
  22. String section = "Forms";
  23. String[] instructionsField = {
  24. "xpath",
  25. "//*[@id=\"block-views-static-view-pages-block-6\"]/div/div/div",
  26. "Form Instruction Field"};
  27. String[] buttonApplyOnline = {
  28. "xpath",
  29. "//*[@id=\"block-views-static-view-pages-block-6\"]/div/div/div/ul/li/div/div/div/div[1]/p/b/a",
  30. "Apply Online Button"};
  31. String[] buttonDownloadPDF = {
  32. "xpath",
  33. "//*[@id=\"block-views-static-view-pages-block-6\"]/div/div/div/ul/li/div/div/div/div[2]/p[1]/b/a",
  34. "Download Form Button"};
  35.  
  36. String[][] myArray = {
  37. instructionsField,buttonApplyOnline,buttonDownloadPDF};
  38. //System.out.println("---Running test for forms---");//Had this before I changed the output. Don't actually need it
  39. //but no harm done
  40. RunTest.runTest(myArray,driver,page, section);//added page to this, Look at homepage and I have it. So we can add //what page to the report.
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement