I am wondering weather it is possible to reach tree elements in a Java RCP-Client which display a file system by using googles windowtester pro.
The tree (swt widget) shows my local file system (C:\Users...) much like the windows explorer (or TotalCommander, etc...).
Now I want to click the element
C:\Users\me\Folder\file1.txt
After recording, windowtester tells me to do the folliwing:
ui.click(new TreeItemLocator( "C:\/Users/me/Folder/file1.txt", new ViewLocator( de.zeb.control.fw.vfs.pl.rcp.client.views.FileBrowserView" ));
But executing this code I get the error:
No tree items found for 'C:/Users' - wait then try again."
I also tried:
"C:/Users/me/Folder/file1.txt"
"\C:\/Users/me/Folder/file1.txt"
"C:\\/Users\/me\/Folder\/file1.txt"
And various combinations, none of which seem to work.
Does anyone have an idea here?
Regards!
Unfortunately escaping slashes is still a pain in WindowTester.
You have to look very carefully at the error message:
No tree items found for 'C:/Users' - wait then try again."
Compare this with the string given in the TreeItemLocator:
"C:\/Users/me/Folder/file1.txt"
Escaping the first slash obviously worked, but not the second one. So every forward slash needs to be prefixed with a backward slash. The correct string should then be:
"C:\/Users\/me\/Folder\/file1.txt"