2016-12-04 5 views
0

У меня есть настройка Cucumber, Webdriver-IO и Appium. Все, кажется, разговаривает друг с другом, однако я получаю Error: no such session при попытке перейти на http://google.com.«Ошибка: нет такой сессии» Webdriver-IO, Appium

На устройстве Android открывается браузер Chrome, затем он быстро закрывается.

webdriverio.js

//webdriverio.js 
let client = WebDriverIO.remote({ 
    desiredCapabilities: { 
     platformName: 'Android',       
     browserName: 'chrome',       
     deviceName: 'test', 
    }, 
    host: 'localhost',         
    port: 4723,          
    waitForTimeout: 120 * 1000, 
}); 

global.client = client; 

module.exports = function() { 
    this.registerHandler('BeforeFeatures', function(event, done) { 
    client.init().call(done); 
    }); 

    this.registerHandler('AfterFeatures', function(event, done) { 
    client.end().call(done); 
    }); 
}; 

env.js

// env.js 
module.exports = function() { 
    // added because default 50000 ms was long enough 
    this.setDefaultTimeout(60 * 1000); 
}; 

search_steps.js

// search_steps.js 
module.exports = function() { 
    this.Given('I have visited Google', function (done) { 
    client 
     .url('http://google.com') 
     .call(done); 
    }); 

    this.When('I search for {arg1:stringInDoubleQuotes}', function (arg1, done) { 
    // Write code here that turns the phrase above into concrete actions 
    client 
     .setValue('input[name="q"]', 'Kittens') 
     .call(done); 
    }); 


    this.Then('I see {arg1:stringInDoubleQuotes}', function (arg1, done) { 
     // Write code here that turns the phrase above into concrete actions 
     client 
      .getValue('input[name="q"]').then(function(text){ 
       expect('Kittens').to.eql(text); 
      }) 
      .call(done); 
    }); 


}; 

ответ

0

вопрос это chromedriver 2.21.371459, который поставляется с моей версией Appium (1.3.5) для Mac. Я загрузил последнюю версию хромированного рекордера и перезаписал существующий, который поставляется вместе с Appium. См. Ответ здесь Chrome opens for a second and the crashes для окон. Для mac местоположение chromeedriver exec поставляется с Appium. /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-android-driver/node_modules/appium-chromedriver/chromedriver/mac