Dears,
i have issue with dynamic xpath since in my application most componant i’ve called them like the below xpath quiery:
(.//*[text()=“User name”]/following::input[@type=“text”])[1]
it’s working well with me when testing the object but my issue with arabic version, how i can pass parameter to the xpath to use the arabic and english version without re-recording the whole script in arabic version
Dear @@4280-kazurayam
i have tried the provided solution without success if you tied it please provide me with your stepes since what i want to have that index variable to declare it in my code if it’s 1 refer to English and 2 refer to Arabic that’s it.
then I wrote below code:
WebUI.click(findTestObject(‘Page_AddClient/selectIndustryName’, [(‘index’) : 1]))
but it failed with error:
Test Cases/AddClientFlow1 FAILED because (of) Unable to click on object ‘Object Repository/Page_AddClient/selectIndustryName’ (Root cause: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/Page_AddClient/selectIndustryName’ located by 'By.xpath: //*[@1"]/span/div/div’ not found)
there is another problem, 24 in xpath changes on each run, can i use regular expression in xpath like ‘'to substitute 24 like below: ( i dont know the correct syntax, just a raw code]
//[@id="ui-select-choices-row-[’*’]-${index}"]/span/div/div
there is another problem, 24 in xpath changes on each run, can i use regular expression in xpath like ‘'to substitute 24 like below: ( i dont know the correct syntax, just a raw code]
//[@id="ui-select-choices-row-[’*']-${index}"]/span/div/div
Raw code for using regular expression in xpath. Can someone please suggest?
But not enough. Your Test Case script must have a line which interpolates the value CHF into the place holder ${currency} in the selector. That line would look something like this: