2019 jusqu'à présent |  2018  2017 | 2016 | 2015 | 2014 | 2013 | 2012

Liste de diffusion - Entrées de 2019 jusqu'à présent


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [QF-Test] (SUP-4635) GEF Resolver problem


  • Subject: Re: [QF-Test] (SUP-4635) GEF Resolver problem
  • From: "Zhao, Tom" <tom.zhao@?.com>
  • Date: Wed, 3 Apr 2019 06:56:01 +0000
  • Delivered-to: qftest-list@?.net
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=myadvantest.onmicrosoft.com; s=selector1-ADVANTEST-COM; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8wfzOYs2bKkv7ePEUz8qZ5UaA069MsgDkOLfyTmMS3Y=; b=ljbsM4PpLtypCHxZkWkLneCw4Q3edd+LZoIOViH+RGZxBcQO3RSrjOIT2tqk+hY4+2BELcdrliN+tEDnuL4lL4fjCistAFvKrsCoE7fXUtoMdTIfJ7OcVLFCPMHvAbUJgIxPx5VDdW+upjp/kfgYw6iwrNiSeBKi/sLH8zygQIU=

Hello Thomas,

I found the active part is a view,  so I changed the script:

----------------------
import gef
shell = rc.getComponent("WorkbenchWindow")
# editor = shell.getData().getActivePage().getActivePart() 
# viewer = editor.getContentViewer()
view = shell.getData().getActivePage().getActivePart() # added by me
viewer = view.getViewer()
gef.gefResolver.setViewer(viewer)
-----------------------

Now it's working. But after I record a mouse click action, the component in the mouse click is as below: 
------------------------
FCS74ACT299_QuadSite.prog.canvasTest_program_:_FCS74ACT299_QuadSite.prog@/Diagram/Null FCS74ACT299_QuadSite.prog Testprogram File platform:\/resource\/inco4\/src\/testPrograms\/FCS74ACT299_QuadSite.prog->platform:\/resource\/inco4\/src\/testPrograms\/FCS74ACT299_QuadSite.prog /FCS74ACT299_QuadSite.prog Main Testflow Reference platform:\/resource\/inco4\/src\/testPrograms\/FCS74ACT299_QuadSite.prog\\\#\/\/\\\@testProgram\/\\\@flows.1->platform:\/resource\/inco4\/srcShifter\/shifter\/common\/FCS74ACT299.flow\\\#\/0\/\\\@testflow
------------------------

It's a such a long string, but replay is ok for now, if the string is shorter it is easier for us to manage.


Best regards,
Tom Zhao (赵心卓)


-----Original Message-----
From: Thomas Max, QFS Support [mailto:support@xxxxxx] 
Sent: Tuesday, April 02, 2019 8:26 PM
To: Zhao, Tom <tom.zhao@xxxxxxxxxxxxx>
Cc: qftest-list@xxxxxx
Subject: Re: [QF-Test] (SUP-4635) GEF Resolver problem

Hello Tom,

this approach was just one guess to get the viewer object but this depends on the underlying implementation.

Basically what we need to find out is how to access the viewer object which is then later used in the resolver to call for:

editPart = viewer.findObjectAt(point)

You may need to ask your developers how the get the viewer object based on this specific implementation.

Best regards,
    Thomas

Zhao, Tom wrote on 02.04.19 09:03:
> Hello Thomas,
> 
> 
> When executing the script one line throw an exception:
> 
> Code:
> viewer = editor.getContentViewer()
> 
> Exception:
>   object has no attribute 'getContentViewer'
> 
> 
> 
> Best regards,
> Tom Zhao (赵心卓)
> 
> -----Original Message-----
> From: qftest-list [mailto:qftest-list-bounces@xxxxxxxxxxxxxxxxxxxx] On 
> Behalf Of Thomas Max, QFS Support
> Sent: Tuesday, April 02, 2019 2:30 PM
> To: qftest-list@xxxxxx
> Subject: Re: [QF-Test] (SUP-4635) GEF Resolver problem
> 
> Hello Tom,
> 
> could you please try the following script:
> 
> import gef
> shell = rc.getComponent("WorkbenchWindow")
> editor = shell.getData().getActivePage().getActivePart()
> viewer = editor.getContentViewer()
> gef.gefResolver.setViewer(viewer)
> 
> is the editor still None if you set the Viewer externally using this script ?
> 
> Best regards,
>      Thomas
> 
> Zhao, Tom wrote on 01.04.19 08:50:
>> Dear All,
>>
>> We start to make procedures for the GEF editor, but I found the 
>> original gef resolver has some errors and solutions can not be found in manual .
>>
>> I add some print into the resolver code, then try to record the 
>> component,  ‘wbp’ is found, after I printed It out the result is 
>> ‘org.eclipse.ui.internal.WorkbenchPage@2fd16368’,  but ‘editor’ is 
>> ‘none’,  it seems getActivateEditor() returned ‘none’. No document 
>> found for this method. Now we can not find further actions to solve this problem.
>>
>> Our qf-test version is 4.5.1, our eclipse framework version in 4.10 
>> (2018-12).
>>
>> Resolver code:
>>
>> def getGefEditor(shell):
>>
>>       wbw = shell.getData()
>>
>>       pages = wbw.getPages()
>>
>>       for i in range(len(pages)):
>>
>>           wbp = pages[i] //wbp is ok
>>
>>           print "getGefEditor -- wbp : ", wbp // added by me
>>
>> editor = wbp.getActiveEditor() //editor is none
>>
>>           print "getGefEditor -- editor: ", editor //added by me
>>
>>           if editor != None:
>>
>>               if ResolverRegistry.isInstance(editor,
>> "org.eclipse.ui.part.MultiPageEditorPart"):
>>
>>                   editor = Reflector.call(editor, "getActiveEditor", 
>> 1)
>>
>>               return editor
>>
>> return None
>>
>> Best regards,
>>
>> Tom Zhao (赵心卓)
>>
>> ------------------------------------------------------------
>>
>> R&D-Department
>>
>> Advantest (China) Co., Ltd.
>>
>> Tel:021-6163-0093 <tel:021-6163-0093>
>>
>> Fax:021-2028-7601
>>
>> Email:tom.zhao@xxxxxxxxxxxxxxxx
>>
>> Add: C Block, Bldg.3, 168 HuaTuo Road,
>>
>> Zhangjiang Hi-Tech Park, Shanghai, China, 201203
>>
> --
> _______________________________________________________________
> Get the most out of QF-Test - Support directly from the authors
> * Training & consulting: www.qfs.de/en/qftest/training.html
> * Phone & email support: www.qfs.de/en/qftest/support.html 
> _______________________________________________________________
> 
> Thomas Max
> Development & Support/Training/Consulting
> 
> E: support@xxxxxx
> T: +49 8171 38648-20
> F: +49 8171 38648-16
> 
> Quality First Software GmbH | www.qfs.de Tulpenstr. 41 | 82538 
> Geretsried | Germany GF Gregor Schmid, Dr. Martina Schmid, Karlheinz 
> Kellerer HRB München 140833
> 
> _______________________________________________
> qftest-list mailing list
> qftest-list@xxxxxxxxxxxxxxx
> https://movement.qfs.de/mailman/listinfo/qftest-list
> _______________________________________________
> qftest-list mailing list
> qftest-list@xxxxxxxxxxxxxxx
> https://movement.qfs.de/mailman/listinfo/qftest-list
> 


--
____________________________________________________________
Nutzen Sie den vollen Funktionsumfang von QF-Test
* Schulung & Beratung: www.qfs.de/de/qftest/training.html
* Telefon- & Emailsupport: www.qfs.de/de/qftest/support.html ____________________________________________________________

Thomas Max
Entwicklung & Support/Training/Consulting

E: support@xxxxxx
T: +49 8171 38648-20
F: +49 8171 38648-16

Quality First Software GmbH | www.qfs.de Tulpenstr. 41 | 82538 Geretsried | Deutschland GF Gregor Schmid, Dr. Martina Schmid, Karlheinz Kellerer HRB München 140833