RE: Select checkbox in WebTable whose ID changes Dynamically

I need to select a check box  in a web table whose ID keeps changing dynamically.

XPath  – .//*[@id=’ht_29ad853cf427c8fd’]/div[2]/div/div/div/table/thead/tr/th[1]

next time the ID of the table is

XPath –  .//*[@id=’ht_e67040a19393993a’]/div[2]/div/div/div/table/thead/tr/th[1]

Please suggest

SD Train Asked on November 4, 2015 in Selenium WebDriver.
Add Comment
3 Answers

Use this>>

.//*[starts-with(@id, ‘ht_’)]/div[2]/div/div/div/table/thead/tr/th[1]

   ) was missing from Virender Singh  answer.

Train Answered on November 12, 2015.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.