lundi 20 septembre 2021

computation on list using robot framework

I have table in which having 10 elements.

(//td[@class='psr-text small'])[1]
(//td[@class='psr-text small'])[2]
(//td[@class='psr-text small'])[3]
(//td[@class='psr-text small'])[4]
(//td[@class='psr-text small'])[5]
(//td[@class='psr-text small'])[6]
(//td[@class='psr-text small'])[7]
(//td[@class='psr-text small'])[8]
(//td[@class='psr-text small'])[9]
(//td[@class='psr-text small'])[10]

Even Aray of xpath contains names, Odd Aray of xpaths contains values.

I am trying to apply loop to get All even arays of xpath values to be stored in 1 list and all odd arays of xpaths values to be stored in another list.

Can any one please help me.

here I tried below.

${Count}= get element count 10
FOR ${i} IN RANGE 1 ${Count}
Exit For Loop If ${i} == ${Count}
Run Keyword if "${Count}%2" == "0"
... xpath=(//td[@class='psr-text small'])[${count}]
${region}= get text (//td[@class='psr-text small'])[${Count}]
... ELSE
${Bin}= get text xpath=(//td[@class='psr-text small'])[${count}]
END

Aucun commentaire:

Enregistrer un commentaire