Posts

Comprehensive Selenium WebDriver Syntax for Effective Test Automation

Comprehensive Selenium WebDriver Syntax for Effective Test Automation public static void main(String[] args ) throws InterruptedException, IOException { System. setProperty ( "webdriver.chrome.driver" , "./Drivers/chromedriver.exe" ); WebDriver driver = new ChromeDriver(); driver .manage().window().maximize(); driver .manage().timeouts().implicitlyWait(30, TimeUnit. SECONDS ); driver .get( "https://www.w3schools.com/html/html5_draganddrop.asp" ); //Actions MouseOver WebElement src = driver .findElement(By. xpath ( "//input[@id='name']" )); WebElement trg = driver .findElement(By. xpath ( "//input[@id='city']" )); Actions action = new Actions( driver ); action .dragAndDrop( src , trg ).build().perform(); action .contextClick( src ).build().perform(); action .moveToElement( src ).build().perform(); //DropDown WebElement country = driver .findElement(By. xpath ( "//input[text()='country']" )); Selec

Explore essential Java programs commonly asked in interviews, offering valuable coding insights and practice.

 Frequently Asked Java Program 1. Find Duplicate Word  public class DuplicateWordFinder { public static void main(String[] args ) { String input = "Tata,Swift,Audi,Mercedes,Tata,Renault" ; String[] word = input .split( "," ); Set<String> uniqWord = new HashSet<>(); for (String words : word ) { uniqWord .add( words .trim()); } for (String words : uniqWord ) { System. out .println( "Uniq Words are : " + words ); } } } 2.  Even Letter Print From String import java.util.Scanner; public class EvenLetterPrintFromString { public static void main(String[] args ) { // TODO Auto-generated method stub Scanner sc = new Scanner(System. in ); System. out .println( "Enter the Words: " ); String input = sc .nextLine(); for ( int i = 1; i <= input .length() - 1; i += 2) { System. out .println( input .charAt( i )); } } }   3. Remove special characters from string in java import java.util.Scanner; public class ExtractS