Automation Testing-Code for login to the website using login details

Calling of a website using chromedriver and login to the website by giving the login details

Tested site:Customer Login (cloudwaysapps.com)

Login: cust@gmail.com

Pass:MSdhoni@7

Code:

package selenium;

import java.time.Duration;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class Login {

public static void main(String[] args) {

    WebDriver driver= new ChromeDriver();
    driver.manage().timeouts().implicitlyWait(Duration.ofMinutes(4));
    driver.get("https://magento-817980-2808716.cloudwaysapps.com/customer/account/login/");
    driver.findElement(By.id("email")).sendKeys("cust007@gmail.com");
    driver.findElement(By.id("pass_log_id")).sendKeys("dhoni@7");
    driver.findElement(By.id("send2")).click();

Leave a comment

Your email address will not be published. Required fields are marked *