Hyperlink problem

WindowTester allows you to easily create and run unit tests for every GUI they build. It can also be used to generate system level tests.

Moderators: gnebling, Eric Clayberg, Dan Rubel, keertip, Phil Quitslund

Hyperlink problem

Postby scshah » Thu Jan 24, 2008 5:22 pm

Hi All,

I have hyperlink, which opens new shell. Now I tried to search hyperlink. so the hierarchy that I found is FormText->Hyperlinkgroup -> I am assuming hyperlink must be inside this, but I am not able to go further then Hyperlinkgroup. So can anyone please suggest me something?
I want click on hyperlink.

Thanks
scshah
 
Posts: 19
Joined: Fri Jan 11, 2008 3:52 pm

Re: Hyperlink problem

Postby Phil Quitslund » Fri Jan 25, 2008 11:25 am

Could you post the contents of the widget hierarchy?

Any easy way to do this is to insert this line into your test and copy the results from the console...

Code: Select all
com.windowtester.swt.util.DebugHelper.printWidgets();


Thanks!
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: Hyperlink problem

Postby ryan.correia » Mon Jan 28, 2008 6:12 am

We faced a similar problem and our widget hierarchy could change depending on how our editors were open. Almost all of our Editors in our RCP app have hyperlinks. Our solution to this problem was to use setData method and give the widget an ID.

This is an example of what the recorder would capture after we set IDs:
Code: Select all
ui.click(new NamedWidgetLocator("ProjectEditor.Overview.SkywayServiceLink"));
ui.wait(new ShellShowingCondition("New Skyway Service"));

We have been very successful using NamedWidgetLocator to easily find widgets on the screen without worrying about the hierarchy.

I hope that helps :-)
ryan.correia
 
Posts: 1
Joined: Tue Oct 16, 2007 6:59 am

Re: Hyperlink problem

Postby Phil Quitslund » Mon Jan 28, 2008 10:35 am

Thanks for mentioning this Ryan!

Naming widgets is a good convention and a great step to making your application test-friendly.
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: Hyperlink problem

Postby scshah » Tue Jan 29, 2008 1:43 pm

Thanks, I will look into it.
scshah
 
Posts: 19
Joined: Fri Jan 11, 2008 3:52 pm

Re: Hyperlink problem

Postby Phil Quitslund » Wed Jan 30, 2008 1:12 pm

Great. Let us know how it goes!
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: Hyperlink problem

Postby scshah » Thu Feb 28, 2008 4:24 pm

Hi,

I am again having hyperlink problem. Now this time I can able to get my hperlink. If I print my widget, it shows me {link} <A>Testlink</A>". but if I write code like this :

ui.click(new SWTWidgetLocator(Link.class,"Testlink"));. then it is not working

I also tried :

ui.click(new SWTWidgetLocator(Link.class));

can someone please guide me what I am doing wrong?
scshah
 
Posts: 19
Joined: Fri Jan 11, 2008 3:52 pm

Re: Hyperlink problem

Postby Phil Quitslund » Sun Mar 02, 2008 2:08 pm

Could you attach the stack trace of the failure? Are you finding multiple widgets or none at all? Also, is this a org.eclipse.swt.widgets.Link or a org.eclipse.ui.forms.widgets.Hyperlink you're trying to find?

And when you say this:

Now this time I can able to get my hperlink. If I print my widget, it shows me {link} <A>Testlink</A>


how are you getting the widget? Using a locator or some other means?
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: Hyperlink problem

Postby scshah » Tue Mar 18, 2008 10:09 am

Hi Phil,

I had this problem, but then i could find alternative way for the functionality instead of clicking on this link. Thx for your help.

Thanks
scshah
 
Posts: 19
Joined: Fri Jan 11, 2008 3:52 pm

Re: Hyperlink problem

Postby Phil Quitslund » Wed Mar 19, 2008 1:27 pm

Awesome. Glad you're unblocked!
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am


Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest