Advertisement
Guest User

Untitled

a guest
Sep 6th, 2015
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. import com.thoughtworks.selenium.*;
  2. import org.junit.After;
  3. import org.junit.Before;
  4. import org.junit.Test;
  5. import static org.junit.Assert.*;
  6. import java.util.regex.Pattern;
  7.  
  8. public class WikimediaUseThisFile {
  9. private Selenium selenium;
  10.  
  11. @Before
  12. public void setUp() throws Exception {
  13. selenium = new DefaultSelenium("localhost", 4444, "*chrome", "https://commons.wikimedia.org/");
  14. selenium.start();
  15. }
  16.  
  17. @Test
  18. public void testWikimediaUseThisFile() throws Exception {
  19. selenium.open("/wiki/File:Maitreya_Buddha%2C_Nubra.jpg");
  20. selenium.click("css=a[title=\"Use this file on the web\"] > b");
  21. selenium.click("id=stockphoto_attribution_html");
  22. selenium.click("id=stockphoto_attribution");
  23. }
  24.  
  25. @After
  26. public void tearDown() throws Exception {
  27. selenium.stop();
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement