@Test(dependsOnMethods = "getSearchResultsWithException", groups = "Enterprise-only", expectedExceptions = IllegalArgumentException.class) public void getSearchResultsWithIllegalArgException() throws Exception { nodeBrowserPage.getSearchResults(""); }
public List<NodeBrowserSearchResult> getSearchResults() { List<WebElement> results; List<NodeBrowserSearchResult> searchResultsList = new ArrayList<>(); try { results = drone.findAndWaitForElements(SEARCH_RESULT, WAIT_TIME_3000); for (WebElement result : results) { NodeBrowserSearchResult nodeBrowserSearchResult = new NodeBrowserSearchResult(); nodeBrowserSearchResult.setName(new ShareLink(result.findElement(NODE_BROWSER_RESULT_NAME), drone)); nodeBrowserSearchResult.setParent(result.findElement(NODE_BROWSER_RESULT_PARENT).getText()); nodeBrowserSearchResult.setReference(new ShareLink(result.findElement(NODE_BROWSER_RESULT_NODEREF), drone)); searchResultsList.add(nodeBrowserSearchResult); } return searchResultsList; } catch (StaleElementReferenceException e) { return getSearchResults(); } catch (TimeoutException e) { if (logger.isTraceEnabled()) { logger.trace("No results found"); } } catch(NoSuchElementException nse) { if(logger.isTraceEnabled()) { logger.trace(nse.getMessage()); } } return Collections.emptyList(); }
NodeBrowserPage extends AdminConsolePage { public List<NodeBrowserSearchResult> getSearchResults() { List<WebElement> results; List<NodeBrowserSearchResult> searchResultsList = new ArrayList<>(); try { results = drone.findAndWaitForElements(SEARCH_RESULT, WAIT_TIME_3000); for (WebElement result : results) { NodeBrowserSearchResult nodeBrowserSearchResult = new NodeBrowserSearchResult(); nodeBrowserSearchResult.setName(new ShareLink(result.findElement(NODE_BROWSER_RESULT_NAME), drone)); nodeBrowserSearchResult.setParent(result.findElement(NODE_BROWSER_RESULT_PARENT).getText()); nodeBrowserSearchResult.setReference(new ShareLink(result.findElement(NODE_BROWSER_RESULT_NODEREF), drone)); searchResultsList.add(nodeBrowserSearchResult); } return searchResultsList; } catch (StaleElementReferenceException e) { return getSearchResults(); } catch (TimeoutException e) { if (logger.isTraceEnabled()) { logger.trace("No results found"); } } catch(NoSuchElementException nse) { if(logger.isTraceEnabled()) { logger.trace(nse.getMessage()); } } return Collections.emptyList(); } }
NodeBrowserPage extends AdminConsolePage { public List<NodeBrowserSearchResult> getSearchResults() { List<WebElement> results; List<NodeBrowserSearchResult> searchResultsList = new ArrayList<>(); try { results = drone.findAndWaitForElements(SEARCH_RESULT, WAIT_TIME_3000); for (WebElement result : results) { NodeBrowserSearchResult nodeBrowserSearchResult = new NodeBrowserSearchResult(); nodeBrowserSearchResult.setName(new ShareLink(result.findElement(NODE_BROWSER_RESULT_NAME), drone)); nodeBrowserSearchResult.setParent(result.findElement(NODE_BROWSER_RESULT_PARENT).getText()); nodeBrowserSearchResult.setReference(new ShareLink(result.findElement(NODE_BROWSER_RESULT_NODEREF), drone)); searchResultsList.add(nodeBrowserSearchResult); } return searchResultsList; } catch (StaleElementReferenceException e) { return getSearchResults(); } catch (TimeoutException e) { if (logger.isTraceEnabled()) { logger.trace("No results found"); } } catch(NoSuchElementException nse) { if(logger.isTraceEnabled()) { logger.trace(nse.getMessage()); } } return Collections.emptyList(); } NodeBrowserPage(WebDrone drone); }
NodeBrowserPage extends AdminConsolePage { public List<NodeBrowserSearchResult> getSearchResults() { List<WebElement> results; List<NodeBrowserSearchResult> searchResultsList = new ArrayList<>(); try { results = drone.findAndWaitForElements(SEARCH_RESULT, WAIT_TIME_3000); for (WebElement result : results) { NodeBrowserSearchResult nodeBrowserSearchResult = new NodeBrowserSearchResult(); nodeBrowserSearchResult.setName(new ShareLink(result.findElement(NODE_BROWSER_RESULT_NAME), drone)); nodeBrowserSearchResult.setParent(result.findElement(NODE_BROWSER_RESULT_PARENT).getText()); nodeBrowserSearchResult.setReference(new ShareLink(result.findElement(NODE_BROWSER_RESULT_NODEREF), drone)); searchResultsList.add(nodeBrowserSearchResult); } return searchResultsList; } catch (StaleElementReferenceException e) { return getSearchResults(); } catch (TimeoutException e) { if (logger.isTraceEnabled()) { logger.trace("No results found"); } } catch(NoSuchElementException nse) { if(logger.isTraceEnabled()) { logger.trace(nse.getMessage()); } } return Collections.emptyList(); } NodeBrowserPage(WebDrone drone); @SuppressWarnings("unchecked") @Override NodeBrowserPage render(RenderTime renderTime); @SuppressWarnings("unchecked") @Override NodeBrowserPage render(long l); @SuppressWarnings("unchecked") @Override NodeBrowserPage render(); void fillQueryField(String query); HtmlPage clickSearchButton(); void selectStore(Store store); void selectQueryType(QueryType queryType); boolean isSearchResults(); int getSearchResultsCount(); boolean isOnSearchBar(String regExp); boolean isInResultsByNodeRef(String regExp); boolean isInResultsByName(String regExp); List<NodeBrowserSearchResult> getSearchResults(); NodeBrowserSearchResult getSearchResults(String name); }
NodeBrowserPage extends AdminConsolePage { public List<NodeBrowserSearchResult> getSearchResults() { List<WebElement> results; List<NodeBrowserSearchResult> searchResultsList = new ArrayList<>(); try { results = drone.findAndWaitForElements(SEARCH_RESULT, WAIT_TIME_3000); for (WebElement result : results) { NodeBrowserSearchResult nodeBrowserSearchResult = new NodeBrowserSearchResult(); nodeBrowserSearchResult.setName(new ShareLink(result.findElement(NODE_BROWSER_RESULT_NAME), drone)); nodeBrowserSearchResult.setParent(result.findElement(NODE_BROWSER_RESULT_PARENT).getText()); nodeBrowserSearchResult.setReference(new ShareLink(result.findElement(NODE_BROWSER_RESULT_NODEREF), drone)); searchResultsList.add(nodeBrowserSearchResult); } return searchResultsList; } catch (StaleElementReferenceException e) { return getSearchResults(); } catch (TimeoutException e) { if (logger.isTraceEnabled()) { logger.trace("No results found"); } } catch(NoSuchElementException nse) { if(logger.isTraceEnabled()) { logger.trace(nse.getMessage()); } } return Collections.emptyList(); } NodeBrowserPage(WebDrone drone); @SuppressWarnings("unchecked") @Override NodeBrowserPage render(RenderTime renderTime); @SuppressWarnings("unchecked") @Override NodeBrowserPage render(long l); @SuppressWarnings("unchecked") @Override NodeBrowserPage render(); void fillQueryField(String query); HtmlPage clickSearchButton(); void selectStore(Store store); void selectQueryType(QueryType queryType); boolean isSearchResults(); int getSearchResultsCount(); boolean isOnSearchBar(String regExp); boolean isInResultsByNodeRef(String regExp); boolean isInResultsByName(String regExp); List<NodeBrowserSearchResult> getSearchResults(); NodeBrowserSearchResult getSearchResults(String name);  }