Earn Money in 10 days

Selenium Videos

Protractor In Selenium

Livechat

Monday, 1 December 2014

How to click on Button in Selenium Webdriver

 The click() method is used to simulate the clicking of any element.              


In Selenium we have click () method of Webdriver Interface for clicking on Signup/Login/Sumit Button/Radio Button/Checkboxes

It does not take any parameter/argument.

//Here is the code
package test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class FacebookLogin {
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.get("http://facebook.com");
//Enter the text into emailaddress
driver.findElement(By.xpath("//*[@id='Email']")).sendKeys("ritu7180@gmail.com");
//Enter the text into password Filled
driver.findElement(By.xpath("//*[@id='Passwd']")).sendKeys("password");
//Clicking on signInButton
driver.findElement(By.xpath("//*[@id='signIn']")).click();
}
}

0 comments:

Post a Comment

Popular Posts

 
subscribe
Subscribe Us
emailSubscribe to our mailing list to get the updates to your email inbox... We can't wait more to have your email in our subscribers email list. Just put your nice email in below box: