Forum Discussion

harry21's avatar
harry21
Occasional Contributor
7 years ago

Property Expansion not working in 'File Wait' step in ReadyAPI

I have a Property step in my Testcase holds 2 values as shown below

 

Property step

After some internal processing a file will be stored in the FilePath with the filename Transaction_ID. I'm trying to validate the file using "File Wait" step in my testcase using Property Expansion ${TC Properties#FilePath}${TC Properties#Transaction_ID}.txt

Upon running the testcase, it is failing due to the reason "File not found within specified timeout". 

 

Whereas, i've hardcoded the filepath value as 

\\ldvdevinvrt01\resources\Sharepipe\CC8F5797-8CB5-4175-A564-781A5DA76221.txt and provided in the 'File Wait' step. Then it is executing successfully without any error.

 

Please someone help out with this! 

 

PS: Took this hardcoded value using Groovy by printing the Property Expansion value mentioned above. I believe no issues in Property Expansion syntax

7 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    Are you missing path separator?
    Try changing from
    ${TC Properties#FilePath}${TC Properties#Transaction_ID}.txt

    To:
    ${TC Properties#FilePath}/${TC Properties#Transaction_ID}.txt

  • harry21's avatar
    harry21
    Occasional Contributor

    I edited the FilePath value in Properties by adding separator(\\ldvdevinvrt01\resources\Sharepipe\) . Still it is failing..

    Executed this below groovy and got the correct FilePath value

     

    def path = context.expand('${TC Properties#FilePath}${TC Properties#Transaction_ID}.txt')
    log.info path

    Output Returned: \\ldvdevinvrt01\resources\Sharepipe\CC8F5797-8CB5-4175-A564-781A5DA76221.txt

     

    While giving this output value in FileWait step, TC passes. Problem is with Property Expansion.

    • nmrao's avatar
      nmrao
      Champion Level 3
      Looks you are trying to access the files from network.
      Can you map "\\ldvdevinvrt01" to a local drive say, Z and replace the FilePath with "Z:/resources/Sharepipe/"
      • harry21's avatar
        harry21
        Occasional Contributor

        Nope :smileysad: still failing.. TC Passes with the hardcoded value (Y:\Sharepipe\CC8F5797-8CB5-4175-A564-781A5DA76221.txt