I am using Selenium in Grafana, I want to be able to extract the text from one of the panels. I am beginner to Selenium hence not able to understand why this error.
Using Chro Path Utility, I have found the Relative XPath. Now I have to run the same code for multiple panels, hence I have my code as:
xpathTitle = "//span[contains(text(),'" + title + "')]"
browser.find_element_by_xpath(xpathTitle).click()
title
is where I pass my Panel titles.
After running the program, I get the following error:
Message: no such element: Unable to locate element: {"method":"xpath","selector":"//span[contains(text(),'Cadvisor')]"}
I cannot use cssSelector or Absolute Path because the location of my Panel is not fixed across number of dashboards.
Can anyone help me with how to handle this? Any help will be appreciated.
Thank you.