Xpath to find span and div elements under an ancestor element.
ancestor_element
---------------//span
---------------//div
---------------//input
Suppose the xpath is a_very_complex_xpath_to_find_the_ancestor_element for the ancestor_element. It is very complex.
(a_very_complex_xpath_to_find_the_ancestor_element//span) | (a_very_complex_xpath_to_find_the_ancestor_element//div)
The above union slows down the performance greatly. Is there a better Xpath for union? Tried the following:
a_very_complex_xpath_to_find_the_ancestor_element//(span | div)
It is not working.