How to concatenate two xpath values | Selenium Forum
M
Posted on 17/06/2016
hi all,

is it possible to concatenate two xpath values


List<WebElement> elem = driver.findElements(firstPart+lastpart);

i.e the final By firstPart, final By lastPart are coming from a function

Thanks

Regards
J

M
Replied on 17/06/2016

yes it is possible.


M
Replied on 20/06/2016

can you provide some sample pls


M
Replied on 20/06/2016

this looks fine

String firstPart=//some xpath
String lastpart=//rest of xpath

List<WebElement> elem = driver.findElements(firstPart+lastpart);


M
Replied on 03/08/2016

For two string it looks fine, how about two WebElement which is of Type By


M
Replied on 03/08/2016

cannot work with webelement.