Right now I use the below method in my BasePage and I wish to call this method to my other pages.
So in the below method, the parameter is (String xpathExpression), How do I change this to WebElement and use other element locators which will be defined in other pages.
protected boolean CheckSorting(String xpathExpression) {
List<WebElement> issueTypeDropdown = new LinkedList<>(driver.findElements(By.xpath(xpathExpression)));
LinkedList<String> issueTypes = new LinkedList<String>();
for (int i = 0; i < issueTypeDropdown.size(); i++) {
//System.out.println(issueTypeDropdown.get(i).getText());
issueTypes.add(issueTypeDropdown.get(i).getText());
}
return Compare(issueTypes);
}