<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>try {} catch () &#187; Web</title>
	<atom:link href="http://blog.gerardin.info/archives/tag/web/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.gerardin.info</link>
	<description>Java, Agile, the Web and other nice things</description>
	<lastBuildDate>Tue, 14 Jun 2011 09:48:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>GWT is the present of web development</title>
		<link>http://blog.gerardin.info/archives/521</link>
		<comments>http://blog.gerardin.info/archives/521#comments</comments>
		<pubDate>Wed, 04 Nov 2009 16:24:50 +0000</pubDate>
		<dc:creator>Olivier Gérardin</dc:creator>
				<category><![CDATA[GWT]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://blog.gerardin.info/?p=521</guid>
		<description><![CDATA[I&#8217;ve read a few articles by people who didn&#8217;t like GWT, but usually I don&#8217;t care to reply because it requires a lot of time to do it properly. However, today I came across this article on dzone: Lost in Translation or Why GWT Isn’t the Future of Web Development. This one was troubling because [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.gerardin.info/archives/125/gwt-logo" rel="attachment wp-att-140" class="liimagelink"><img class="alignleft size-full wp-image-140" style="border: 0pt none; margin-left: 10px; margin-right: 10px;" title="Logo GWT" src="http://blog.gerardin.info/wp-content/uploads/2009/04/gwt-logo.png" alt="Logo GWT" width="100" height="100" /></a>I&#8217;ve read a few articles by people who didn&#8217;t like GWT, but usually I don&#8217;t care to reply because it requires a lot of time to do it properly. However, today I came across this article on dzone:<a href="http://www.cforcoding.com/2009/10/lost-in-translation-or-why-gwt-isnt.html" class="liexternal"> Lost in Translation or Why GWT Isn’t the Future of Web Development.</a></p>
<p>This one was troubling because it made good points on the way, some that I can&#8217;t agree more with (like the quality of Ext-GWT&#8230;) but it comes to a completely biased conclusion about GWT. So I took some time and <a href="http://www.cforcoding.com/2009/10/lost-in-translation-or-why-gwt-isnt.html?showComment=1257351073744#c2513960243247892466" target="_blank" class="liexternal">wrote a reply</a>&#8230;</p>]]></content:encoded>
			<wfw:commentRss>http://blog.gerardin.info/archives/521/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WebDriver: automated web UI testing</title>
		<link>http://blog.gerardin.info/archives/217</link>
		<comments>http://blog.gerardin.info/archives/217#comments</comments>
		<pubDate>Thu, 04 Jun 2009 15:55:04 +0000</pubDate>
		<dc:creator>Olivier Gérardin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Automated testing]]></category>
		<category><![CDATA[Ext-GWT]]></category>
		<category><![CDATA[JUnit]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://blog.gerardin.info/?p=217</guid>
		<description><![CDATA[Automating UI testing is not a trivial task, yet it is highly desirable as part of a complete non-regression test suite, which is (as everyone knows by now) a must-have for any project claiming to be agile. This is how I came across WebDriver while looking for ways to automate testing a GXT-generated frontend. While [...]]]></description>
			<content:encoded><![CDATA[<p>Automating UI testing is not a trivial task, yet it is highly desirable as part of a complete non-regression test suite, which is (as everyone knows by now) a must-have for any project claiming to be agile. This is how I came across WebDriver while looking for ways to automate testing a GXT-generated frontend.</p>
<p>While being quite similar in its goals to <a href="http://seleniumhq.org" target="_blank" class="liexternal">Selenium</a>, WebDriver takes a different approach: instead of interacting directly with the application&#8217;s JavaScript, it runs totally external to the browser and &#8220;drives&#8221; it, a bit like SeleniumRC.</p>
<p>Yes, it introduces a platform dependency, but this is mitigated by 2 points: the FirefoxDriver is available on all platforms, and you also have a HtmlDriver which is not platform-dependant, but unfortunately cannot work with JavaScript interfaces.</p>
<p>On the other hand, piloting the browser means you test exactly what the user will see. And depending on the browser is also a good thing because the browser is part of what you want to test! if your application has a glitch on IE which does not exist on Firefox (this is just an example of course&#8230;), then you want your tests to find out.</p>
<p>Writing a WebDriver test can be done in minutes. It&#8217;s simpy an API, so you can integrate it in any kind of Java code, including a JUnit test suite.</p>
<p>For example:</p>
<pre lang="java">import ...

public class TestWebDriver {
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();

driver.get("http://localhost:8080/myApp/MyHostPage.html");

WebElement checkbox = driver.findElement(By.xpath("//div[@id='checkbox-id']/input"));
checkbox.setSelected();

WebElement element = driver.findElement(By.id("submit-button-id"));
element.click();

System.out.println("Page title is: " + driver.getTitle());
}
}</pre>
<p>Can&#8217;t imagine much simpler than that. Want to test with IE ? Use InternetExplorerDriver instead of FirefoxDriver. Checking iPhone compatibility? Try IPhoneDriver.</p>
<p>As I&#8217;m working with GXT, there are a few things to be aware of. You will most often look for elements by ID, but of course the ID you set with GXT&#8217;s setId() is not always where you expect it to be. For example, if you set it on a Checkbox, it&#8217;s actually attached to the DIV that surrounds the INPUT element, not the INPUT element. This is why, in the example above, I used XPath to select the element, rather than direct selection by ID. When you want to access an element, the best is to have a look at the HTML by using an inspection tool such as Firebug or similar; then you can easily write an XPath expression that will select just the element you need.</p>
<p>WebDriver will eventually be integrated into Selenium 2.0.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.gerardin.info/archives/217/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

