android webview 63,在webview切换的时候提示“Chrome version must be >= 63.0.3239.0 ”

# coding=utf-8

from appium import webdriver

from time import sleep

def get_driver():

capabilities = {

"platformName": "android",

"deviceName": "192.168.56.101:5555",

"app": "/Users/francis/Projects/Appium/app_package/release.apk_1.2.1.apk",

# "appActivity": "com.rootoken.wallet.MainActivity",

"noReset": "true"

}

driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", capabilities)

sleep(2)

return driver

def window_handle():

# 窗口切换到新打开的窗口

c_window = driver.current_context

print(c_window)

all_handles = driver.contexts

for handle in all_handles:

print(handle)

if 'WEBVIEW' in handle:

driver.switch_to.context(handle)

print('跳转到webview模式')

print('跳转当前窗口句柄:' + handle)

break

def get_size():

size = driver.get_window_size()

width = size['width']

height = size['height']

return width, height

def swipe_left():

size = get_size()

x1 = size[0]*9/10

y1 = size[1]/2

x = size[0]/10

y = y1

driver.swipe(x1, y1, x, y)

def swipe_right():

size = get_size()

x1 = size[0]/10

y1 = size[1]/2

x = size[0]*9/10

y = y1

driver.swipe(x1, y1, x, y)

def swipe_up():

size = get_size()

x1 = size[0]/2

y1 = size[1]*9/10

x = x1

y = size[1]/10

driver.swipe(x1, y1, x, y)

def swipe_down():

size = get_size()

x1 = size[0]/2

y1 = size[1]/10

x = x1

y = size[1]*9/10

driver.swipe(x1, y1, x, y)

def swipe_on(direction):

if direction == 'up':

swipe_up()

elif direction == 'down':

swipe_down()

elif direction == 'left':

swipe_left()

else:

swipe_right()

driver = get_driver()

# # language_choice = '//android.widget.Button[contains(@content-desc, "简体中文")]'

# language_choice = '简体中文'

# sleep(3)

# driver.find_element_by_accessibility_id(language_choice).click()

sleep(3)

swipe_on('left')

swipe_on('left')

swipe_on('left')

sleep(2)

window_handle()

# step_in = driver.find_elements_by_class_name('android.widget.Button')

# step_in[1].click()

# driver.find_element_by_link_text('进入ROOTOKEN').click()

日志:

[debug] [ADB] Running '/Users/francis/Downloads/APPIUM/android-sdk-macosx/platform-tools/adb -P 5037 -s 192.168.56.101\:5555 shell dumpsys package com.android.chrome'

[Chromedriver] Unable to discover Chrome version. Using Chromedriver 2.37 at '/usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver'

[Chromedriver] Set chromedriver binary as: /usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver

[debug] [Chromedriver] Killing any old chromedrivers, running: pkill -15 -f "/usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver.*--port=8000"

[Chromedriver] No old chromedrivers seemed to exist

[debug] [Chromedriver] Cleaning any old adb forwarded port socket connections

[debug] [ADB] List forwarding ports

[debug] [ADB] Running '/Users/francis/Downloads/APPIUM/android-sdk-macosx/platform-tools/adb -P 5037 -s 192.168.56.101\:5555 forward --list'

[debug] [ADB] Removing forwarded port socket connection: 12872

[debug] [ADB] Running '/Users/francis/Downloads/APPIUM/android-sdk-macosx/platform-tools/adb -P 5037 -s 192.168.56.101\:5555 forward --remove tcp\:12872'

[Chromedriver] Spawning chromedriver with: /usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver --url-base=wd/hub --port=8000 --adb-port=5037 --verbose

[debug] [Chromedriver] Chromedriver version: '2.37.544337'

[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8000/wd/hub/status] with no body

[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8000/wd/hub/status] with no body

[debug] [JSONWP Proxy] Got response with status 200: "{\"sessionId\":\"\",\"status\":0,\"value\":{\"build\":{\"version\":\"alpha\"},\"os\":{\"arch\":\"x86_64\",\"name\":\"Mac OS X\",\"version\":\"10.11.6\"}}}"

[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.rootoken.wallet","androidUseRunningApp":true,"androidDeviceSerial":"192.168.56.101:5555"}}}

[debug] [Chromedriver] Webview version: 'Chrome/51.0.2704.91'

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值