I have around 40-50 elements to check in a page using Selenium WebDriver and I am using the code below to check each element. Can someone please tell me what is the best way to do such testing if I have many elements in one page. Boolean. What I am doing now is:
isPresentquote_graph_displayed = driver.findElements(element1).size() > 0;
isPresentquote_graph_displayed = driver.findElements(element2).size() > 0;
isPresentquote_graph_displayed = driver.findElements(element3).size() > 0;
isPresentquote_graph_displayed = driver.findElements(element4).size() > 0;
Like this I am writing each of the 40 to 50 elements and checking if the boolean value is true or false. I was wondering if there is any better way to do this?