How to pass a variable string within the xpath to identify an element in Selenium and Java?
Code trials:
System.out.println("Name:\n");
String name = sc.nextLine();
System.out.println("Enter the no. of messages:\n");
int count = sc.nextInt();
System.out.println("Enter what you want to send:\n");
String mess = sc.next();
System.out.println("Enter anything after you have scanned the QR");
String a = sc.next();
driver.findElement(By.xpath("//span[@title='Rinmay AEI']")).click();
I want my user input name
String to be placed instead of 'Rinmay AEI'