• JAVA program to add top two maximum number of an Array.

    August 17, 2020 by

    Below program i have written to add top two max number of an Array: package com.company;public class ArrayDemo { public int addAge(int [] age){ int largest = age[0]; int secondlargest = age[0]; for (int i=1;i<age.length;i++){ if ( age[i] > largest ){ secondlargest = largest; largest = age[i]; } if (age[i] < largest && age[i] >… Read more

  • Selenium – For loop to navigate to the web element list and verify list item.

    July 24, 2020 by

    Step 1: Store item of the list in a List using findElements List<WebElement> searchResultlist = Driver.driver.findElements(By.xpath(“//span[@class=’document-name’]”)); Step 2: Use for loop to traverse in the list and verify the text using IF condition. To make sure input by the user and text from the application are in same case, convert both the strings in UPPER… Read more

View all posts

Follow My Blog

Get new content delivered directly to your inbox.