Executing RFT script failed due to prop file can't be read
Hi,
I'm trying to execute RFT script from RQMl, not from shared location but from a test resource that is local to a test machine. I specified the path to the RFT project and was able to find the script i want to run (my RQM and RFT are on two different machines). In my RFT script, it reads through a property text file under the project root directory to get some parameter values. The result is that RQM says it cannot find the file thus failed. So I'm wondering if extra configuration is requried for RQM to have access to files in addition to RFT scripts file. Or, it's just not possible for RQM to find files other than scripts file? Thanks a lot in advance. |
5 answers
Hi, RQM does not execute anything, it only tells the adapter running on the client to execute something. In the case of RFT scripts, all the adapter is doing is executing the script through the RFT CLI using any parameters you specify through the RQM interface. My guess is that the issue is in your script. Have you run the test through the IDE to make sure that the problem is specific to execution through the adapter? You can also get the CLI command used to execute the script from the adapter console. In the past we've copied the command and executed it from a prompt on the RFT machine for debugging. |
Hi Aaron,
Thanks for your reply. Yes, my script can run successfully in RFT IDE. My initial try to run the command shown in the RQM adapter failed with the same error about properties file not found. So I copied the properties file to the default directory when command line propmpt is opened. On windows it's C:\Document and Settings\Admin\, and then it could work successfully. Then I run the script from RQM again... still failed :( If I copy the command in the RQM adapter and paste it in a cmd prompt, it can be run successfully. Why is that? Another thing, in the command received by RQM adapter, it has the following two options. I couldn't find a proper explanation in RFT info center and guess what? the xml file in -Drqm.task option does not exist at all. I wonder what's in that file. -Drqm.mode=true -Drqm.task="C:\DOCUME~1\admin\LOCALS~1\Temp\RQMRFTTask3067516581930803869.xml" Thank you and hope you can help a bit more. Hi, RQM does not execute anything, it only tells the adapter running on the client to execute something. In the case of RFT scripts, all the adapter is doing is executing the script through the RFT CLI using any parameters you specify through the RQM interface. My guess is that the issue is in your script. Have you run the test through the IDE to make sure that the problem is specific to execution through the adapter? You can also get the CLI command used to execute the script from the adapter console. In the past we've copied the command and executed it from a prompt on the RFT machine for debugging. |
Hi Aaron, Can you post your code for reading your properties file? Based on the fact that you had to put the properties file in the default command line directory, it sounds like you are using a local path rather than an absolute path when creating your File object. When you execute from RQM, RFT is called from the adapter, which works likes executing it from a Windows command prompt. This means that the working directory would be wherever the adapter is executing from and not necessarily the RFT project directory. You can verify the current working directory by logging the return value of System.getProperty("user.dir") before you attempt to get the file. If value returned is not the project directory, you'll have to modify your code to look for the file in the project directory. You can get the current project directory using getCurrentProject().getLocation(). There are also getProjectPath() and getProjectName() methods but those seem to return null for me. As for the extra command line arguments, I suspect those are adapter specific and not RFT arguments, but I do not know for sure. |
Hi
I am new to RFT tool, i want to compare two files and put the difference in third file, please some one help me in this Thanks a lot |
Hi I would suggest submitting this question to the RFT forum: http://www.ibm.com/developerworks/forums/forum.jspa?forumID=322 |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.