0
votes

This question is regarding an issue i am facing when copied an existing framework to a new set up. It worked before with another company. I cant figure out what is wrong in the html format. Web automation with selenium java with testNG I used to output screenshot links to testng emailable report using reporter.log. The functionality was working before with same framework in my previous project. Now I imported the project to reuse framework, everything else is working as expected but the html report showing raw html tag for a linked screenshot. Screenshot creation successful and the png file is in the specified path.

Emailable report showing following raw html :

<a href='C:\Users\kk\Desktop\New folder\SCREENSHOTS\TEST_11_07_2019_12_35_48.png'><img src='C:\Users\kk\Desktop\New folder\SCREENSHOTS\TEST_11_07_2019_12_35_48.png' height='500' width = '1021'></a>

Expected a clickable thumbnail of size 500x1021 pointing to original image.

Tried following : -Update webdriver version to match chrome version (75) -Replace single quotes with double quotes in the html tag -Tried to output a working mailto link to emailable report Always the html code not rendered, showing raw html

public void getScreenShot(String name, WebDriver dr) {

<CODE FOR screenshot capture and name and save here>...

// To help linking screenshots in testNG report
Reporter.log("<a href='" + destFile.getAbsolutePath() + "'><img src='" + destFile.getAbsolutePath()+ "' height='500' width = '1021'></a>");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
1
Check out the suggestions/info in this question. - Jonathan Cole

1 Answers

0
votes

Eventually resolved the issue by downgrading Eclipse IDE to Oxygen.