Automation Using Selenium Webdriver

Monday 17 October 2016

Linkedin Login-Logout Using Selenium webdrier


Linkedin Sign in-Sign out Example Using Selenium Webdriver

   public class LinkedIn
 {
    WebDriver driver = new FirefoxDriver();
    @BeforeTest
    public void setUp() throws Exception {

        String baseUrl = "http://www.linkedin.com/";  
        driver.get(baseUrl);

    }


    @Test
    public void login() throws InterruptedException
    {
        WebElement login = driver.findElement(By.id("login-email"));
        login.sendKeys("*****@gmail.com");

        WebElement pwd = driver.findElement(By.id("login-password"));
        pwd.sendKeys("*****");


        WebElement in = driver.findElement(By.name("submit"));
        in.click();

        Thread.sleep(10000);
    }


     @Test
        public void profile()  {
    // here it gives error to me : Unable to locate element
        Thread.sleep(5000);
        Actions action = new Actions(driver);
        WebElement profile = driver.findElement(By.xpath("//*[@id='img-defer-id-1-25469']"));
        action.moveToElement(profile).build().perform();
        driver.quit();
    }


}

2 comments:

  1. The blog has been written in a manner that there isn't anything that has been left revealed, and furthermore, I have perused different web journals that are posted here and they are altogether worth a read.
    youtube bellen

    ReplyDelete
  2. The blog has been written in a manner that there isn't anything that has been left revealed, and furthermore, I have perused different web journals that are posted here and they are altogether worth a read.
    visit site

    ReplyDelete