-2

I use WebDriver and ChromeDriver. How i can fetch text from this speech bubble:

[click to see picture 1]

And code this speech bubble from website:

click to see picture 2

Thank you for your help!

Tarun Lalwani
  • 124,930
  • 8
  • 149
  • 214
David
  • 5
  • 5

3 Answers3

0

Use xpath to get it

 //img[@data-id='c085ede491334747f26718fc2e8009e3')]

You can use this code and try:

driver.findElement(By.xpath("//img[@data-id='c085ede491334747f26718fc2e8009e3')]")).getAttribute("data-content");
iamsankalp89
  • 4,242
  • 2
  • 12
  • 35
0

Looks like id is dynamic. You can try to use the phrase in data content for searching:

findElement(By.xpath(".//img[@data-content = "your text"])).getAttribute("data-content");

If you need to get text and validate it (e.g. text inside of data content can be different), you can search by class:

driver.findElement(By.className("smarty-tip-wrapper")).getAttribute("data-content");
Boghyon Hoffmann
  • 13,472
  • 7
  • 49
  • 114
0

Maybe the problem is everything is included in the table? if i think well

click to see

eyllanesc
  • 190,383
  • 15
  • 87
  • 142
David
  • 5
  • 5