Using Amber for Webtesting?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Using Amber for Webtesting?

Stefan Krecher
Hi,
i asked myself if Amber could be used for Webtesting?
Frameworks like selenium or canoo-webtest have severe issues - but if Amber could get "injected" into serverside-generated websites it could propably check the existence of the page elements or click buttons etc.
It would be so a fun and easy way to write SUnit-Tests for Websites in smalltalk ...
What do you think?
regards,
Stefan
Reply | Threaded
Open this post in threaded view
|

Re: Using Amber for Webtesting?

laurent laffont
I've tried last week and it's possible through an iframe. Ex:
...
loadAmber(....)
....
<iframe id="tested" src="../index.php" width='100%' height='500px' ></iframe>

Then in amber you can write something like:

|cwin|
cwin := (document getElementById: 'tested') contentWindow.
((cwin jQuery: 'input.searchTerms') element) at: 'value' put: 'harry potter'.
(cwin jQuery: 'form.search') submit.
(document getElementById: 'tested') load: [
  cwin := (document getElementById: 'tested') contentWindow.
  self assert: ((cwin jQuery: '.items') length > 0) ].

That assumes the tested site has jQuery. It needs some work to have a little framework / proxy to facilitate this, but I'm looking forward .....

Laurent.


On Mon, Sep 26, 2011 at 5:39 PM, Stefan Krecher <[hidden email]> wrote:
Hi,
i asked myself if Amber could be used for Webtesting?
Frameworks like selenium or canoo-webtest have severe issues - but if Amber could get "injected" into serverside-generated websites it could propably check the existence of the page elements or click buttons etc.
It would be so a fun and easy way to write SUnit-Tests for Websites in smalltalk ...
What do you think?
regards,
Stefan

Reply | Threaded
Open this post in threaded view
|

Re: Using Amber for Webtesting?

Stefan Krecher
Hi,
i think, some kind of proxy would be needed to inject the Amber-Source + jQuery
We always had two main issues with the "Big" ones (Selenium and Canoo Webtest):
1) dealing with javascript-alerts
2) identifying popup-windows
Do you think these problems could get solved with amber?
regards,
Stefan
Reply | Threaded
Open this post in threaded view
|

Re: Using Amber for Webtesting?

laurent laffont

On Tue, Sep 27, 2011 at 10:43 AM, Stefan Krecher <[hidden email]> wrote:
Hi,
i think, some kind of proxy would be needed to inject the Amber-Source + jQuery

yes
 
We always had two main issues with the "Big" ones (Selenium and Canoo Webtest):
1) dealing with javascript-alerts

one way is to redefine alert in the TestCase. Should be possible as we can write:

window.alert = function(m) { console.log(m); };
alert('test');
  
2) identifying popup-windows

same.
 
Laurent.

Do you think these problems could get solved with amber? 
regards,
Stefan