Локатор определен, но выскакивает ошибка.
@FindBy(xpath = "//div[@class='rt-tbody']")
private WebElement booksWrapper;
public boolean areBooksMatch(List<Book> booksFromApi) {
waitElementIsVisible(driver.findElement((By) booksWrapper));
String uiBooks = booksWrapper.getText();
for (Book book : booksFromApi) {
if (uiBooks.contains((CharSequence) book)) {
return true;
}
}
return false;
}
public class BookStoreTest extends BaseTest {
@Test
public void find() {
HomePage home = new HomePage(driver);
RestAssured.baseURI = "https://demoqa.com/BookStore/V1/Books";
RequestSpecification request = RestAssured.given();
Response response = request.get();
JsonPath jsonPathEvaluator = response.jsonPath();
Assert.assertEquals(response.getStatusCode(), 200);
List<Book> allBooks = jsonPathEvaluator.getList("books.title");
home.areBooksMatch(allBooks);
}
Подскажите, в чем проблема может быть?