How to retrieve DIV id for the child element?

How to retrieve DIV id for the child element?

I have an div id which starts with ht_ I need to retrieve this and based on this I must construct the XPath and this id changes dynamically every time.

I cannot use this –

 

Because the ID here changes so based on XPath cannot be captured.

I must capture the DIV id of the parent all grid and from the parent I need to capture the child div id.

How can this be achieved please help?

Thanks,
SD

Train Asked on July 13, 2016 in Selenium WebDriver.
Add Comment
  • 1 Answer(s)

    HI SD,

    you can directly try
    //div[@id=’all-grid’]/div

    Regards
    Ankit

    Vice Professor Answered on July 13, 2016.
    Add Comment
  • Your Answer

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