Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 13:08 Go to next message
Koen Staal is currently offline Koen StaalFriend
Messages: 70
Registered: October 2014
Member
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 15:19]

Report message to a moderator

Re: File Import script non platform dependent [message #1696054 is a reply to message #1695944] Thu, 21 May 2015 12:15 Go to previous message
Ulyana Skorokhodova is currently offline Ulyana SkorokhodovaFriend
Messages: 280
Registered: July 2014
Senior Member
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: Thu Apr 25 02:18:13 GMT 2024

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

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

Back to the top