I am in search of conditional XPath syntax. My xpath is as follows:
//div[@id='contenttext']/form/table/tbody/tr[7]/td[2]/input[1]
Now the scenario is that the above mentioned input field can be found at tr[7]
(already mentioned) and tr[6]
.
So in brief I need one syntax to test that the input field should be present either at tr[7] or tr[6]. i.e.:
//div[@id='contenttext']/form/table/tbody/tr[7]/td[2]/input[1]
//div[@id='contenttext']/form/table/tbody/tr[6]/td[2]/input[1]
Both the above mentioned XPath should be combined and the test should return true if the input[1]
is present at either tr[7]
or tr[6]
.
PS: tr[position()=7 or position()=6]
is not working. The code tries to find the element at lower position mentioned. i.e tr[6]