Skip to main content



      Home
Home » Eclipse Projects » RCP Testing Tool » File Import script non platform dependent
File Import script non platform dependent [message #1695944] Wed, 20 May 2015 09:08 Go to next message
Eclipse UserFriend
I want to test my import implementation.
When i searched for a solution i ended up at this page https://www.eclipse.org/rcptt/documentation/userguide/contexts/folder/.

The solutions presented on the page were not sufficient because the test scripts you write are platform dependent. If someone else runs the tests it would fail, this is not something you want as test platform.

I found a solution that works for me, and it uses the workspacecontext. Basicly you create a project in the context and the file you want to import should be in this project.
You could use 2 projects if imporing the file to the same project causes a conflict.

let [val workspace [get-workspace-location]]
     [val file "\fromProject\models\legacy.xml"] 
{
	get-menu "File/Import..." | click
	get-window Import | get-tree | select "MyImport/Import Legacy XML as myImp" | double-click
	get-window "File Import Wizard" | get-editbox -after [get-label "Select File:"] | set-text [format "%s%s" [str	$workspace] [str $file]]
}


I wonder what you guys think.
I hope this snippet helps others

[Updated on: Wed, 20 May 2015 11:19] by Moderator

Re: File Import script non platform dependent [message #1696054 is a reply to message #1695944] Thu, 21 May 2015 08:15 Go to previous message
Eclipse UserFriend
Hi Koen,

When you select a file on your AUT workspace it's path is captured as
platform:/...

So you don't need to calculate a workspace path.

I've just captured a test case which works well both on MacOS and WinOS for me:

get-view "Test Explorer" | get-tree | select MyProject2 | get-menu "Import/Import..." | click
get-window Import | get-tree | select "General/File System"
get-window Import | get-button "Next >" | click
set-dialog-result Folder "platform:/resource/MyProject"
with [get-window Import] {
get-button "Browse..." | click
get-table | get-item "Dummy.test" | check
get-button Finish | click
}

Kind regards,
Ulyana.
Previous Topic:Clear Woskspace in Workspace Context does not clear it in Resource Navigator
Next Topic:Error on a test case without fail
Goto Forum:
  


Current Time: Fri Jun 20 22:40:20 EDT 2025

Powered by FUDForum. Page generated in 0.04040 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top