从命令行启动Chrome仿真 [英] Start Chrome emulation from command line
问题描述
我使用Google Chrome与Intern进行自动化测试,我想知道是否有方法从CLI以仿真模式启动Chrome或使用特定标志来测试移动渲染。如果没有,你知道一个很好的解决方法吗?我可以直接使用Android模拟器(从Android SDK)与Selenium Webdriver apk或使用手机浏览器,但测试正在崩溃的大多数的时候,模拟器不响应,我不得不重新启动它。另外,我需要在尽可能大的范围内进行测试,不仅限于Android设备。
台式机上的Chrome更加稳定,即使测试失败,Chrome总是响应并可以由Intern自动关闭。
我尝试了一种解决方法--enable-touch-events标志和一个自定义的userAgent,但它会产生奇怪的行为。也许其他一些标志会帮助我?
预先感谢您的回答。
这是我一直想要我自己的功能,所以我已经在下面的链接提交了一个功能请求:
https://代码。 google.com/p/chromium/issues/detail?id=373169&thanks=373169&ts=1400050662
我正在穿越我的手指,但它如果你和其他对此感兴趣的人去了,并且对该线程留下了评论,那也不会有什么伤害。要求的人越多,实施机会就越高。它看起来好像实现起来微不足道,因为它只需要点击几下鼠标即可进入仿真模式。
I use Google Chrome with Intern to run automated tests and I would like to know if there is a way to launch Chrome in emulation mode from CLI or using a specific flag to test mobile rendering. If not, do you know a good workaround ?
I could directly use the Android Emulator (from Android SDK) with Selenium Webdriver apk or with mobile Chrome but tests are crashing most of the time, emulators don't respond and I have to restart it. Also, I need to test on the largest possible scope, not limited to Android devices. Chrome on desktop is a lot more stable and even if a test fails, chrome always respond and can be closed automatically by Intern.
I tried a workaround with the "--enable-touch-events" flag and with a custom userAgent but it's producing weird behaviors. Maybe some other flags would help me ?
Thank you in advance for your answer.
This is currently not possible in Chrome.
It's a feature I've been wanting myself too so I've gone ahead and filed a feature request for it at the following link:
https://code.google.com/p/chromium/issues/detail?id=373169&thanks=373169&ts=1400050662
I'm crossing my fingers but it wouldn't hurt if you and other people interested in this went and left a comment on the thread too. The more people asking for it, the higher the chance of it being implemented. And it does seem like it would be trivial to implement since it currently only takes a couple of mouse clicks to enter emulation mode.
这篇关于从命令行启动Chrome仿真的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!