October 5th, 2008
It’s one of those days I’m not sure if it’s Fall or Spring. Did I sleep through the winter last night? Piercing rays interplay with the tattered cumulus cloak, the breath is full of damp snowmelt. I feel a buzzing latency. Something will happen.
Posted in Observation | No Comments »
September 26th, 2008
UI-Element has been integrated into Selenium Core in the project’s subversion repository for some time now. This means no special tricks are necessary to use it - just specify your map file as a user extension! I’m posting this announcement mainly because it seems my original UI-Element post is at the top of Google’s search results, and I wanted to make clear that some things have changed significantly since it was published (but don’t want to rewrite the thing … you know, for posterity!).
Here’s the updated documentation link (if it doesn’t move again).
In other news, there is now a Groovy formatter for Selenium IDE, and support for a special GroovySeleneseTestCase which makes it possible to merge *AndWait commands into single commands. For example:
clickAndWait | foo
with the Java formatter translates into:
selenium.click("foo");
selenium.waitForPageToLoad("30000");
while the Groovy formatter simply says:
selenium.clickAndWait("foo")
Cleaner, and more expressive.
Posted in Code, Selenium | 2 Comments »
August 28th, 2008
A couple of SUNY whipper-snappers pull up at the light just as I’m snapping into an organic banana.
“Yeah, yeah! Eat that banana!” they holler at me.
I roll down the window. “Don’t you wish you had one too?” I call back.
There’s a stunned silence. I guess they didn’t expect me to reply, because for all the swagger in their voices a second ago, them seem to be a little sheepish now, not knowing what to say.
Emboldened, I continue: “Then all three of us could be sittin’ here, eatin’ bananas together!!!”
Now they’re really at a loss for words!
Posted in Laughter | 1 Comment »
May 14th, 2008
Several people have asked if it is possible to specify user extension Javascript dynamically with the RC, as opposed to on the command line with the -userExtensions flag when starting up the server. It wasn’t possible before.
It should be now.
If you build from r2291 or greater from the RC trunk, you can play with it. Basically, the extension Javascript must be specified before the browser is launched, and stays in-play until the session is closed. A sample test has been checked in here:
SessionExtensionJsTest.java
This probably doesn’t work for proxy injection mode yet.
Happy extending!
Update
It appears too easy to encounter the “414 Request URI Too Large” issue. I’m looking into this.
Update
Looks like the 414 issue is related specifically to the Perl driver (see this Clearspace post); I noticed it when using Perl, but did not see the issue when running an equivalent test in Groovy:
import com.thoughtworks.selenium.*
class URILengthTest extends GroovyTestCase {
def selenium
@Override
void setUp() {
selenium = new DefaultSelenium('localhost',
4444, '*firefox',
'http://alistapart.com')
}
@Override
void tearDown() {
selenium.stop()
}
void testURILength() {
def extensionJs = new File(
'selenium-core/src/main/resources/core/scripts/ui-map-sample.js').text
selenium.setExtensionJs(extensionJs)
selenium.start()
selenium.open('http://alistapart.com')
selenium.click(
'ui=allPages::section(section=topics)')
selenium.waitForPageToLoad('5000')
}
}
Update
Unfortunately, the 414 issue also affects the Python and Ruby client drivers (I just tested and verified this). I’m not about to fix them right this moment, so it appears the you can only truly take advantage of the per-session extension feature (i.e. include extensions of arbitrary size) in Java and Groovy for now.
The good news is that this issue has already been reported, and JIRA tickets created (SRC-319 for Perl, SRC-321 for Python, SRC-322 for Ruby, and others for C# and PHP).
Posted in Code, Selenium | No Comments »
April 24th, 2008
I recently made some performance improvements to the ajaxslt XPath library Selenium uses to drive XPaths in IE. One user asked me whether those could be made available. The answer is, they’re already in the Core subversion trunk! So you can pull down a copy and see if it helps with your IE woes.
Thought I’d also expose the tool I mentioned earlier that I’ve been using to find the places to optimize. You can play with the jsprofile sample tests now without checking out any code. Cool!
Keep in mind that the sample Google News page contains very old news. 
Posted in Selenium | No Comments »