RobotFramework - Chrome模拟手机
Max.Bai
2017-04
Python - Selenium Chrome 模拟手机可以实现chrome浏览器模拟手机进行自动化测试,当然Robotframework也是可以的。
基本思路:
1.创建chromeoption
2.创建mobileEmulation字典包含模拟器的相关信息
3. 设置chromeoption的模拟器信息
4. 开始测试吧
测试脚本:
*** Settings ***
Library Selenium2Library
*** Test Cases ***
testmclient
${devname} Create Dictionary deviceName=Google Nexus 5
#${mobile_emulation} Create Dictionary mobileEmulation=${devname}
${chromeoptions}= Evaluate sys.modules['selenium.webdriver.chrome.options'].Options() sys, selenium.webdriver.chrome.options
# ${chromeoptions._experimental_options} Set Variable ${mobile_emulation}
Call Metho