Can you specify a 'relative' path for the

2019-07-15 14:39发布

问题:

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

回答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



回答2:

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