Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » RCP Testing Tool » Getting a subset of a tree or table
Getting a subset of a tree or table [message #1667495] Thu, 12 March 2015 04:33 Go to next message
Joseph Benavides is currently offline Joseph BenavidesFriend
Messages: 47
Registered: February 2015
Member
Hi Guys, I was trying to retrieve a subset of a table/tree but I could only get one item. How do I get a subset list of items or even just their count from the example below.

index.php/fa/21142/0/

get-item "Infos.*" | get-item ".*duplicated.*" | length // <- this works but of course I can only get one item. How do I retrieve multiple items instead?


cheers!

Joseph
Re: Getting a subset of a tree or table [message #1667512 is a reply to message #1667495] Thu, 12 March 2015 04:43 Go to previous messageGo to next message
Olga Yurchuk is currently offline Olga YurchukFriend
Messages: 245
Registered: September 2014
Senior Member

Hello,

You can use the key -index:

get-item "Infos.*" | get-item ".*duplicated.*" -index 0 | length 
get-item "Infos.*" | get-item ".*duplicated.*" -index 1 | length 


Please try and let me know if it is suitable for you.


Yours sincerely,
Olga.
Re: Getting a subset of a tree or table [message #1667537 is a reply to message #1667512] Thu, 12 March 2015 04:59 Go to previous messageGo to next message
Joseph Benavides is currently offline Joseph BenavidesFriend
Messages: 47
Registered: February 2015
Member
HI Olga,

That was quick. That would be suitable but would there be any other way to get them all instead of getting them one by one? At least for my purpose, I'm only interested in the number of items that have the "duplicated" string.

cheers!

Joseph
Re: Getting a subset of a tree or table [message #1667847 is a reply to message #1667537] Thu, 12 March 2015 08:04 Go to previous messageGo to next message
Olga Yurchuk is currently offline Olga YurchukFriend
Messages: 245
Registered: September 2014
Senior Member

Do you want to verify number of "duplicated" strings?
I've found out the following construction for that:

get-item "Infos.*" | get-item ".*duplicated.*" -index 0 
get-item "Infos.*" | verify-error {get-item ".*duplicated.*" -index 1} 


It passes if item count is 2. Is it suitable for you?


Yours sincerely,
Olga.

[Updated on: Thu, 12 March 2015 08:05]

Report message to a moderator

Re: Getting a subset of a tree or table [message #1667970 is a reply to message #1667847] Thu, 12 March 2015 09:13 Go to previous messageGo to next message
Joseph Benavides is currently offline Joseph BenavidesFriend
Messages: 47
Registered: February 2015
Member
Hi Olga,

Yes that is correct. I only want to get the number of items that have the word "duplicated'.

That one actually works since the items are ordered anyway and those items are on the top of the list.

Do you think select-rows will work for this? I did try to write something with that error but I couldn't get a table object from get-view Problems.


cheers!

Joseph
Re: Getting a subset of a tree or table [message #1681425 is a reply to message #1667970] Tue, 17 March 2015 09:59 Go to previous message
Olga Yurchuk is currently offline Olga YurchukFriend
Messages: 245
Registered: September 2014
Senior Member

Hello,

What kind of problem do you have with getting table object from Problems view?
In order to get it, switch to assertion mode, click on item in table and use "up" and "down" keyboard navigation key as it is described here.
Use the following construction to get number of items:
log [get-view "Error Log" | get-tree | get-table-data | select-rows -column "Message"  -value "duplicated" -match regexp | get rows | length ]

Please try, and let me know if it is suitable for you!


Yours sincerely,
Olga.
Previous Topic:"Couldn't open ECL Session" with launch-configuration-based AUT
Next Topic:issues with drag&drop errors
Goto Forum:
  


Current Time: Wed Apr 24 22:06:36 GMT 2024

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

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

Back to the top