Home » Archived » Test and Performance Tools Platform (TPTP) » AGR: How to locate one widget in EditorPart when setting verfiy point
AGR: How to locate one widget in EditorPart when setting verfiy point [message #62582] |
Thu, 30 March 2006 05:41  |
Eclipse User |
|
|
|
Hi,
I have one tree in EditorPart, and want to verify one node is added into
this tree when I click one button. So I add one verify point to check
whether this tree has new node with known name. But I found the verify
method take IEditorPart as input parameter. My question is how to access the
tree in EditotPart?
Thanks in advance!
Cliff Liang
|
|
| | |
Re: How to locate one widget in EditorPart when setting verfiy point [message #66366 is a reply to message #63290] |
Thu, 13 April 2006 13:14   |
Eclipse User |
|
|
|
Originally posted by: mvjaibharatreddy.yahoo.com
Hi Ali,
I have tried your suggestion to locate the widget in the Editor part. But
while playing back the test runner is not able to locate the editor and it
is rising the coreException. I think i am doing some thing wrong while
recording .. I have followed the exactly the same instructions from the user
manual of AGR.
Below is java code
Which almost similar to your example one
public void testCheck(org.eclipse.ui.IEditorPart arg0) throws Exception
{
Composite editorComposite = VerifyHookUtil.getWorkbenchPartControl(arg0);
Control[] trees = VerifyHookUtil.findAllControl(editorComposite,
VerifyHookUtil.TREE_CONTROL_TYPE, null);
boolean isTreeNodeFound = false;
for (int i = 0; i < trees.length; i++) {
if (VerifyHookUtil.findChild((Tree) trees[i], "MyName") != null)
{
isTreeNodeFound = true;
break;
}
}
assertTrue(isTreeNodeFound);
}
It would be great help if you can explain how to locate or tell our runner
about the EditorPart while recording. An example would be much better.
Thanks
Jai
"Ali Mehregani" <amehrega@ca.ibm.com> wrote in message
news:e0mabu$kov$1@utils.eclipse.org...
> Hi Cliff,
>
> Check out the following plug-in from TPTP's cvs:
> test-results/platform/org.eclipse.hyades.use.cases.
> Look under src/org.eclipse.hyades.us.cases.auto.common.VerifyHookUtil.j ava
> This calss provides convinient methods for extracting controls from a
> verification hook target. You might want to do something like:
>
> Composite editorComposite =
> VerifyHookUtil.getWorkbenchPartControl(editor);
> Control[] trees = VerifyHookUtil.findAllControl(editorComposite ,
> VerifyHookUtil.TREE_CONTROL_TYPE, null);
> boolean isTreeNodeFound = false;
> for (int i = 0; i < trees.length; i++)
> {
> if (VerifyHookUtil.findChild(trees[i], "tree-node-label");
> {
> isTreeNodeFound = true;
> break;
> }
> }
> assertTrue(isTreeNodeFound);
>
>
> "Cliff Liang" <cliff.liang@benisoft.com> wrote in message
> news:e0gckv$f3u$1@utils.eclipse.org...
>> Hi,
>>
>> I have one tree in EditorPart, and want to verify one node is added into
>> this tree when I click one button. So I add one verify point to check
>> whether this tree has new node with known name. But I found the verify
>> method take IEditorPart as input parameter. My question is how to access
> the
>> tree in EditotPart?
>>
>> Thanks in advance!
>>
>> Cliff Liang
>>
>>
>
>
|
|
|
Re: How to locate one widget in EditorPart when setting verfiy point [message #66404 is a reply to message #66366] |
Thu, 13 April 2006 15:17   |
Eclipse User |
|
|
|
Where are you getting the CoreException?
When doing the verification, make sure
- The tree is fully expanded to the node that you wish to verify
- There are two versions of VerifyHookUtil.findChild. The version that
you're using doesn't do a recursive search on the tree. Try using
VerifyHookUtil.findChild((Tree) trees[i], "MyName", true)
"Jai9999" <mvjaibharatreddy@yahoo.com> wrote in message
news:e1m0tp$gio$1@utils.eclipse.org...
> Hi Ali,
>
> I have tried your suggestion to locate the widget in the Editor part.
But
> while playing back the test runner is not able to locate the editor and it
> is rising the coreException. I think i am doing some thing wrong while
> recording .. I have followed the exactly the same instructions from the
user
> manual of AGR.
>
> Below is java code
>
> Which almost similar to your example one
> public void testCheck(org.eclipse.ui.IEditorPart arg0) throws Exception
> {
> Composite editorComposite =
VerifyHookUtil.getWorkbenchPartControl(arg0);
> Control[] trees = VerifyHookUtil.findAllControl(editorComposite,
> VerifyHookUtil.TREE_CONTROL_TYPE, null);
> boolean isTreeNodeFound = false;
> for (int i = 0; i < trees.length; i++) {
> if (VerifyHookUtil.findChild((Tree) trees[i], "MyName") != null)
> {
> isTreeNodeFound = true;
> break;
> }
> }
> assertTrue(isTreeNodeFound);
> }
>
> It would be great help if you can explain how to locate or tell our runner
> about the EditorPart while recording. An example would be much better.
>
> Thanks
> Jai
>
>
>
> "Ali Mehregani" <amehrega@ca.ibm.com> wrote in message
> news:e0mabu$kov$1@utils.eclipse.org...
> > Hi Cliff,
> >
> > Check out the following plug-in from TPTP's cvs:
> > test-results/platform/org.eclipse.hyades.use.cases.
> > Look under
src/org.eclipse.hyades.us.cases.auto.common.VerifyHookUtil.j ava
> > This calss provides convinient methods for extracting controls from a
> > verification hook target. You might want to do something like:
> >
> > Composite editorComposite =
> > VerifyHookUtil.getWorkbenchPartControl(editor);
> > Control[] trees = VerifyHookUtil.findAllControl(editorComposite ,
> > VerifyHookUtil.TREE_CONTROL_TYPE, null);
> > boolean isTreeNodeFound = false;
> > for (int i = 0; i < trees.length; i++)
> > {
> > if (VerifyHookUtil.findChild(trees[i], "tree-node-label");
> > {
> > isTreeNodeFound = true;
> > break;
> > }
> > }
> > assertTrue(isTreeNodeFound);
> >
> >
> > "Cliff Liang" <cliff.liang@benisoft.com> wrote in message
> > news:e0gckv$f3u$1@utils.eclipse.org...
> >> Hi,
> >>
> >> I have one tree in EditorPart, and want to verify one node is added
into
> >> this tree when I click one button. So I add one verify point to check
> >> whether this tree has new node with known name. But I found the verify
> >> method take IEditorPart as input parameter. My question is how to
access
> > the
> >> tree in EditotPart?
> >>
> >> Thanks in advance!
> >>
> >> Cliff Liang
> >>
> >>
> >
> >
>
>
|
|
|
Re: How to locate one widget in EditorPart when setting verfiy point [message #66914 is a reply to message #66404] |
Tue, 18 April 2006 08:28   |
Eclipse User |
|
|
|
Originally posted by: mvjaibharatreddy.yahoo.com
Hi ali,
When doing the verification it is rising CoreException. It is not able to
find the contextID.
Tree is fully expanded while making the verification .
I had the same problem while doing the example which was stated in the
UserGuide of AGR. I have the all needed dependencies in my manifest file.
I don't know what I am missing with. If you have any other examples I would
like to try.
Cheers
Jai
"Ali Mehregani" <amehrega@ca.ibm.com> wrote in message
news:e1m84q$lk$1@utils.eclipse.org...
> Where are you getting the CoreException?
> When doing the verification, make sure
>
> - The tree is fully expanded to the node that you wish to verify
> - There are two versions of VerifyHookUtil.findChild. The version that
> you're using doesn't do a recursive search on the tree. Try using
> VerifyHookUtil.findChild((Tree) trees[i], "MyName", true)
>
>
>
> "Jai9999" <mvjaibharatreddy@yahoo.com> wrote in message
> news:e1m0tp$gio$1@utils.eclipse.org...
>> Hi Ali,
>>
>> I have tried your suggestion to locate the widget in the Editor part.
> But
>> while playing back the test runner is not able to locate the editor and
>> it
>> is rising the coreException. I think i am doing some thing wrong while
>> recording .. I have followed the exactly the same instructions from the
> user
>> manual of AGR.
>>
>> Below is java code
>>
>> Which almost similar to your example one
>> public void testCheck(org.eclipse.ui.IEditorPart arg0) throws Exception
>> {
>> Composite editorComposite =
> VerifyHookUtil.getWorkbenchPartControl(arg0);
>> Control[] trees = VerifyHookUtil.findAllControl(editorComposite,
>> VerifyHookUtil.TREE_CONTROL_TYPE, null);
>> boolean isTreeNodeFound = false;
>> for (int i = 0; i < trees.length; i++) {
>> if (VerifyHookUtil.findChild((Tree) trees[i], "MyName") != null)
>> {
>> isTreeNodeFound = true;
>> break;
>> }
>> }
>> assertTrue(isTreeNodeFound);
>> }
>>
>> It would be great help if you can explain how to locate or tell our
>> runner
>> about the EditorPart while recording. An example would be much better.
>>
>> Thanks
>> Jai
>>
>>
>>
>> "Ali Mehregani" <amehrega@ca.ibm.com> wrote in message
>> news:e0mabu$kov$1@utils.eclipse.org...
>> > Hi Cliff,
>> >
>> > Check out the following plug-in from TPTP's cvs:
>> > test-results/platform/org.eclipse.hyades.use.cases.
>> > Look under
> src/org.eclipse.hyades.us.cases.auto.common.VerifyHookUtil.j ava
>> > This calss provides convinient methods for extracting controls from a
>> > verification hook target. You might want to do something like:
>> >
>> > Composite editorComposite =
>> > VerifyHookUtil.getWorkbenchPartControl(editor);
>> > Control[] trees = VerifyHookUtil.findAllControl(editorComposite ,
>> > VerifyHookUtil.TREE_CONTROL_TYPE, null);
>> > boolean isTreeNodeFound = false;
>> > for (int i = 0; i < trees.length; i++)
>> > {
>> > if (VerifyHookUtil.findChild(trees[i], "tree-node-label");
>> > {
>> > isTreeNodeFound = true;
>> > break;
>> > }
>> > }
>> > assertTrue(isTreeNodeFound);
>> >
>> >
>> > "Cliff Liang" <cliff.liang@benisoft.com> wrote in message
>> > news:e0gckv$f3u$1@utils.eclipse.org...
>> >> Hi,
>> >>
>> >> I have one tree in EditorPart, and want to verify one node is added
> into
>> >> this tree when I click one button. So I add one verify point to check
>> >> whether this tree has new node with known name. But I found the verify
>> >> method take IEditorPart as input parameter. My question is how to
> access
>> > the
>> >> tree in EditotPart?
>> >>
>> >> Thanks in advance!
>> >>
>> >> Cliff Liang
>> >>
>> >>
>> >
>> >
>>
>>
>
>
|
|
|
Re: How to locate one widget in EditorPart when setting verfiy point [message #66941 is a reply to message #66914] |
Tue, 18 April 2006 10:06  |
Eclipse User |
|
|
|
This can happen if you don't have the editor opened before doing the
verification. Make sure the editor is opened and has focus before the
verification fragment.
Try performing the following sequence of tasks in the order outlined below:
- Open the editor
- Expand the tree
- Perform the verification.
This worked fine for me when I tested a verification hook on a Java editor.
Your problem isn't coming from what you have in your verification method.
The problem is that the editor is not anywhere to be found before even doing
the verification.
Thanks.
"Jai9999" <mvjaibharatreddy@yahoo.com> wrote in message
news:e22m2a$sjg$1@utils.eclipse.org...
> Hi ali,
>
> When doing the verification it is rising CoreException. It is not able to
> find the contextID.
>
> Tree is fully expanded while making the verification .
>
> I had the same problem while doing the example which was stated in the
> UserGuide of AGR. I have the all needed dependencies in my manifest file.
>
> I don't know what I am missing with. If you have any other examples I
would
> like to try.
>
> Cheers
> Jai
>
> "Ali Mehregani" <amehrega@ca.ibm.com> wrote in message
> news:e1m84q$lk$1@utils.eclipse.org...
> > Where are you getting the CoreException?
> > When doing the verification, make sure
> >
> > - The tree is fully expanded to the node that you wish to verify
> > - There are two versions of VerifyHookUtil.findChild. The version that
> > you're using doesn't do a recursive search on the tree. Try using
> > VerifyHookUtil.findChild((Tree) trees[i], "MyName", true)
> >
> >
> >
> > "Jai9999" <mvjaibharatreddy@yahoo.com> wrote in message
> > news:e1m0tp$gio$1@utils.eclipse.org...
> >> Hi Ali,
> >>
> >> I have tried your suggestion to locate the widget in the Editor part.
> > But
> >> while playing back the test runner is not able to locate the editor and
> >> it
> >> is rising the coreException. I think i am doing some thing wrong while
> >> recording .. I have followed the exactly the same instructions from the
> > user
> >> manual of AGR.
> >>
> >> Below is java code
> >>
> >> Which almost similar to your example one
> >> public void testCheck(org.eclipse.ui.IEditorPart arg0) throws
Exception
> >> {
> >> Composite editorComposite =
> > VerifyHookUtil.getWorkbenchPartControl(arg0);
> >> Control[] trees = VerifyHookUtil.findAllControl(editorComposite,
> >> VerifyHookUtil.TREE_CONTROL_TYPE, null);
> >> boolean isTreeNodeFound = false;
> >> for (int i = 0; i < trees.length; i++) {
> >> if (VerifyHookUtil.findChild((Tree) trees[i], "MyName") != null)
> >> {
> >> isTreeNodeFound = true;
> >> break;
> >> }
> >> }
> >> assertTrue(isTreeNodeFound);
> >> }
> >>
> >> It would be great help if you can explain how to locate or tell our
> >> runner
> >> about the EditorPart while recording. An example would be much better.
> >>
> >> Thanks
> >> Jai
> >>
> >>
> >>
> >> "Ali Mehregani" <amehrega@ca.ibm.com> wrote in message
> >> news:e0mabu$kov$1@utils.eclipse.org...
> >> > Hi Cliff,
> >> >
> >> > Check out the following plug-in from TPTP's cvs:
> >> > test-results/platform/org.eclipse.hyades.use.cases.
> >> > Look under
> > src/org.eclipse.hyades.us.cases.auto.common.VerifyHookUtil.j ava
> >> > This calss provides convinient methods for extracting controls from a
> >> > verification hook target. You might want to do something like:
> >> >
> >> > Composite editorComposite =
> >> > VerifyHookUtil.getWorkbenchPartControl(editor);
> >> > Control[] trees = VerifyHookUtil.findAllControl(editorComposite ,
> >> > VerifyHookUtil.TREE_CONTROL_TYPE, null);
> >> > boolean isTreeNodeFound = false;
> >> > for (int i = 0; i < trees.length; i++)
> >> > {
> >> > if (VerifyHookUtil.findChild(trees[i], "tree-node-label");
> >> > {
> >> > isTreeNodeFound = true;
> >> > break;
> >> > }
> >> > }
> >> > assertTrue(isTreeNodeFound);
> >> >
> >> >
> >> > "Cliff Liang" <cliff.liang@benisoft.com> wrote in message
> >> > news:e0gckv$f3u$1@utils.eclipse.org...
> >> >> Hi,
> >> >>
> >> >> I have one tree in EditorPart, and want to verify one node is added
> > into
> >> >> this tree when I click one button. So I add one verify point to
check
> >> >> whether this tree has new node with known name. But I found the
verify
> >> >> method take IEditorPart as input parameter. My question is how to
> > access
> >> > the
> >> >> tree in EditotPart?
> >> >>
> >> >> Thanks in advance!
> >> >>
> >> >> Cliff Liang
> >> >>
> >> >>
> >> >
> >> >
> >>
> >>
> >
> >
>
>
|
|
|
Goto Forum:
Current Time: Thu May 08 06:02:19 EDT 2025
Powered by FUDForum. Page generated in 0.14338 seconds
|