2

Is it possible to specify a relative path, rather than an absolute one, when specifying the location of a data file when doing data driven development with the SelBlocks add-on?

I'm working on a small team and we'd love to be able to have our tests be portable and eventually become part of our production process. We are currently using the Selenium IDE to write the tests and we have some people on the team using Macs, some using Windows, etc. So, right now, the 'forXML' command requires an absolute path, like:

forXML|file:///C:/data.xml

This isn't terribly portable. It would be handy to just do something like:

forXML|file:///./data.xml

and that would pull up a data.xml file located in the same directory as the test case or the current test suite or something. I've played with various versions of the syntax and I can't figure out anything that will pull up a file via some 'relative' path. Is this even possible?

Thanks

oconnellc
  • 85
  • 1
  • 6
  • if you are eventually going to make this a production process, maybe you should consider getting away from the IDE. In the long run, if you take my advice - you'll thank me. – ddavison Nov 11 '13 at 20:31
  • 1
    That is part of the plan. The long term goal is to be writing tests in java or groovy and using the API to test our pages. That won't be happening for a while. In the meantime, my team does have the skills to create tests using the IDE and I see no point in not taking advantage of that now. There are a lot of benefits to the short term 'solution' (anything that helps testing become part of the culture has a lot of value in my eyes) and being able to do this would make the transition a lot easier for people who are a bit wary of what they are considering unnecessary overhead. – oconnellc Nov 13 '13 at 20:15

2 Answers2

1

Paths are relative to the running script itself. Examples:

forXML|data.xml
forXML|data_dir/data.xml

See documentation here: http://refactoror.wikia.com/wiki/Selblocks_Reference

Chris Noe
  • 36,411
  • 22
  • 71
  • 92
  • This is great. Thanks. I had been stuck using syntax that looked like this: forXML|file:///C:/dataDir/data.xml Every permutation of that that I used failed. Thanks again for great tool. – oconnellc Dec 10 '13 at 20:20
0

Paths are relative to the running script itself. Examples:

forXML|data.xml forXML|data_dir/data.xml

This is not working for me, works only using an absolute path like forXML|file:///C:/dataDir/data.xml

Having it relative, or at least configurable as a parameter ([yourpath]filename.xml)would be great

Community
  • 1
  • 1