Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » RCP Testing Tool » [SOLVED] do foreach to scan list(do foreach to scan list)
[SOLVED] do foreach to scan list [message #1700195] Tue, 30 June 2015 15:32 Go to next message
jeremie gr is currently offline jeremie grFriend
Messages: 41
Registered: June 2015
Member
hi,

I would like to do a "foreeahc" to scan list

like
List "Boolean" "Double" "Float" "Integer" "Long" "Object" ] foreach [val choosetype] {

 log $choosetype
}


thanks

jeremie

[Updated on: Thu, 26 November 2015 06:06] by Moderator

Report message to a moderator

Re: do foreach to scan list [message #1700227 is a reply to message #1700195] Wed, 01 July 2015 02:33 Go to previous messageGo to next message
Ulyana Skorokhodova is currently offline Ulyana SkorokhodovaFriend
Messages: 280
Registered: July 2014
Senior Member
Hi Jeremie,

You should use each for this purpose:

list "1" "2" "3" | each [val item] {

$item | log

}

Kind regards,
Ulyana.
Re: do foreach to scan list [message #1700400 is a reply to message #1700227] Thu, 02 July 2015 11:55 Go to previous messageGo to next message
jeremie gr is currently offline jeremie grFriend
Messages: 41
Registered: June 2015
Member
hi ulyana,

other point, it's possible to get list of all parameter on my context?

like $list ??

thanks

jeremie
Re: do foreach to scan list [message #1707827 is a reply to message #1700400] Wed, 09 September 2015 14:51 Go to previous messageGo to next message
jeremie gr is currently offline jeremie grFriend
Messages: 41
Registered: June 2015
Member
hi,

I hadn't received response and I have other question similar.

In RCP TT, it's possible to use table or list that i can call like that tab[1] tab[1][2].

thanks
jeremie
Re: do foreach to scan list [message #1709390 is a reply to message #1707827] Mon, 28 September 2015 07:53 Go to previous messageGo to next message
Ulyana Skorokhodova is currently offline Ulyana SkorokhodovaFriend
Messages: 280
Registered: July 2014
Senior Member
Hi Jeremie,

You could use csv file instead of a list (import this file by a workspace/folder context).
Here is ECL procedure example of how to retrieve values from a file:

proc "index-of" [val list -input] [val item] {

$list | each [val elem] [val index] {

if [$elem | eq $item] { $index }

} | to-list | get 0 [int "-1"]

}

index-of [list 1 2 3] 4 | eq [int "-1"] | assert-true

index-of [list 1 2 3] 2 | eq 1 | assert-true



proc "get-value" [val table] [val columnName] [val rowNumber] {

let [val columnIndex [$table | get columns | to-list | index-of $columnName]] {

$table | get rows | to-list

| get $rowNumber | get values | to-list

| get $columnIndex

}

}





let [val table [read-csv-file "file:///Users/Ulik_MacAir/rcpttWorkspace_iTest/Project/ccc.csv"]] {

get-value $table "Name" 0 | eq "v11" | assert-true

get-value $table "Value" 0 | eq "v21" | assert-true

get-value $table "Name" 1 | eq "v12" | assert-true

get-value $table "Value" 1 | eq "v22" | assert-true


}

I hope it will be useful.

Kind regards,
Ulyana.
Re: do foreach to scan list [message #1711263 is a reply to message #1709390] Wed, 14 October 2015 12:39 Go to previous messageGo to next message
jeremie gr is currently offline jeremie grFriend
Messages: 41
Registered: June 2015
Member
hello,

Thanks a lot for your help.

I don't understand which syntax can i use for a file.

I used "file:/MaTeLo/Context/Files/reqsquash.csv" "workspace:/reqsquash.csv" "file:///D:\_REPOSITORY\_TEST\Projets\Scripts RCPTT\MaTeLo\Context\Files\reqsquash.csv"

and other thing with uri..

Can you help me, I don't understant what is a root of files in my project.

thanks

jeremie

Re: do foreach to scan list [message #1711279 is a reply to message #1711263] Wed, 14 October 2015 14:21 Go to previous messageGo to next message
jeremie gr is currently offline jeremie grFriend
Messages: 41
Registered: June 2015
Member
I understand my erreur for this directory : "file:///D:\_REPOSITORY\_TEST\Projets\Scripts RCPTT\MaTeLo\Context\Files\reqsquash.csv"
"file:///D:/_REPOSITORY/_TEST/Projets/ScriptsRCPTT/MaTeLo/Context/Files/reqsquash.csv" , it's ok with space.

but do you know it's possible to use directory. like Context/Files/reqsquash.csv
Re: do foreach to scan list [message #1711320 is a reply to message #1711279] Thu, 15 October 2015 01:46 Go to previous messageGo to next message
Ulyana Skorokhodova is currently offline Ulyana SkorokhodovaFriend
Messages: 280
Registered: July 2014
Senior Member
Hi Jeremie,

I would recommend to store file in a Workspace Context thus placing it on AUT workspace, so you can refer the file using "workspace:/":

read-csv-file -uri "workspace:/Project/file.csv"

Kind regards,
Ulyana.
Re: do foreach to scan list [message #1715740 is a reply to message #1711320] Wed, 25 November 2015 15:47 Go to previous message
jeremie gr is currently offline jeremie grFriend
Messages: 41
Registered: June 2015
Member
hi,

thanks it work.

jeremie
Previous Topic:[SOLVED] Set up a stress/load test case
Next Topic:[SOLVED] is it possible to run a suite without view it ? I mean in background
Goto Forum:
  


Current Time: Thu Apr 18 13:35:38 GMT 2024

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

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

Back to the top