How to mimic selenium in cache object Script