Не могу запустить тесты на эмуляторе с помощью Protractor+Appium.
Запустил Appium со стандартными параметрами на стандартном порту 4723
Взял пример кода с официального сайта protractor.org
config.js:
exports.config = {
seleniumAdress: 'http://0.0.0.0:4723/wd/hub',
capabilities: {
'browserName': 'chrome',
'appium-version': '1.8.1',
'platformName': 'Android',
'platformVersion': '7.0.0',
'deviceName': 'emulator-5554'
},
specs: ['test1.js']
};
test1.js:
describe('go to app', function () {
it('should open App', function () {
browser.ignoreSyncronization = true;
browser.get('google.com');
element(by.name('q')).sendKeys('Appium');
element(by.name('q')).submit();
element(by.linkText('Appium: Mobile App Automation Made Awesome.')).click();
})
})
Запускаю код с консоли ИДЕИ командой protractor config.js
и после этого ожидаю что все запросы будут проксироваться на указанный хост аппиума но он подымает селениум почем - не могу понять.
Вот стектрейс ИДЕИ:
Открыть логи
Andreys-MacBook-Pro:Appium andrey$ protractor config.js
[17:10:56] I/launcher - Running 1 instances of WebDriver
[17:10:56] I/local - Starting selenium standalone server…
[17:10:57] I/local - Selenium standalone server started at http://192.168.1.12:53801/wd/hub
Started
F
Failures:
- go to app should open App
Message:
Failed: invalid element state: Failed to execute ‘replace’ on ‘Location’: ‘google.com’ is not a valid URL.
(Session info: chrome=70.0.3538.77)
(Driver info: chromedriver=2.43.600229 (3fae4d0cda5334b4f533bede5a4787f7b832d052),platform=Mac OS X 10.13.6 x86_64)
Stack:
InvalidElementStateError: invalid element state: Failed to execute ‘replace’ on ‘Location’: ‘google.com’ is not a valid URL.
(Session info: chrome=70.0.3538.77)
(Driver info: chromedriver=2.43.600229 (3fae4d0cda5334b4f533bede5a4787f7b832d052),platform=Mac OS X 10.13.6 x86_64)
at Object.checkLegacyResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:546:15)
at parseHttpResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:509:13)
at doSend.then.response (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:441:30)
at process.internalTickCallback (internal/process/next_tick.js:77:7)
From: Task: Protractor.get(google.com) - reset url
at thenableWebDriverProxy.schedule (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:807:17)
at ProtractorBrowser.executeScriptWithDescription (/usr/local/lib/node_modules/protractor/built/browser.js:404:28)
at driver.controlFlow.execute.then.then.then (/usr/local/lib/node_modules/protractor/built/browser.js:679:25)
at ManagedPromise.invokeCallback_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1376:14)
at TaskQueue.execute_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:3084:14)
at TaskQueue.executeNext_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:3067:27)
at asyncRun (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2927:27)
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:668:7
at process.internalTickCallback (internal/process/next_tick.js:77:7)
From: Task: Run it(“should open App”) in control flow
at UserContext. (/usr/local/lib/node_modules/protractor/node_modules/jasminewd2/index.js:94:19)
From asynchronous test:
Error
at Suite. (/Users/andrey/projects/Appium/test1.js:2:5)
at Object. (/Users/andrey/projects/Appium/test1.js:1:63)
at Module._compile (internal/modules/cjs/loader.js:707:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:718:10)
at Module.load (internal/modules/cjs/loader.js:605:32)
at tryModuleLoad (internal/modules/cjs/loader.js:544:12)
1 spec, 1 failure
Finished in 0.127 seconds
[17:11:00] I/local - Shutting down selenium standalone server.
[17:11:00] I/launcher - 0 instance(s) of WebDriver still running
[17:11:00] I/launcher - chrome #01 failed 1 test(s)
[17:11:00] I/launcher - overall: 1 failed spec(s)
[17:11:00] E/launcher - Process exited with error code 1
Andreys-MacBook-Pro:Appium andrey$