let locator = "//td[contains(@class, 'deep-purple')]"; let firstxLocationAndColorAsArray = await getLocationDetails( page, locator, "Array" ); if ( firstxLocationAndColorAsArray[1] == 0 && firstxLocationAndColorAsArray[4] == 8 ) { await solveCM1(page); } else if ( firstxLocationAndColorAsArray[1] == 0 && firstxLocationAndColorAsArray[4] == 2 ) { await solveCM4(page); }