Advertisement
Guest User

Untitled

a guest
Jan 19th, 2018
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. var webdriver = require('selenium-webdriver'),
  2. By = webdriver.By,
  3. until = webdriver.until;
  4. var driver = new webdriver.Builder()
  5. .forBrowser('chrome')
  6. .build();
  7. driver.manage().window().maximize();
  8. driver.get('https://www.facebook.com').then(function(){
  9. console.log("Go to the page");
  10. });
  11. driver.findElement(By.id("email")).sendKeys("fran.sosa@outlook.com.ar").then(function(){
  12. driver.sleep(1000);
  13. console.log("Then: I put my email");
  14. });
  15. driver.findElement(By.xpath("//*[@id='pass']")).sendKeys("hanna34").then(function(){
  16. driver.sleep(1000);
  17. console.log("Then: As an admin i enter my password");
  18. });
  19. driver.findElement(By.xpath('//*[@id="u_0_2"]')).click().then(function(){
  20. console.log("When: I click on the 'Login' button, i want to see the Admin Dashboard");
  21. driver.sleep(2000);
  22. });
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement