I am navigating to https://www.amazon.com/
there I am looking for 'samsung tv 55 inch' setting it in the search box text field
then I am trying to extract the text of (63 results [see image attached]):
I can't find the correct locator and how to find it, this is my code:
package com.bottomline.automation.tests.ui;
import com.bottomline.automation.pageobjects.model.AmazonWebPage;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class AmazonTest extends BaseTest {
AmazonWebPage amazonWebPage;
@BeforeClass
public void setup() {
amazonWebPage = new AmazonWebPage(driverWrapper);
}
@Test(priority = 10)
public void navigateToAmazonWebPage(){
amazonWebPage.navigateAndVerify();
}
@Test(priority = 20)
public void searchForHarryPotter(){
amazonWebPage.setSearchTextSearchBox("samsung tv 55 inch");
}
}
I am struggling in finding the correct locator in order to get the result text