问题描述
我正在寻找自动化extjs应用程序,我们都知道selenium不支持extjs应用程序。请你告诉我,如果你面对同样的,并提出一个解决方案。
I am looking to automate extjs application, we all know selenium does not support extjs applications. Kindly suggest me if you have faced the same and come up with a solution for the above.
谢谢,
推荐答案
Sencha提供他们的测试工具,或者您可以使用或您仍然可以使用Selenium,只需编写自己的API函数来点击按钮等 - 可以使用
Sencha offers their testing tool sencha.com/products/test or you could use bryntum.com/products/siesta or you can still use Selenium and just write your own API functions for clicking on buttons and such - it can be done quite easily using Ext.query
我可以分享我们用来测试非常具体的ExtJS的一个API代码我们无法使用Test / Siesta的项目。代码是用Python编写的。
I can share just a piece of our API code we used to test very specific ExtJS project where we could not use Test/Siesta. The code is written in Python.
def ext_component_query_return(self, query, question, target='AppManager'):
script = 'Ext.ComponentQuery.query("{0}")[0]{1}'.format(query, question)
return self.ext_script(script, target=target)
def ext_component_id(self, query, target='AppManager'):
return self.ext_component_query_return(query, '.getId()', target=target)
def ext_component_isVisible(self, query, target='AppManager'):
return self.ext_component_query_return(query, '.isVisible(true)', target=target)
def ext_component_isDisabled(self, query, target='AppManager'):
return self.ext_component_query_return(query, '.isDisabled()', target=target)
这里是例如点击按钮:
s_button_id = self.ext_component_id('#activation-success-card button')
s_button = self.ins.app_manager.find_element_by_id(s_button_id)
s_button.click()
这篇关于是否有任何开源或付费的替代硒来自动化ext js应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!