我知道这个问题对您来说很容易,但是对我来说却很困难
我想通过Android驱动程序自动测试我的网站
,我发现了这个 https://sites.google.com/a/chromium.org/chromedriver/getting-started/getting-started---android
所以我安装了用于开始android测试的
硒服务器-https://www.seleniumhq.org/download/
java-https://www.java.com/ko/download/windows-64bit.jsp
facebook / php-webdriver-https://github.com/facebook/php-webdriver
laravel-在控制台中
android studio-https://developer.android.com/studio/install?hl=ko
我确实在计算机中设置了环境,例如下面的
# Login and get the auth token
data = {"email": "", "password": ""}
login_response = requests.post("https://api.weightgurus.com/v3/account/login", data=data)
login_json = login_response.json()
# grab all your data
data_response = requests.get(
"https://api.weightgurus.com/v3/operation/",
headers={
"Authorization": f'Bearer {login_json["accessToken"]}',
"Accept": "application/json, text/plain, */*",
},
)
scale_data_json = data_response.json()
for entry in scale_data_json["operations"]:
print(entry)
import pyodbc
server = ''
database = ''
username = ''
password = ''
driver='{ODBC Driver 13 for SQL Server}'
cnxn = pyodbc.connect('DRIVER='+driver+';SERVER='+server+';PORT=1433;DATABASE='+database+';UID='+username+';PWD='+ password)
cursor = cnxn.cursor()
并且通过台式机chrome驱动程序成功进行了测试。
但是对于Android驱动程序来说失败
我关于硒的代码是
' $ java -jar selenium ~~~~~~ '
失败,错误代码为
/ start Chrome with 5 second timeout
$host = 'http://localhost:4444/wd/hub';
$capabilities = DesiredCapabilities::android();
$driver = RemoteWebDriver::create($host, $capabilities, 5000);
$driver->get('https://www.seleniumhq.org/');
我该如何解决这种情况 帮我,,,,,,请告诉我如何解决这个,,,,,
我希望您能理解我是否犯错,因为我的英语水平很低,谢谢您阅读