I have a table where i have certain links. As this table is very dynamic, i want to search for a link.
this.invoiceTable.element(by.cssContainingText('a','1616050'));
If not found on current page, i want to click on Next 30 records button to get next 30 records.
this.invoiceTable.element(by.cssContainingText('a','Next 30')).click();
and again start searching for previous link on next page. I am not sure how to achieve this and what error should i record for element not found so that it click on Next 30 link and again start searching.
Can someone help with right approach to record error for element not found in table and then click next button followed by search again?
Tried using below code but it is throwing error on calling test()
test() {
var invoicetable1 = element(by.css('[id$="MainContent_uxInvoiceList"]'));
browser.isElementPresent(by.cssContainingText('a','1626547')).then(function(isPresent) {
if (isPresent) {
invoicetable1.element(by.cssContainingText('a','1626547')).click();
} else {
invoicetable1.element(by.cssContainingText('a','Next 30 Invoices')).click();
test();
}
});
}