I'm using Selenium with Java from the Mavenproject.
My code is working, I'm just wondering if it can be improved. In the code below you can see I'm looking for a few elements and if they are displayed or not.
The issue is that I'm looking for tons of elements +- 50. So I have about 50 of these lines. I'm struggling to find a more efficient way. Isn't a easier way of writing this down in 1 line searching for multiple elements and checking if all are displayed?
Like Find.... A,B,C,D,...,Y,Z .isDisplayed?
boolean function_detail_breadcrumb_1_displayed = driver.findElement(By.cssSelector("[data-core2='403']")).isDisplayed();
boolean function_detail_breadcrumb_2_displayed = driver.findElement(By.cssSelector("[data-core2='405']")).isDisplayed();
boolean function_detail_breadcrumb_3_displayed = driver.findElement(By.cssSelector("[data-core2='407']")).isDisplayed();
boolean function_detail_breadcrumb_4_displayed = driver.findElement(By.cssSelector("[data-core2='410']")).isDisplayed();
boolean function_detail_breadcrumb_5_displayed = driver.findElement(By.cssSelector("[data-core2='413']")).isDisplayed();