Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » RCP Testing Tool » [SOLVED] How get value of first item from table?(=> select ".*" | get-property "getData().getValue()" -raw | let [val msg -input]{$msg})
icon5.gif  [SOLVED] How get value of first item from table? [message #1439812] Tue, 07 October 2014 14:45 Go to next message
Francis BACQUET is currently offline Francis BACQUETFriend
Messages: 46
Registered: September 2014
Member
Hello,

I try get value from first item but I am in any difficulties.

I do it but i check all items Confused :

proc getReference {
    get-view "Résultat Recherche Article" | get-table | 
         //error : Cannot convert value of type 'org.eclipse.rcptt.tesla.ecl.model.VerifyHandler'
        //select ".*" | get-property "getData().getProduit().getCodeInterne()" | let [val msg -input]{$msg}
        //error : Cannot convert value of type 'org.eclipse.rcptt.tesla.ecl.model.VerifyHandler'
        //get-item ".*" | get-property "getData().getProduit().getCodeInterne()" | let [val msg -input]{$msg}
        //check all items... it's not effective
        get-items | foreach {get-property "getData().getProduit().getCodeInterne()" -raw | let [val msg -input]{$msg}}
}

proc unArticle [] {
    initialiseRechercheArticle
    let [val ref [getReference | str]] {
        get-view "Résultat Recherche Article" | get-button Quitter | click
        $ref
    }
}

show-alert [unArticle]


I tested select ".*" and get-item ".*" but rcptt generate an error: Cannot convert value of type 'org.eclipse.rcptt.tesla.ecl.model.VerifyHandler'

Thanks you in advance

[Updated on: Thu, 16 October 2014 21:46]

Report message to a moderator

Re: How get value of first item from table? [message #1440516 is a reply to message #1439812] Wed, 08 October 2014 13:07 Go to previous messageGo to next message
Francis BACQUET is currently offline Francis BACQUETFriend
Messages: 46
Registered: September 2014
Member
It's good, I have to use '-raw' key. If you have an error with VerifyHandler, you should try use "-raw".

get-view "Résultat Recherche Article" | get-table | 
select ".*" | get-property "getData().getProduit().getCodeInterne()" -raw | let [val msg -input]{$msg}
//other solution
//get-item ".*" | get-property "getData().getProduit().getCodeInterne()" -raw | let [val msg -input]{$msg}


thanks Olga for yours response in other topics!

[Updated on: Wed, 08 October 2014 13:15]

Report message to a moderator

Re: How get value of first item from table? [message #1440948 is a reply to message #1440516] Thu, 09 October 2014 03:59 Go to previous messageGo to next message
Olga Yurchuk is currently offline Olga YurchukFriend
Messages: 245
Registered: September 2014
Senior Member

Hi Francis,

You are welcome.
Do you still have problems with mentioned snippet of code?


Yours sincerely,
Olga.
Re: How get value of first item from table? [message #1441071 is a reply to message #1440948] Thu, 09 October 2014 08:15 Go to previous messageGo to next message
Francis BACQUET is currently offline Francis BACQUETFriend
Messages: 46
Registered: September 2014
Member
No, i don't problems with mentioned snippet.

thanks.
Re: How get value of first item from table? [message #1710714 is a reply to message #1441071] Thu, 08 October 2015 15:25 Go to previous messageGo to next message
Angelo Luciani is currently offline Angelo LucianiFriend
Messages: 129
Registered: September 2015
Location: Milan
Senior Member

HI Folks,
I have the same problem I need to select the first table element.

I try to use your snippet, it works because first table element is selected but return an error and break the execution.
index.php/fa/23486/0/

with [get-view TaskList | get-section "" | get-table] {
select ".*" | get-property "getParent().getChildren().Control[0].getChildren().Control[3].getItems().TableItem[1].getDescription()" -raw | let [val msg -input]
{
//Select-item $msg

global [val n [plus 1 $n]] -override

if [$n | equals 1 ]
{
Show-alert $msg
}

}
}


if I run the same code with a foreach and I can visit the table but I need to select only the first item.

I cannot use the "Record & Play" because it selected a dynamic filed value.



"Ce sont les petits désirs qui rendent un jeune homme hardi."
Giovanni Giacomo Casanova
Re: How get value of first item from table? [message #1710718 is a reply to message #1710714] Thu, 08 October 2015 15:34 Go to previous message
Angelo Luciani is currently offline Angelo LucianiFriend
Messages: 129
Registered: September 2015
Location: Milan
Senior Member


Since is marked as SOLVED I open a new one.
https://www.eclipse.org/forums/index.php/t/1071019/


"Ce sont les petits désirs qui rendent un jeune homme hardi."
Giovanni Giacomo Casanova

[Updated on: Thu, 08 October 2015 15:34]

Report message to a moderator

Previous Topic:[SOLVED] Visit a table line by line
Next Topic:[SOLVED WITH WORKAROUND] How get value of first item from table?
Goto Forum:
  


Current Time: Fri Apr 19 23:46:01 GMT 2024

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

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

Back to the top