Currently trying to test out the responsiveness on webdriverio. I adjust the viewport of my screen and then try to search for a table that exists at the bottom of the page (need to scroll to get into view port). For some reason, it can't locate the element and the test case fails.
it('should resize the table when screen width is mobile', () => {
let mobileTable = $('.overview-table.mobile-table');
browser.setViewportSize({
width: 767,
height: 500
});
//browser.pause(1500);
mobileTable.waitForExist(10000);
console.log(mobileTable);
mobileTable.scroll();
browser.debug();
});
I'm not sure if I'm getting the element right in the above code. I set mobileTable = $('.overview-table.mobile-table') because it is a table element with those classes
<table class="overview-table mobile-table"> ... </table>
I get the following error:
An element could not be located on the page using the given search parameters (".overview-table.mobile-table").
running firefox
Error: An element could not be located on the page using the given search parameters (".overview-table.mobile-table").
at scroll() - index.js:312:3