Porting changes from thucydides appium-driver-support