Full Code
Full Code
Full Code
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.By.ByXPath;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Action;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.Select;
import io.github.bonigarcia.wdm.WebDriverManager;
driver.findElement(By.xpath(" //*[@id=\"quantity_wanted\"]")).clear();
driver.findElement(By.xpath("
//*[@id=\"quantity_wanted\"]")).sendKeys("5");
WebElement size = driver.findElement(By.xpath("//*[@id=\"group_1\"]"));
Select sizeupdate = new Select(size);
sizeupdate.selectByVisibleText("M");
driver.findElement(By.xpath(" //*[@id=\"color_14\"]")).click();
driver.findElement(By.xpath("
//*[@id=\"add_to_cart\"]/button/span")).click();
Thread.sleep(2000);
WebElement textdisplayed =
driver.findElement(By.xpath("//*[@id=\"layer_cart\"]/div[1]/div[1]/h2"));
String text= textdisplayed.getText();
System.out.println(text);
//Thread.sleep(2000);
WebElement proceedButton =
driver.findElement(By.xpath("//*[@id=\"layer_cart\"]/div[1]/div[2]/div[4]/a/
span"));
proceedButton.click();
WebElement element =
driver.findElement(By.xpath("//*[@id=\"header\"]/div[3]/div/div/div[3]/div/a\r\n"
+ ""));
Actions action = new Actions(driver);
action.moveToElement(element).perform();
{
System.out.println(alltags.get(i).getText());
}
//WebElement dropbox =
driver.findElement(By.xpath("//*[@id=\"selectProductSort\"]"));
//Select select = new Select(dropbox);
//select.selectByIndex(5);