I am trying to use the beanshell script posted here to get the path of the jmx that is being run in my jmeter test - Access to JMeter script path
It is working and if I log the output of the path when set by beanshell or view the variables with the debugger I get the path to the script displayed as I expected -
c:\my\path\to\script
but when I then try to pass that variable into sendKeys, the slashes "\" are being removed so -
c:mypathtoscript
And this doesn't work so I am unable to attach/upload my file..
Sure I am missing something stupid
Thanks
There are at least 2 ways to get this done without using Beanshell:
Call FileServer methods from WebDriver Sampler:
Get the value from JMeterVariables
Example full code:
Comprehensive information on accessing JMeter API classes from WebDriver Sampler and few more tips and tricks: The WebDriver Sampler: Your Top 10 Questions Answered