QAutorobot Configuration and Settings¶
6 Configuration and Settings¶
Here you can find more information about QAutoRobot and project settings with exampe of configuration files (XML)
6.1 Project settings¶
project_settings.xml is used to configure the project settings. In the example below, tables containing over 140 elements or 25 rows are ignored during page model creation. It is possible to edit the file by clicking in Settings -> Project settings or, if UI is prefered, by clicking on the Settings button at the bottom of the Pagemodel tree. The file can be found in project folderconfigproject_config
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | <?xml version="1.0" encoding="utf-8"?>
<settings>
<filters/>
<robot_report value="False"/>
<tc_pagemodel_gen value="True"/>
<tc_use_test_xml value="True"/>
<tc_timeout value="4.0"/>
<slow_down_exec value="0.1"/>
<xpath_type value="xpath-position"/>
<css_deep value="7"/>
<minimize_css value="False"/>
<project_proxy_ff value=""/>
<project_proxy_port value=""/>
<project_proxy_type value="0"/>
<project_proxy_type_protocol value="http"/>
<project_login value=""/>
<automated_methods value="True"/>
<canvas_modeling value="False"/>
<css_pattern pattern="" use="False"/>
<allow_non_unique_css_pattern value="False"/>
<pm_template template_string="" use="False"/>
<testability template_string="" use="False"/>
<table_filters element_count="140" row_count="25" use="True"/>
<big_element_filter height="40" width="55"/>
<contains_in_xpath value="False"/>
<default_area height="0" use="False" width="0" x="0" y="0"/>
<no_filtered_tags>
<tag name="input"/>
<tag name="button"/>
<tag name="frame"/>
<tag name="strong"/>
<tag name="select"/>
</no_filtered_tags>
</settings>
|
6.2 Browser settings¶
QAutorobot browser_config.xml defines browser specific settings and desired capabilities which can be modified by clicking on Settings -> Browser Settings. The file can be found in project folderconfigproject_config
Example of a browser_config.xml file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | <browser_settings>
<default>
<browser name="Chrome">
<add_extension if_case="enable_live_monitoring">GlobalUtils._CHROME_CACHE_CLEANER</add_extension>
<add_experimental_option option="prefs">
{"intl.accept_languages": tue.get_country_key(get_config_value("browser_language"))}
</add_experimental_option>
<add_argument if_case="enable_precise_memory">"--enable-precise-memory-info"</add_argument>
<add_argument>"--start-maximized"</add_argument>
</browser>
<browser name="Firefox">
<set_preference if_case="use_ff_proxy" option="network.proxy.type">int(settings_parser._proxy_type)</set_preference>
<set_preference if_case="use_ff_proxy_type_1" option="network.proxy.http">"localhost"</set_preference>
<set_preference if_case="use_ff_proxy_type_1" option="network.proxy.http_port">3128</set_preference>
<set_preference if_case="use_ff_proxy_type_1" option="network.proxy.ssl">"localhost"</set_preference>
<set_preference if_case="use_ff_proxy_type_1" option="network.proxy.ssl_port">3128</set_preference>
<set_preference if_case="project_proxy_type_http" option="network.proxy.type">
int(settings_parser._project_proxy_type)
</set_preference>
<set_preference if_case="project_proxy_type_http" option="network.proxy.http">
settings_parser._project_proxy_ff
</set_preference>
<set_preference if_case="project_proxy_type_http" option="network.proxy.ssl">
settings_parser._project_proxy_ff
</set_preference>
<set_preference if_case="project_proxy_type_http" option="network.proxy.ssl_port">
int(settings_parser._project_proxy_port)
</set_preference>
<set_preference if_case="project_proxy_type_http" option="network.proxy.http_port">
int(settings_parser._project_proxy_port)
</set_preference>
<set_preference if_case="project_proxy_type_socks" option="network.proxy.type">
int(settings_parser._project_proxy_type)
</set_preference>
<set_preference if_case="project_proxy_type_socks" option="network.proxy.socks">
settings_parser._project_proxy_ff
</set_preference>
<set_preference if_case="project_proxy_type_socks" option="network.proxy.socks_port">
int(settings_parser._project_proxy_port)
</set_preference>
<set_preference if_case="project_proxy_type_socks" option="network.proxy.socks_version">5</set_preference>
<set_preference option="browser.download.folderList">2</set_preference>
<set_preference option="browser.download.manager.alertOnEXEOpen">False</set_preference>
<set_preference option="browser.helperApps.neverAsk.saveToDisk">
"application/msword, application/csv, application/ris, text/csv, image/png, application/pdf, text/html,
text/plain, application/zip, application/x-zip, application/x-zip-compressed, application/download,
application/octet-stream, application/xml"
</set_preference>
<set_preference option="browser.download.manager.showWhenStarting">False</set_preference>
<set_preference option="browser.download.manager.focusWhenStarting">False</set_preference>
<set_preference option="browser.download.useDownloadDir">True</set_preference>
<set_preference option="browser.helperApps.alwaysAsk.force">False</set_preference>
<set_preference option="browser.download.manager.alertOnEXEOpen">False</set_preference>
<set_preference option="browser.download.manager.closeWhenDone">True</set_preference>
<set_preference option="intl.accept_languages">
tue.get_country_key(get_config_value("browser_language"))
</set_preference>
<set_capabilities option="marionette">True</set_capabilities>
<set_capabilities option="acceptInsecureCerts">True</set_capabilities>
</browser>
<browser name="MicrosoftEdge">
<capabilities option="browserName">"MicrosoftEdge"</capabilities>
<capabilities option="version">""</capabilities>
<capabilities option="platform">"WINDOWS"</capabilities>
</browser>
</default>
</browser_settings>
|
Note
When using firefox version >47.0.2, capabilities option=”marionette” should be True. When using firefox version 47.0.2 or under, capabilities option=”marionette” should be False.
6.3 Working with a Git repository¶
QAutorobot projects can be handled as working directories. Page models need to be modelled only once per working directory. New models can be added/updated to the project easily. A common way to handle modifications and new files is to use a version control repository e.g Git.
Here is example of GIT ignore file content in working directory.
.gitignore
1 2 3 4 5 6 7 8 9 | *.py[co]
*.pyc
*.zip
generator*.png
screenshot*.png
*.old
__init__.pyc
test_reports
geckodriver.log
|