Skip to content

Commit

Permalink
use dumpWindowHierarchy for xml page source as well since it's more r…
Browse files Browse the repository at this point in the history
…eliable
  • Loading branch information
jlipps committed Apr 9, 2014
1 parent 5b79ece commit 6af56cb
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions lib/devices/android/android-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,21 +455,14 @@ androidController.getPageSource = function (cb) {

androidController.getPageSourceXML = function (cb) {
var xmlFile = temp.path({suffix: '.xml'});
var onDeviceXmlPath = this.dataDir + '/local/tmp/dump.xml';
async.series(
[
function (cb) {
var cmd = this.adb.adbCmd + ' shell uiautomator dump /data/local/tmp/dump.xml';
logger.debug('getPageSourceXML command: ' + cmd);
exec(cmd, { maxBuffer: 524288 }, function (err, stdout, stderr) {
if (err) {
logger.warn(stderr);
return cb(err);
}
cb(null);
});
this.proxy(["dumpWindowHierarchy"], cb);
}.bind(this),
function (cb) {
var cmd = this.adb.adbCmd + ' pull /data/local/tmp/dump.xml "' + xmlFile + '"';
var cmd = this.adb.adbCmd + ' pull ' + onDeviceXmlPath + ' "' + xmlFile + '"';
logger.debug('transferPageSourceXML command: ' + cmd);
exec(cmd, { maxBuffer: 524288 }, function (err, stdout, stderr) {
if (err) {
Expand Down

0 comments on commit 6af56cb

Please sign in to comment.