Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » RCP Testing Tool » Close view inside rcptt(How to write a ecl script to close a view in rcptt)
Close view inside rcptt [message #1702565] Thu, 23 July 2015 09:34 Go to next message
Harshini Garikiparthi is currently offline Harshini GarikiparthiFriend
Messages: 23
Registered: March 2015
Junior Member
RCPTT
I wanted an ecl script for scenario to close a view IF present , In other words IF a view is present close it.

I have tried using
if get-view Console | close

but it gives me an error saying view console not found

[Updated on: Thu, 23 July 2015 09:34]

Report message to a moderator

Re: Close view inside rcptt [message #1702571 is a reply to message #1702565] Thu, 23 July 2015 10:40 Go to previous messageGo to next message
Andreas Falter is currently offline Andreas FalterFriend
Messages: 15
Registered: February 2015
Junior Member
Have you tried using the 'try' command (without 'catch')? I've not used it myself so far, but from the description it sound like you could just execute your close command inside the try block, and just do nothing if it fails.

From the ECL script documentation:

Try to execute command, retry times with delay if command are failed. Execute catch if all operations is not succesfull. Execute finally in anyway.

Parameters:
command optional Command
catch optional Command
finally optional Command
times optional Integer = 1
delay optional Integer = 0

Output:
return's -command output if command is successed.

Example:

try -times 10 -delay 100 -command {
// some ECL scripts
}

Re: Close view inside rcptt [message #1702670 is a reply to message #1702565] Fri, 24 July 2015 03:32 Go to previous message
Ulyana Skorokhodova is currently offline Ulyana SkorokhodovaFriend
Messages: 280
Registered: July 2014
Senior Member
Hi Harshini,

You may write a procedure to check if the view exists, e.g.:

proc "has-view" [val vName] {
try {
get-view $vName
bool true // return true
} -catch {
bool false // return false
}
}


if [has-view "Test Explorer"]{

get-view "Test Explorer" | close

}

Kind regards,
Ulyana.
Previous Topic:How to add arguments and switches to AUT
Next Topic:AUT on restart -Recording not working
Goto Forum:
  


Current Time: Thu Apr 25 21:45:05 GMT 2024

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

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

Back to the top