package package_name;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class class_name {
// The first letter of class name should be UPPER CASE
WebDriver driver;
public static void main(String[] args) {
System.setProperty(“webdriver.chrome.driver”,”path of driver/chromedriver.exe”);
//using chrome driver for coding
ChromeDriver driver = new ChromeDriver();
//Maximize the driver
driver.manage().window().maximize();
//Open the URL
driver.get(“https://www.sbi.co.in/portal/web/home/emi-calculator/ “);
//Enter the EMI amount
driver.findElement(By.name(“uamount”)).sendKeys(“5000”);
//Enter the EMI interest rate
driver.findElement(By.name(“uTime”)).sendKeys(“10”);
//Enter the EMI Time Period
driver.findElement(By.name(“uRate”)).sendKeys(“7”);
//Click on submit button
driver.findElement(By.xpath(“.//*[@id=’content-area’]/form/table/tbody/tr[3]/td/p/input[1]”)).click();
//Getting the EMI value
String aaa;
//Storing the EMI Value
aaa= driver.findElement(By.name(“uEmi”)).getAttribute(“value”);
//Displaying the EMI value
System.out.println(aaa);
//Storing the EMI Calculated
String bbb= driver.findElement(By.name(“totalint”)).getAttribute(“value”);
//Printing the EMI Calculated
System.out.println(bbb);
//Closing the driver
driver.close();
}
}