Hi all,
I have to loop and select different options in every iteration and perform some tasks. So for clicking different options in each iteration of for loop I need to modify xpath at run time so that desired option is clicked in each iteration of for loop. Below is the pic of different options need to be clicked -
However, in my code modifyObjectProperty doesn’t modify the xpath to new value in each iteration. It takes old xpath value of the option object and keeps clicking the same button in each iteration.Below is my code -
for (int i = 2; i <= 13; i++) {
WebUI.click(findTestObject(‘Intentwise/Overview/BiggestChanges/BiggestChangesByCampaigns/metrics_sel_dropdown’))
String xpath_val = '/html/body/div[9]/md-select-menu/md-content/md-option['+ i +']'
KeywordUtil.logInfo('xpath_val---> ' + xpath_val)
mul_metrics_opt = WebUI.modifyObjectProperty(findTestObject('Intentwise/Overview/BiggestChanges/BiggestChangesByCampaigns/metrics_mult_option'),
'xpath', 'equals', xpath_val, true)
WebUI.click(mul_metrics_opt)
}
Below is the logs :
Kindly help me in executing this. Any suggestions are welcome.
@kazurayam please can you help me solving this issue? Thanks in advance.