various test fixes and improvements
Merge pull request #2664 from sebv/master

Various test fixes and improvements
ci selendroid branch for build #4599.4