Importing "File System" [message #695506] |
Mon, 11 July 2011 18:08  |
Eclipse User |
|
|
|
Anyone know how to get SWTBot to import a "File System" into an existing project?
I can use SWTBot to create a new project, but when I try to import some existing files into the project using the "File -> Import -> General -> File System". there seems to be an issue with the "tree" widget in the "Import" dialog that does not allow it to get populated with the directory contents.
I use something like the following code (many variations of it as well, but nothing seems to work.)
bot.menu("File").menu("Import...").click();
bot.shell("Import").setFocus();
bot.tree().select("General").expandNode("General").select("File System");
bot.button("Next >").click();
SWTBotShell botShell = bot.shell("Import");
botShell.activate();
bot.comboBox().setFocus();
bot.comboBox().setText(path);
// At this point I have the "path" in the "From Directory" filled in, but after that point nothing I do will cause the tree item to be populated with the files in that path. I;ve tried selecting other widgets in the dialog, tabbing around, chaning the path and trying again to select other widgets or tab, but nothing seems to work.
Any ideas?
|
|
|
|
|
Re: Importing "File System" [message #696856 is a reply to message #696189] |
Thu, 14 July 2011 20:54  |
Eclipse User |
|
|
|
Hi, David:
I got this problem before, then i tried lots of ways, and finally, the following one works well for me, maybe you can have a try:
bot.text(0).setText(PROJECT_PATH);
bot.sleep(500);
Keyboard key = KeyboardFactory.getSWTKeyboard();
key.pressShortcut(Keystrokes.CR);
The text editor in this wizard page is not combobox. sometimes it's hard to locate this kind of widget especially when we are not familiar with related code. Hope it can help.
|
|
|
Powered by
FUDForum. Page generated in 0.07774 seconds