How can I detect which features are supported in the remote environment?

女生的网名这么多〃 提交于 2019-12-25 04:22:23

问题


What's the API to find out "which features and APIs a remote environment supports"? In particular to find out if keyboard actions (like tabbing between form fields) are supported.

Note that http://theintern.github.io/leadfoot/index.html says this is possible:

Enhanced capabilities are also exposed to end-users about which features and APIs a remote environment supports, so you don’t have to browser sniff to decide whether (for example) you’re testing a touch-device or a mouse-device. Optional convenience methods are also available for use, and support for chai-as-promised is built in.

I see http://theintern.github.io/leadfoot/global.html#Capabilities but although it claims they are global variables, I tried if(brokenSendKeys) and it just throws an exception.


回答1:


Session capabilities are available on the remote's environmentType property.

if (this.remote.environmentType.brokenSendKeys) { ... }

The "Globals" section in the Leadfoot docs is just a grouping for definitions that are shared throughout the project.



来源:https://stackoverflow.com/questions/25183787/how-can-i-detect-which-features-are-supported-in-the-remote-environment

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!