Is there any way, how I can to identify two xpath values in one.
I have text located somewhere on web page, on another page it exists in same element, but has different xpath. See below two variants:
Variant1: .//*[@id='quote_1']/div[2]/div[1]/div[1]/div[1]/p[2]
Variant2: .//*[@id='quote_1']/div/div[1]/div[1]/div[1]/div[2]/div[3]/span[2]
I’m looking how I can combine these two xpath’s to one like the following:
xpath = Variant1 or Variant2;
Thank you.
The XPath union operator
|is probably what you are asking for:This XPath expressions selects the union of two nodesets:
All nodes selected by
.//*[@id='quote_1']/div[2]/div[1]/div[1]/div[1]/p[2]All nodes selected by
.//*[@id='quote_1']/div/div[1]/div[1]/div[1]/div[2]/div[3]/span[2]