After set varible it shows as p instead of //div[text()='Work Type']/../../div/div/button[@disabled][1]
${xpath}= //div[text()='Work Type']/../../div/div/button[@disabled]
${elements}= Get WebElements ${xpath}
FOR ${row_index} IN RANGE 1 ${elements.__len__()}+1
${updated_xpath}= Set Variable ${xpath}[${row_index}]
Log ${updated_xpath}
${text}= Get Text ${updated_xpath}
END
why Afer Set Variable it shows Log output as p instead of //div[text()=‘Work Type’]/…/…/div/div/button[@disabled][1]