diff --git a/e2e/search-page/search-page.po.ts b/e2e/search-page/search-page.po.ts index b5e43dcf82..b1a17ee150 100644 --- a/e2e/search-page/search-page.po.ts +++ b/e2e/search-page/search-page.po.ts @@ -39,8 +39,8 @@ export class ProtractorPage { getRandomScopeOption(): promise.Promise { const options = element(by.css('select[name="scope"]')).all(by.tagName('option')); return options.count().then((c: number) => { - const index: number = Math.floor(Math.random() * c); - return options.get(index).getAttribute('value'); + const index: number = Math.floor(Math.random() * (c - 1)); + return options.get(index + 1).getAttribute('value'); }); }