21 10 / 2010
Selenium Relative Path Issues
Have you ever seen this stupid message after reloading a test suite in Selenium IDE?
error loading test case: [Exception… “Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIFileInputStream.init]” nsresult: “0x80520012 (NS_ERROR_FILE_NOT_FOUND)” location: “JS frame :: chrome://selenium-ide/content/file-utils.js :: anonymous :: line 48” data: no]
And here is the annoying message captured from my MacBook Pro –

The fun part of this rather cryptic message is that there is one identifiable note that is repeated – and that is NS_ERROR_FILE_NOT_FOUND – which prompted me to load my Selenese test suite into my favorite web page editor.
To my surprise – I noticed that the relative path is padded, and padded incorrectly.

This padding of the relative path occurs whenever you save a test suite in Selenium IDE (and in particular, this occurs on a Mac environment).
I played around on “The Google” and discovered that this problem also occurs on a variety of platforms, including Windows environments. During my time at bat, I’ve built a few Selenium test suites on Windows, and have never seen this before – since I explicitly give the root drive and absolute path to my test cases. When I reload my test suite, and select individual cases to edit from the Selenium IDE – I do so without issue. Which led me to a solution…
So how do you fix it?
Well, add the absolute path to your test suite script – as such…
<tr><td><a href=”/Users/arterberry/SQA/master/0000 Config/setup_Test.html”>setup_Test</a></td></tr>
I simply replaced all of the relative paths with the absolute path – and reloaded my test suite. When I made updates to my selected test cases and saved them from the Selenium IDE – the path settings remained in place. Voila!
Stupid path issue thingy.
Permalink 9 notes