<small id='pNkgh'></small><noframes id='pNkgh'>

  1. <legend id='pNkgh'><style id='pNkgh'><dir id='pNkgh'><q id='pNkgh'></q></dir></style></legend>
    <i id='pNkgh'><tr id='pNkgh'><dt id='pNkgh'><q id='pNkgh'><span id='pNkgh'><b id='pNkgh'><form id='pNkgh'><ins id='pNkgh'></ins><ul id='pNkgh'></ul><sub id='pNkgh'></sub></form><legend id='pNkgh'></legend><bdo id='pNkgh'><pre id='pNkgh'><center id='pNkgh'></center></pre></bdo></b><th id='pNkgh'></th></span></q></dt></tr></i><div id='pNkgh'><tfoot id='pNkgh'></tfoot><dl id='pNkgh'><fieldset id='pNkgh'></fieldset></dl></div>
    • <bdo id='pNkgh'></bdo><ul id='pNkgh'></ul>

    1. <tfoot id='pNkgh'></tfoot>
    2. 使用机器人框架脚本和 chromedriver 在 Android 设备中

      时间:2023-08-29

          <small id='dFyKX'></small><noframes id='dFyKX'>

        • <tfoot id='dFyKX'></tfoot>

              <legend id='dFyKX'><style id='dFyKX'><dir id='dFyKX'><q id='dFyKX'></q></dir></style></legend>
                <bdo id='dFyKX'></bdo><ul id='dFyKX'></ul>
                  <tbody id='dFyKX'></tbody>
                <i id='dFyKX'><tr id='dFyKX'><dt id='dFyKX'><q id='dFyKX'><span id='dFyKX'><b id='dFyKX'><form id='dFyKX'><ins id='dFyKX'></ins><ul id='dFyKX'></ul><sub id='dFyKX'></sub></form><legend id='dFyKX'></legend><bdo id='dFyKX'><pre id='dFyKX'><center id='dFyKX'></center></pre></bdo></b><th id='dFyKX'></th></span></q></dt></tr></i><div id='dFyKX'><tfoot id='dFyKX'></tfoot><dl id='dFyKX'><fieldset id='dFyKX'></fieldset></dl></div>
                本文介绍了使用机器人框架脚本和 chromedriver 在 Android 设备中打开 Chrome 浏览器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                Ubuntu 14.04 上的自动化设置:

                Automation setup on Ubuntu 14.04:

                Robot Framework 2.9.2 (Python 2.7.6 on linux2)
                selenium2library-1.7.4
                ChromeDriver 2.20.353124
                Device under testing:  Nexus 7 (KitKat 4.4, Chrome v. 47)
                

                使用 Python 运行以下示例测试时一切正常--> URL 在 Nexus 设备的 Chrome 上正确启动.

                Everything works fine when running this following example test with Python --> URL is launched properly on Chrome in Nexus device.

                    from selenium import webdriver
                capabilities = {
                  'chromeOptions': {
                    'androidPackage': 'com.android.chrome',
                  }
                }
                driver = webdriver.Remote('http://localhost:9515', capabilities)
                driver.get('http://google.com')
                driver.quit()
                

                但是当我尝试使用 Robot Framework 脚本进行相同的工作时,实际问题存在.我已经尝试了几种方法,但它总是只在桌面 Chrome 浏览器上打开 URL——而不是在移动设备(Nexus 平板电脑)中.

                But actual problem exists when I try to get the same working with Robot Framework script. I've tried several ways but always it just opens URL on desktop Chrome browser - not in mobile (Nexus tablet) as it should be.

                以下 RF 脚本是我最近的尝试.我认为问题在某种程度上与 desired_capabilities 有关,但我只是没有找到正确的定义方式

                The following RF script was my latest try. I think problem is related somehow to desired_capabilities but I just haven't find the correct way how it should be defined

                *** Settings ***
                Library         Selenium2Library
                *** Variables ***
                ${chromedriver}    http://localhost:9515
                ${android} =    Create List   androidPackage    com.android.chrome  
                ${desired_capabilities} =    Create Dictionary   {chromedriver}    chromeOptions    ${android}
                
                *** Keywords ***
                Open Page
                    Open Browser    http://www.google.com 
                    ... browser=chrome   
                    ... desired_capabilities=${desired_capabilities}
                

                有人遇到同样的问题吗?我做错了什么?

                Anyone had same issue? What I'm doing wrong?

                推荐答案

                所需的功能参数是 不是为本地网络驱动程序处理.在解决此问题之前,您可以使用更灵活的 Create Webdriver 关键字代替 Open Browser.我不能说这是否是在 Android 上启动 Chrome 的最佳方式,但这里是您的 Python 代码的直接翻译:

                The desired capabilities argument is not processed for local webdrivers. Until that is resolved you can use the more flexible Create Webdriver keyword instead of Open Browser. I cannot speak to whether this is the best way to launch Chrome on Android, but here is a direct translation of your Python code:

                ${options}=    Create Dictionary    androidPackage=com.android.chrome
                ${caps}=    Create Dictionary    chromeOptions=${options}
                Create Webdriver    Remote    command_executor=http://localhost:9515    desired_capabilities=${caps}
                Go To    http://google.com
                Close Browser
                

                这篇关于使用机器人框架脚本和 chromedriver 在 Android 设备中打开 Chrome 浏览器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:Windows 10 中的 Android AVD 模拟器缩放问题 下一篇:DynamoDB 自动递增 ID &amp;服务器时间(iOS SDK)

                相关文章

                最新文章

                1. <tfoot id='A58cZ'></tfoot>
                    <bdo id='A58cZ'></bdo><ul id='A58cZ'></ul>
                  <legend id='A58cZ'><style id='A58cZ'><dir id='A58cZ'><q id='A58cZ'></q></dir></style></legend>

                  <small id='A58cZ'></small><noframes id='A58cZ'>

                  1. <i id='A58cZ'><tr id='A58cZ'><dt id='A58cZ'><q id='A58cZ'><span id='A58cZ'><b id='A58cZ'><form id='A58cZ'><ins id='A58cZ'></ins><ul id='A58cZ'></ul><sub id='A58cZ'></sub></form><legend id='A58cZ'></legend><bdo id='A58cZ'><pre id='A58cZ'><center id='A58cZ'></center></pre></bdo></b><th id='A58cZ'></th></span></q></dt></tr></i><div id='A58cZ'><tfoot id='A58cZ'></tfoot><dl id='A58cZ'><fieldset id='A58cZ'></fieldset></dl></div>