-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssignment140_.java
More file actions
39 lines (24 loc) · 1.12 KB
/
Assignment140_.java
File metadata and controls
39 lines (24 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package BasicsSelenium;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class Assignment140_ {
public static void main(String[] args) {
ChromeDriver driver = new ChromeDriver(); // automating the chromedriver
driver.get("https://grotechminds.com/payments/"); // get method to open the perticular website
driver.manage().window().maximize(); // this syntax is for max the tab. **it is not mandatatory
WebElement CC = driver.findElement(By.xpath("//input[@id='cardNumber']"));
CC.sendKeys("7894561230");
WebElement Ex = driver.findElement(By.xpath("//input[@placeholder='MM/YYYY']"));
Ex.sendKeys("02/1998");
WebElement CV = driver.findElement(By.xpath("//input[@maxlength='3']"));
CV.sendKeys("789");
WebElement Amount = driver.findElement(By.xpath("//input[@min='0']"));
Amount.sendKeys("5000");
WebElement CBox = driver.findElement(By.xpath("//input[@type='checkbox']"));
CBox.click();
WebElement Mpayment = driver.findElement(By.xpath("//input[@type='submit']"));
Mpayment.click();
driver.quit();
}
}