Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » RCP Testing Tool » Tree items length is always 1 when working with procedures(Procedure returns different result for the same code executed in main script)
Tree items length is always 1 when working with procedures [message #1723683] Wed, 17 February 2016 08:56
Hic LA is currently offline Hic LAFriend
Messages: 28
Registered: July 2015
Junior Member
Hi,
It seems that when working with procedures it is not possible to iterate over all tree items because it considers that it exists only 1 item (the first one)

Without procedure:
get-menu "File/Import..." | click
with [get-window Import] {
    get-tree | get-item "Some category" | double-click
    
    get-tree | get-item "Some category" | get-items | length | log
    get-tree | get-item "Some category" | get-items | foreach [val elt]{
	$elt | get-property text -raw | log
   }
}

It returns all items as expected. OK.

Using a procedure:
proc iterate [val items -input]{
	$items | length | log
	$items | foreach [val elt]{
		$elt | get-property text -raw | log
	}
}

get-menu "File/Import..." | click
with [get-window Import] {
    get-tree | get-item "Some category" | get-items | iterate
}

It returns only the first element and length = 1. Not as expected.

Do someone have any idea about this unexpected behaviour?

Thank you

[Updated on: Wed, 17 February 2016 09:10]

Report message to a moderator

Previous Topic:prevent using vm from ini.file
Next Topic:Install custom command on runner via Jenkins
Goto Forum:
  


Current Time: Thu Apr 25 04:02:07 GMT 2024

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

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

Back to the top