Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311712 - Add Browser widget support
Summary: Add Browser widget support
Status: RESOLVED FIXED
Alias: None
Product: SWTBot
Classification: Technology
Component: SWTBot (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Ketan Padegaonkar CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-05 08:36 EDT by Libor Zoubek CLA
Modified: 2010-08-16 11:17 EDT (History)
1 user (show)

See Also:


Attachments
SWTBotBrowser widget and WaitForBrowserLoadsPage wait (7.28 KB, patch)
2010-05-05 08:39 EDT, Libor Zoubek CLA
no flags Details | Diff
SWTBotBrowser (23.08 KB, patch)
2010-05-21 09:10 EDT, Libor Zoubek CLA
no flags Details | Diff
mylyn/context/zip (65.50 KB, application/octet-stream)
2010-08-13 13:14 EDT, Ketan Padegaonkar CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Libor Zoubek CLA 2010-05-05 08:36:24 EDT
Build Identifier: 

I would like to add SWTBotBrowser control to SWTBot.

I find Browser widget usefull, since I write tests for creating web services and other stuff which runs on server and I need to check the results via browser. 

I'll attach a patch in few minutes. Could you please review it? I am not sure about 'referencedBy' annotation, I just used ReferencedBy.NONE. Browser as control is mainly nested in an Editor or View. So finding it by title would be finding an editor and then finding Browser inside.

I'd like to provide some methods for 

Libor 

Reproducible: Always
Comment 1 Libor Zoubek CLA 2010-05-05 08:39:29 EDT
Created attachment 167125 [details]
SWTBotBrowser widget and WaitForBrowserLoadsPage wait
Comment 2 Ketan Padegaonkar CLA 2010-05-05 12:01:56 EDT
Can you also attach tests for the widget ? I notice that the WaitForBrowserLoadsPage is not used, what is the purpose of this ? Would it be possible to use it implicitly when users invoke getText() or getURL() ?

Curious why you'd want to use a browser's getText() to debug webservices. I tend to use tcpmon for such stuff:

https://tcpmon.dev.java.net/
http://wso2.org/blog/saliya/3938
Comment 3 Libor Zoubek CLA 2010-05-06 09:57:08 EDT
Thanks for your answer!
(In reply to comment #2)
> Can you also attach tests for the widget ? 
Yes, I will. Once I get through tests and examples. I'll put BrowserExample into another shell, which appears when tests run.
I notice that the
> WaitForBrowserLoadsPage is not used, what is the purpose of this ? 
Sometimes when I write tests using SWTBot, I use some of waits from package org.swtbot.swt.finder.waits directly with waitUntil or waitWhile. Maybe I misunderstood the SWTBot API.
Would it be
> possible to use it implicitly when users invoke getText() or getURL() ?
That think did not came up into my mind. Great idea.
> Curious why you'd want to use a browser's getText() to debug webservices. I
> tend to use tcpmon for such stuff:
> 
> https://tcpmon.dev.java.net/
> http://wso2.org/blog/saliya/3938
Thanks for suggestion, I've never heard about tcpmon before. But, my tests do not call web services directly, I only need to ensure, that WS gets deployed (endpoint registered), then I call it by servlet which calls client code, which is generated by another wizard.
Comment 4 Libor Zoubek CLA 2010-05-21 09:10:56 EDT
Created attachment 169498 [details]
SWTBotBrowser

Next version of SWTBotBrowser, added tests, integrated wait and authentication, also added Browser into generator's widgets.xml
Comment 5 Libor Zoubek CLA 2010-08-13 05:56:29 EDT
ping
Comment 6 Ketan Padegaonkar CLA 2010-08-13 11:36:25 EDT
Libor,

I see that the browser has its own timeout setting which is different from the rest of SWTBot. Is there a specific reason to do so. I only ask this because it introduces an inconsistency with the rest of swtbot.

Are you OK with me removing the get/set timeout() messages ?
Comment 7 Ketan Padegaonkar CLA 2010-08-13 13:14:45 EDT
Libor,

I've fixed this change and pushed it out to trunk(svn rev:598, git rev: 7d5bc3) with some cleanups. The timeouts have been removed to use the global timeout instead, to make the browser be consistent with the rest of swtbot widgets. Let me know your thoughts or concerns before I close this issue out.

See http://github.com/ketan/swtbot/commit/7d5bc39bd24e018c5c22a8cb41794e83ad3d1272 for the changeset.
Comment 8 Ketan Padegaonkar CLA 2010-08-13 13:14:47 EDT
Created attachment 176571 [details]
mylyn/context/zip
Comment 9 Libor Zoubek CLA 2010-08-16 11:17:32 EDT
Hi Ketan, 

thanks for adopting the patch and fixing it. Regarding to timeout - this was the timeout for the server, which is loading the page. I think it would be good to revert it, if you don't mind. Yes, basically we are waiting for a component as it gets into some state, but in this case it is dependent on bandwidth or server resources. It makes sense to me to have the timeout set for this component explicitly.  e.g I was not able to pass tests with timeout < 5s in my environment, 'cause eclipse.org is quite slow for me.