XpathCSS Selector for dynamic web element | Selenium Forum
I
IUE CHIEN Posted on 09/04/2019

Hi,

    I am trying to locate a dynamic web element as below. Can you show me the strategy for xpath and Csslocator for this web element? As you can see, id change every time I go to this page.

 

//*[@id="1554761514232-grid-container"]/div[2]/div/div[8]/div/div/div[1]/div

//*[@id="1554753793544-grid-container"]/div[2]/div/div[8]/div/div/div[1]/div

//*[@id="1554753878492-grid-container"]/div[2]/div/div[8]/div/div/div[1]/div

//*[@id="1554754271807-grid-container"]/div[2]/div/div[8]/div/div/div[2]/div

 

 


A
Ashish Thakur Replied on 09/04/2019

Please look for the element with some non dynamic id or name, then generate the relative xpath according to that element