I am trying to add a variable to an xpath but to no avail
This works below for java assertTrue("Failed", verifyElementPresent("//*[@class='StdLJText' and contains(.,'2 Employees selected')]"));
but when I add a variable , like below it does not
String CountEmp1="2"; assertTrue("Failed", verifyElementPresent("//*[@class='StdLJText' and contains(.,CountEmp1+'Employees selected')]"));
2Employees selected2 Employees selectedwhereas you want to parameterise the number part so you need to add the space between the number and theEmployees selectedpart like thisCountEmp1+' Employees selected'(note the space before theE). You are usingcontainswhich will try to match the text exactly.