How to merge 2 xpath together
- (//input[@type=‘text’])[7]
- (//input[@type=‘text’])[12]
How to merge 2 xpath together
|
operator : union of node-sets
(//input[@type='text'])[7] | (//input[@type='text'])[12]
or
operator in predicate
(//input[@type='text'])[position()=7 or position()=12]
Getting this error
Loop FAILED.
Reason:
com.kms.katalon.core.exception.StepFailedException: Unable to set text ‘Biscuit’ of object ‘Object Repository/DGTX_WEB/Price_List/Enter Item1_Code_In_Price_List - Copy’
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26)
at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword.setText(SetTextKeyword.groovy:66)
at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword.execute(SetTextKeyword.groovy:37)
This message proves that the XPath expression
(//input[@type=‘text’])[7] | (//input[@type=‘text’])[12]
is syntactically valid. It worked and selected an <input>
element. I think, your original question has been answered.
You haven’t disclosed information about your system+test. Please have a look at the following guidance.