-
Notifications
You must be signed in to change notification settings - Fork 1
/
AddtoCardTest.java
51 lines (51 loc) · 1.89 KB
/
AddtoCardTest.java
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
40
41
42
43
44
45
46
47
48
49
50
51
// Generated by Selenium IDE
import org.junit.Test;
import org.junit.Before;
import org.junit.After;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.core.IsNot.not;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.Alert;
import org.openqa.selenium.Keys;
import java.util.*;
import java.net.MalformedURLException;
import java.net.URL;
public class AddtoCardTest {
private WebDriver driver;
private Map<String, Object> vars;
JavascriptExecutor js;
@Before
public void setUp() {
driver = new ChromeDriver();
js = (JavascriptExecutor) driver;
vars = new HashMap<String, Object>();
}
@After
public void tearDown() {
driver.quit();
}
@Test
public void addtoCard() {
driver.get("http://localhost/online-shopping-system/public_html/category.php?cid=4");
driver.manage().window().setSize(new Dimension(1258, 714));
driver.findElement(By.cssSelector(".col-sm-6:nth-child(1) a > .btn")).click();
driver.findElement(By.cssSelector(".outer-left-xs")).click();
driver.findElement(By.cssSelector(".dropdown-toggle:nth-child(3)")).click();
driver.findElement(By.cssSelector(".col-sm-6:nth-child(1) a > .btn")).click();
driver.findElement(By.name("ordersubmit")).click();
driver.findElement(By.cssSelector("input:nth-child(3)")).click();
driver.findElement(By.name("submit")).click();
}
}