Advertisement
Guest User

Untitled

a guest
Oct 20th, 2014
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.80 KB | None | 0 0
  1. import org.junit.Test
  2. import org.openqa.selenium.phantomjs.PhantomJSDriver
  3. import org.openqa.selenium.remote.DesiredCapabilities
  4. import org.openqa.selenium.{Dimension, By, OutputType}
  5.  
  6. /**
  7.  * Created by gcc on 20.10.2014.
  8.  */
  9. class DummyTest {
  10.  
  11.   @Test
  12.   def dummyTest() : Unit = {
  13.     val cap = new DesiredCapabilities()
  14.     cap.setCapability("screen-resolution","1280x1024");
  15.     cap.setCapability("phantomjs.binary.path", "W:\\phantomjs-1.9.7-windows\\phantomjs.exe")
  16.     val driver = new PhantomJSDriver(cap)
  17.  
  18.     driver.get("http://onlinelibrary.wiley.com/enhanced/doi/10.1111/acel.12215/")
  19.     driver.manage().window().setSize(new Dimension(1920, 1280))
  20.  
  21.     val scrFile = driver.getScreenshotAs(OutputType.FILE)
  22.  
  23.     driver.findElement(By.linkText("Log in / Register")).click()
  24.   }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement