I’m executing some of my test cases on Jenkins windows server and on failure of Test it take screenshots and display in html report.
But the issue is if test title is bit long and exceeded specific no of characters, On windows server the screenshot path name is automatically being converted into 8.3 naming convention.
First of All this issue is due to window 260 character limitation for file path for which I have tried below solutions.
-
I just came accross Different Solutions like in Registery Editor
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlFileSystem
set LongPathEnable value to 1. -
Similarly Enable Long path in Group policy
> Administrative Templates > System > Filesystem > Enable NTFS long paths
I tried both but System was still displaying file path in 8.3 naming conversion like below
C:PROGRA~3JenkinsJENKIN~1WORKSP~1OrderAppNEXTGE~1LAMBDA~1F6BBA7~1chrome127.0UHKFH-~1SCREEN~1NASTYG~1.TS
And I’m not able to use this kind of path in my report to fetch file.
Than I found another solution to disable 8.3 naming conversion via COMMAND
fsutil 8dot3name set c: 1
It has disabled the 8.3 naming convention and path name look like this which is starting with prefix \?
instead of C:\ProgramData
.
\?C:ProgramDataJenkins.jenkinsworkspaceOrderAppOrderAppStaging\dynamicSessionIDchromeDynamicTestIDTestFolderscreenshotsnastyGal.cy.tsUser_can't_Create_Order_with_Invalid_Price.png ```
And the other main issue is with this solution is that it's not only not rendering in HTML report but " File doesn't open Now in Server VM ".
Can someone guide about how to tackle this issue?
Note: Same code working fine for Linux OS. Issue is just due to Windows 260 character limitation.