Hej.
Prośba.
Uczę się Selenium, choć raczej zaczynam się uczyć.
Robię symulację zamówienia albumu Metallici z Amazonu.
Wpisanie adresu i wyszukanie idzie ok ale potem za chiny nie chce kliknać w album.
Próbowałem po klasie, dalej nie idzie :-/
Mój kod :
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class BaseTest
{
public static void main(String[] args)
{
System.setProperty("webdriver.chrome.driver", "src/drivers/chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("https://www.amazon.com/");
driver.findElement(By.id("twotabsearchtextbox")).sendKeys("Metallica");
driver.findElement(By.className("nav-input")).click();
driver.findElement(By.className("a-size-medium s-inline s-access-title a-text-normal")).click();
}
}
Z kolei źródło strony to