Q: How to create use test case to check whether reviews can be retrieved using selenium web driver and eclipse ide (AUTOMATED TESTING)? I am new to using selenium webdriver and conducting automated testing. I am trying to create a use test case to check that all the reviews in my application can be retrieved from Database(GET METHOD). So far I am able to check that all the forms in my web application are working (POST METHOD). I do this by getting the id of the html element then predefining the form fields as shown below (automated Login function using selenium webdriver).
@Test
    public void login() {
        System.setProperty("webdriver.chrome.driver", "C:\\Program Files\\Google\\Chrome\\chromedriver.exe");
        WebDriver driver = new ChromeDriver();
        driver.manage().window().maximize();
        driver.get("http://localhost:8080/DevopsAssignment/login.jsp");
        WebElement username = driver.findElement(By.id("YourUserName"));
        WebElement password = driver.findElement(By.id("YourPassword"));
        WebElement login = driver.findElement(By.id("login"));
        username.sendKeys("carolyn123");
        password.sendKeys("12345");
        login.click();
        String actualUrl = "http://localhost:8080/DevopsAssignment/LoginServlet";
        String expectedUrl = driver.getCurrentUrl();
        Assert.assertEquals(expectedUrl, actualUrl);
    }

The reason why I am confused is because if I check if the reviews exist by using the html id (for e.g. review box). The test case will fail if there are no reviews. Does anyone have any suggestion on how to work around this? Or if this test case is not even needed at all?
