In my current setup, there is a table with five columns. The fifth column contains an image icon that changes randomly based on backend data. This image does not have a static id or class.
https://i.sstatic.net/pSuYD.png
The CSS for this setup looks like this:
https://i.sstatic.net/7PK3y.png
Using the code below, I was able to extract the text from column #4:
var temp = driverIE.FindElement
(By.XPath("//td[@class ='af_column_cell-text OraTableBorder1111'][4]"))
.GetAttribute("innerText");
I then attempted to retrieve the alt
or title
attributes of the image tag in column #5, but it returned null:
var temp = driverIE.FindElement
(By.XPath("//td[@class ='af_column_cell-text OraTableBorder1111'][5]/img"))
.GetAttribute("alt");
My goal is to store the value of either the title
or alt
attribute in a temporary variable, and based on its value, redirect control to a different method.