Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. <div class="row">
  2. <div class="span9">
  3. <h2>Request New Testimonial</h2>
  4. <form name="request" action="requesttestimonial.php" method="POST">
  5. <input type="text" name="requestroll" placeholder="Roll number of the person you want to request a testimonial" />
  6. <input type="submit" value="Send Request" name="submitrequest" />
  7. </form>
  8. </div>
  9. </div>
  10.  
  11. <form class="navbar-form pull-right" method="POST" action="login.php">
  12. <input class="span2" name="rollnumber" type="text" placeholder="Roll Number">
  13. <input class="span2" name="password" type="password" placeholder="Password">
  14. <button type="submit" class="btn" name="signin">Sign in</button>
  15. </form>
  16.  
  17. package org.openqa.selenium.example;
  18.  
  19. import org.openqa.selenium.By;
  20. import org.openqa.selenium.WebDriver;
  21. import org.openqa.selenium.WebElement;
  22. import org.openqa.selenium.htmlunit.HtmlUnitDriver;
  23.  
  24. public class Example {
  25. public static void main(String[] args) {
  26. // Create a new instance of the html unit driver
  27. // Notice that the remainder of the code relies on the interface,
  28. // not the implementation.
  29. WebDriver driver = new HtmlUnitDriver();
  30.  
  31. // And now use this to visit Google
  32. driver.get("http://www.google.com");
  33.  
  34. // Find the text input element by its name
  35. WebElement element = driver.findElement(By.name("q"));
  36.  
  37. // Enter something to search for
  38. element.sendKeys("Cheese!");
  39.  
  40. // Now submit the form. WebDriver will find the form for us from the element
  41. element.submit();
  42.  
  43. // Check the title of the page
  44. System.out.println("Page title is: " + driver.getTitle());
  45.  
  46. driver.quit();
  47. }
  48. }
  49.  
  50. from twill.commands import go, fv, submit
  51. go('http://lcnitd.com/yearbook/2014/index.php')
  52. fv("2","rollnumber","10/CSE/2")
  53. fv("2","password","myPassword")
  54. submit('0')
  55. go('http://www.lcnitd.com/yearbook/2014/request.php')
  56. n=1
  57. roll="10/CSE/"
  58. while(n<100):
  59. sleep(2)
  60. temp=roll+`n`
  61. print n
  62. fv("2","requestroll",temp)
  63. n+=1
  64. submit('0')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement