Forum Discussion

maxrussell's avatar
maxrussell
Contributor
10 years ago
Solved

Prefix a property transfer in header

I am using a property transfer to take an oAuth access_token from a response and transfer it to my next GET REST request. The header Name is "Authorization" and the value needs to be in the format "Bearer xxxxxx" ( where xxxxxx is the transferred access_token)

 

How to I add the Bearer prefix into my GET request? Do I need to add something in the property transfer target? Or is this done via test step properties?

  • Below approach is not recommended by many users but based on the flow this will work.

     

    function Window_NoResultsFound() {
        var noResultsFoundAlert = null;
        try{
            noResultsFoundAlert = eval(ReadObjectsFromXML.noResultsFoundAlert);
        }catch(ex){
            //if you want you can Log.erro here too
        }
        if (noResultsFoundAlert == null) {
            Log.Checkpoint("Window is not displayed as expected.")    
        } else {
            if (noResultsFoundAlert.Exists) {
                Log.Error("Windows is displayed");
            } else {
                Log.Checkpoint("Window is not displayed as expected.");
            }
        }
    }