﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Adam commented on Writing WatiN Tests</title><description>... but is it free?
</description><link>http://ayende.com/2193/writing-watin-tests#comment6</link><guid>http://ayende.com/2193/writing-watin-tests#comment6</guid><pubDate>Wed, 28 Mar 2007 21:21:28 GMT</pubDate></item><item><title>Alex commented on Writing WatiN Tests</title><description>You can also check SWExplorerAutomation (SWEA) from http://webiussoft.com. SWEA was specially designed to automate complex DHTML/AJAX applications.
</description><link>http://ayende.com/2193/writing-watin-tests#comment5</link><guid>http://ayende.com/2193/writing-watin-tests#comment5</guid><pubDate>Tue, 27 Mar 2007 02:15:22 GMT</pubDate></item><item><title>Jeroen van Menen commented on Writing WatiN Tests</title><description>David, Ayende,
  
  
Just to inform you, the next release of WatiN will include:
  
  
Element.WaitUntil(Attribute)
  
Element.WaitUntil(atributename, value)
  
  
Example:
  
  
ie.Element(PartialId(partialElementId)).WaitUntil("disabled", "false")
  
  
or
  
  
ie.Element(PartialId(partialElementId)).WaitUntil(new Attribute("disabled", "false"));
  
  
BTW another way of writing:
  
  
ie.Element(PartialId(partialElementId)).GetAttributeValue("disabled") != "true"
  
  
would be using multiple attribute support:
  
  
ie.Element(PartialId(partialElementId) &amp;&amp; Find.ByCustum("disabled", "false")).Exists.
  
</description><link>http://ayende.com/2193/writing-watin-tests#comment4</link><guid>http://ayende.com/2193/writing-watin-tests#comment4</guid><pubDate>Sat, 10 Mar 2007 12:09:56 GMT</pubDate></item><item><title>Ayende Rahien commented on Writing WatiN Tests</title><description>Partial Id is just a regex:
  
  
public Id PartialId(string partialElementId)
  
{
  
   return new Id(new Regex(".*"+partialElementId+"$");
  
}
  
  
This is from memory, so it may be a bit off, but:
  
  
public void WaitUntilEnabled(string partialElementId)
  
{
  
   SimpleTimer timer = new SimpleTimer(IE.Settings.WaitUnitCompleteTimeout);
  
do
  
{
  
  if( ie.Element(PartialId(partialElementId)).GetAttributeValue("disabled") != "true")
  
  return;
  
 Thread.Sleep(200);
  
}
  
while(!timer.Elapsed);
  
  
throew TimeoutException("Waited too long for "+partialElementId+" to become enabled");
  
}
</description><link>http://ayende.com/2193/writing-watin-tests#comment3</link><guid>http://ayende.com/2193/writing-watin-tests#comment3</guid><pubDate>Sat, 10 Mar 2007 00:20:48 GMT</pubDate></item><item><title>David Stull commented on Writing WatiN Tests</title><description>Came across this, and it looked to be a life-saver. Unfortunately, some of the code (PartialId, WaitUntilEnabled) don't seem to be from WatiN. Am I missing someting? If these are methods that you wrote, would you mind sharing? I, for one, would find it very beneficial. Thanks
</description><link>http://ayende.com/2193/writing-watin-tests#comment2</link><guid>http://ayende.com/2193/writing-watin-tests#comment2</guid><pubDate>Fri, 09 Mar 2007 23:16:10 GMT</pubDate></item><item><title>Christopher Bennage commented on Writing WatiN Tests</title><description>Thanks, examples and advice like are this are really time-savers.
</description><link>http://ayende.com/2193/writing-watin-tests#comment1</link><guid>http://ayende.com/2193/writing-watin-tests#comment1</guid><pubDate>Fri, 09 Mar 2007 14:31:50 GMT</pubDate></item></channel></rss>