where is storedVars in soda

Problem

How to get storedVars array in selenium soda test? I expect that storeEval puts variable with given name to array storedVars. But storedVars is undefined. Or maybe I don't know in what scope I can access it.

var soda = require('soda')
    , assert = require('assert');
var browser = soda.createClient({
    host: 'localhost'
    , port: 4444
    , url: 'http://jquery.com'
    , browser: 'firefox'
});
browser.session(function(err){
    browser.open('/', function(err, body, res){
            browser.storeEval(" window.jQuery('.logo').height();", "height", function(err, body, res){
                // ---------------------------------------------------------------
                // how to get storedVars['height'] here?
                // ReferenceError: storedVars is not defined
                // ---------------------------------------------------------------
                console.log ("height: "+storedVars['height'] ); 
                if (err)
                {
                    throw err;
                }
                browser.testComplete(function(){

                });

            });
    });
});
Problem courtesy of: Maxim Yefremov

Solution

Using your example above, you can access storedVars like this:

var soda = require('soda')
    , assert = require('assert');
var browser = soda.createClient({
    host: 'localhost'
    , port: 4444
    , url: 'http://jquery.com'
    , browser: 'firefox'
});
browser.session(function(err){
    browser.open('/', function(err, body, res){
        browser.storeEval("window.jQuery('.logo').height();", "height", function(err, body, res){
            browser.getEval('${height}',function(err,val){
                if(err !== null) throw err
                console.log(val)
                browser.testComplete(function(){ });
            });
        });
    });
})

One thing is to make sure not to call testComplete before you get them though!

Solution courtesy of: hoonto

Discussion

There is currently no discussion for this recipe.

This recipe can be found in it's original form on Stack Over Flow.