Hot answers tagged watir-webdriver
create a path provider where you test data is located. in a file create a method that returns expanded path def datapath filename File.expand_path(File.join(File.dirname(__FILE__), filename)) end use it in your test browser.file_field(:name,"the_file").set(datapath(filename))
To use Chrome in Webdriver you have to be sure you did two things: chromedriver.exe is on your classpath you have to build a wrapper so the code knows where to find the binary and can start the chromedriverservice. More info can be found here
I've done something similar using events and/or autoit.. don't recall off the top of my head what the solution was (would need to go back and find that code) I'd recommend asking on the main StackOverflow site and tag the question with Watir and Watir-webdriver.. a lot more of the Watir folks watch that site than this one
One approach that my work is to extract paths like this to a config file of some point that could be set depending on where you run the script from. Then you can read the value out of the config at start up. Another approach I have taken in C# is to have a directory that is part of my project that gets built out with the project so if I have dependencies ...
Only top voted, non community-wiki answers of a minimum length are eligible