In Tableau Server the tables are images. Almost everything is image.
You cannot automate the things in this way. The only way for automate the testing is to get crosstab values in CSV and compare does values. With the VizQL rest api you can also create test cases like "open viz" "click on things" "apply selections" "save table result in csv". however, for this, you must use the vizql api which is not documented at all.