https://wiki.zimbra.com/api.php?action=feedcontributions&user=Matthew+Rhoades&feedformat=atomZimbra :: Tech Center - User contributions [en]2024-03-28T12:32:25ZUser contributionsMediaWiki 1.39.0https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_CodeCoverage&diff=24727Testing: Selenium: ZimbraSelenium CodeCoverage2011-05-26T18:41:01Z<p>Matthew Rhoades: </p>
<hr />
<div>==General Information==<br />
<br />
The '''Zimbra Selenium Harness''' contains code to measure [http://en.wikipedia.org/wiki/Code_coverage code coverage] using [http://siliconforks.com/jscoverage/ JSCoverage].<br />
<br />
Code coverage statistics are gathered for the javascript clients:<br />
<br />
* ajax client<br />
* the admin console.<br />
<br />
<br />
==JSCoverage==<br />
<br />
===JSCoverage install===<br />
<br />
Code Coverage depends on having jscoverage installed on the server in /usr/local/bin/jscoverage, which corresponds to the coverage.tool property in ZimbraSelenium/conf/config.properties.<br />
<br />
Don't use the apt-get install jscoverage, that doesn't seem to work correctly. Instead, get the source zip and compile. Then, copy/link /usr/local/bin/jscoverage to the built files.<br />
<br />
===JSCoverage instrumentation===<br />
<br />
To manually instrument the server, the command is (as root):<br />
<br />
/usr/local/bin/jscoverage --no-instrument=help/ /opt/zimbra/jetty/webapps/zimbra /opt/zimbra/jetty/webapps/instrumented<br />
<br />
<br />
==Design==<br />
<br />
The harness uses jscoverage-server mode, where jscoverage.html is not required. Therefore, the code coverage does not require the zimbra application to run inside a containing window. See [http://siliconforks.com/jscoverage/manual.html JSCoverage documentation] for more details.<br />
<br />
[http://staf.sourceforge.net/ STAF] must be enabled with level 5 permissions on both the client and server for coverage to be activated. STAF is used to remotely execute instrumentation commands.<br />
<br />
===Configuration===<br />
<br />
The harness config.properties file has several settings that affect coverage reporting.<br />
<br />
coverage.enabled=false<br />
coverage.tool=/usr/local/bin/jscoverage<br />
coverage.reportsource=false<br />
coverage.query=dev=1&debug=0<br />
coverage.maxpageload.msec=90000<br />
coverage.instrument=true<br />
<br />
* '''coverage.enabled''': Set to "true" or "false" to enable or disable, respectively, coverage reporting<br />
* '''coverage.tool''': Set to the path of jscoverage tool on the server<br />
* '''coverage.reportsource''': Set to "true" or "false" to enable or disable, respectively, source code line counts in the coverage report. Enabling this option greatly increases harness memory usage, since all the source code is loaded into memory.<br />
* '''coverage.query''': the URL query options to instruct the application to not zip the JS files. (JScoverage requires the source code to be in JS format. The tool will not work with zip format files.)<br />
* '''coverage.maxpageload.msec''': The Zimbra application takes much longer to load when running in code coverage mode. This timeout setting will override the default harness page load timeout, so that the harness will not report failures when the application takes too long to load.<br />
* '''coverage.instrument''': Set to "true" or "false" to enable or disable, respectively, server instrumentation at the beginning and end of the tests<br />
<br />
The configuration settings can be used to control the behavior of the code coverage mechanism. For instance, when developing new scripts with code coverage enabled, you may choose to manually instrument the code, rather than the harness instrumenting the code at run-time (which takes an additional 2-3 minutes). In this case, you would likely choose these settings<br />
<br />
coverage.enabled=true # Enable coverage<br />
coverage.instrument=false # The harness should not instrument, since it was manually done<br />
<br />
===Coverage reporting===<br />
<br />
[[Image:ZimbraSeleniumCoverageSample.jpeg|thumb|right|400px|Sample Report]]<br />
<br />
After executing the harness, the output will be written to ZimbraSelenium/test-output/.../coverage/jscoverage.html<br />
<br />
There are multiple files in the coverage folder, however, jscoverage.html is the main html page and jscoverage.json is the JSON file which contains the coverage metrics. See [http://siliconforks.com/jscoverage/manual.html JSCoverage documentation] for more details.<br />
<br />
TIP: The report uses quite a lot of memory and processing when loaded. The [http://www.google.com/chrome/ Chrome browser] seems to work best when viewing the report.<br />
<br />
<br />
===Logging===<br />
<br />
Using default settings, code coverage is logged to the log4j object (log4j.logger.com.zimbra.qa.selenium.framework.utils.CodeCoverage). Per default conf/log4j.properties settings, you can find the output in the test-output/.../debug.txt file. Here are some examples:<br />
<br />
Startup instrumentation:<br />
<br />
20938 INFO com.zimbra.qa.selenium.framework.util.CodeCoverage - instrumentServer()<br />
20938 INFO com.zimbra.qa.selenium.framework.util.CodeCoverage - instrumentServerCheck()<br />
<br />
Point calculation of code coverage after each test case:<br />
<br />
140909 INFO com.zimbra.qa.selenium.framework.util.CodeCoverage - calculateCoverage()<br />
142034 INFO com.zimbra.qa.selenium.framework.util.CodeCoverage - CodeCoverage: files(568) lines(33201) duplicates(0)<br />
142034 INFO com.zimbra.qa.selenium.framework.core.ExecuteHarnessMain$MethodListener - MethodListener: FINISH: com.zimbra.qa.selenium.projects.ajax.tests.addressbook.contactgroups.ContextMenuContactGroup.NewEmail<br />
...<br />
144691 INFO com.zimbra.qa.selenium.framework.util.CodeCoverage - calculateCoverage()<br />
145784 INFO com.zimbra.qa.selenium.framework.util.CodeCoverage - CodeCoverage: files(0) lines(69) duplicates(302)<br />
146206 INFO com.zimbra.qa.selenium.framework.core.ExecuteHarnessMain$MethodListener - MethodListener: FINISH: com.zimbra.qa.selenium.projects.ajax.tests.addressbook.contactgroups.ContextMenuContactGroup.ShowContextMenu<br />
...<br />
185019 INFO com.zimbra.qa.selenium.framework.util.CodeCoverage - calculateCoverage()<br />
186003 INFO com.zimbra.qa.selenium.framework.util.CodeCoverage - CodeCoverage: files(0) lines(149) duplicates(73)<br />
186409 INFO com.zimbra.qa.selenium.framework.core.ExecuteHarnessMain$MethodListener - MethodListener: FINISH: com.zimbra.qa.selenium.projects.ajax.tests.addressbook.contactgroups.CreateContactGroup.CreateContactGroup_01<br />
...<br />
<br />
'''files''' is the number of new files that were analyzed. '''lines''' is the number of new lines that were exercised. '''duplicates''' is the number of lines that were exercised that were already previously exercised.<br />
<br />
Shutdown un-instrumentation:<br />
<br />
8439284 INFO com.zimbra.qa.selenium.framework.util.CodeCoverage - instrumentServerUndo()<br />
<br />
Writing the coverage report webpage files:<br />
<br />
8466097 INFO com.zimbra.qa.selenium.framework.util.CodeCoverage - writeCoverage()<br />
8477409 INFO com.zimbra.qa.selenium.framework.util.CodeCoverage - CodeCoverage: took an additional 191 seconds of processing time<br />
<br />
The '''additional X seconds of processing time''' refers to the amount of time used to instrument the server, calculate coverage, uninstrument the server, and write the report files. It does not include slowness due to loading instrumented files in the browser (i.e. page load slowness).<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>Matthew Rhoadeshttps://wiki.zimbra.com/index.php?title=File:ZimbraSeleniumCoverageSample.jpeg&diff=24726File:ZimbraSeleniumCoverageSample.jpeg2011-05-26T18:21:19Z<p>Matthew Rhoades: Sample Selenium Code Coverage report for Ajax Client</p>
<hr />
<div>Sample Selenium Code Coverage report for Ajax Client</div>Matthew Rhoadeshttps://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_CodeCoverage&diff=24725Testing: Selenium: ZimbraSelenium CodeCoverage2011-05-26T18:19:37Z<p>Matthew Rhoades: </p>
<hr />
<div>==General Information==<br />
<br />
The '''Zimbra Selenium Harness''' contains code to measure [http://en.wikipedia.org/wiki/Code_coverage code coverage] using [http://siliconforks.com/jscoverage/ JSCoverage].<br />
<br />
Code coverage statistics are gathered for the javascript clients:<br />
<br />
* ajax client<br />
* the admin console.<br />
<br />
<br />
==JSCoverage==<br />
<br />
===JSCoverage install===<br />
<br />
Code Coverage depends on having jscoverage installed on the server in /usr/local/bin/jscoverage, which corresponds to the coverage.tool property in ZimbraSelenium/conf/config.properties.<br />
<br />
Don't use the apt-get install jscoverage, that doesn't seem to work correctly. Instead, get the source zip and compile. Then, copy/link /usr/local/bin/jscoverage to the built files.<br />
<br />
===JSCoverage instrumentation===<br />
<br />
To manually instrument the server, the command is (as root):<br />
<br />
/usr/local/bin/jscoverage --no-instrument=help/ /opt/zimbra/jetty/webapps/zimbra /opt/zimbra/jetty/webapps/instrumented<br />
<br />
<br />
==Design==<br />
<br />
The harness uses jscoverage-server mode, where jscoverage.html is not required. Therefore, the code coverage does not require the zimbra application to run inside a containing window. See [http://siliconforks.com/jscoverage/manual.html JSCoverage documentation] for more details.<br />
<br />
[http://staf.sourceforge.net/ STAF] must be enabled with level 5 permissions on both the client and server for coverage to be activated. STAF is used to remotely execute instrumentation commands.<br />
<br />
===Configuration===<br />
<br />
The harness config.properties file has several settings that affect coverage reporting.<br />
<br />
coverage.enabled=false<br />
coverage.tool=/usr/local/bin/jscoverage<br />
coverage.reportsource=false<br />
coverage.query=dev=1&debug=0<br />
coverage.maxpageload.msec=90000<br />
coverage.instrument=true<br />
<br />
* '''coverage.enabled''': Set to "true" or "false" to enable or disable, respectively, coverage reporting<br />
* '''coverage.tool''': Set to the path of jscoverage tool on the server<br />
* '''coverage.reportsource''': Set to "true" or "false" to enable or disable, respectively, source code line counts in the coverage report. Enabling this option greatly increases harness memory usage, since all the source code is loaded into memory.<br />
* '''coverage.query''': the URL query options to instruct the application to not zip the JS files. (JScoverage requires the source code to be in JS format. The tool will not work with zip format files.)<br />
* '''coverage.maxpageload.msec''': The Zimbra application takes much longer to load when running in code coverage mode. This timeout setting will override the default harness page load timeout, so that the harness will not report failures when the application takes too long to load.<br />
* '''coverage.instrument''': Set to "true" or "false" to enable or disable, respectively, server instrumentation at the beginning and end of the tests<br />
<br />
The configuration settings can be used to control the behavior of the code coverage mechanism. For instance, when developing new scripts with code coverage enabled, you may choose to manually instrument the code, rather than the harness instrumenting the code at run-time (which takes an additional 2-3 minutes). In this case, you would likely choose these settings<br />
<br />
coverage.enabled=true # Enable coverage<br />
coverage.instrument=false # The harness should not instrument, since it was manually done<br />
<br />
===Coverage reporting===<br />
<br />
After executing the harness, the output will be written to ZimbraSelenium/test-output/.../coverage/jscoverage.html<br />
<br />
There are multiple files in the coverage folder, however, jscoverage.html is the main html page and jscoverage.json is the JSON file which contains the coverage metrics. See [http://siliconforks.com/jscoverage/manual.html JSCoverage documentation] for more details.<br />
<br />
TIP: The report uses quite a lot of memory and processing when loaded. The [http://www.google.com/chrome/ Chrome browser] seems to work best when viewing the report.<br />
<br />
Here is an example report:<br />
<br />
[[Image:ZimbraSeleniumCoverageSample.jpeg|thumb|right|200px|Selenium Structure]]<br />
<br />
<br />
===Logging===<br />
<br />
<br />
<br />
<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>Matthew Rhoadeshttps://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_CodeCoverage&diff=24724Testing: Selenium: ZimbraSelenium CodeCoverage2011-05-26T18:01:17Z<p>Matthew Rhoades: Created page with '==General Information== The '''Zimbra Selenium Harness''' contains code to measure [http://en.wikipedia.org/wiki/Code_coverage code coverage] using [http://siliconforks.com/jsco…'</p>
<hr />
<div>==General Information==<br />
<br />
The '''Zimbra Selenium Harness''' contains code to measure [http://en.wikipedia.org/wiki/Code_coverage code coverage] using [http://siliconforks.com/jscoverage/ JSCoverage].<br />
<br />
Code coverage statistics are gathered for the javascript clients, the ajax client and the admin console.<br />
<br />
==Design==<br />
<br />
The harness uses jscoverage-server mode, where jscoverage.html is not required. Therefore, the code coverage does not require the zimbra application to run inside a containing window. See [http://siliconforks.com/jscoverage/manual.html JSCoverage documentation] for more details.<br />
<br />
==JSCoverage==<br />
<br />
===JSCoverage install===<br />
<br />
Code Coverage depends on having jscoverage installed on the server in /usr/local/bin/jscoverage, which corresponds to the coverage.tool property in ZimbraSelenium/conf/config.properties.<br />
<br />
Don't use the apt-get install jscoverage, that doesn't seem to work correctly. Instead, get the source zip and compile. Then, copy/link /usr/local/bin/jscoverage to the built files.<br />
<br />
===JSCoverage instrumentation===<br />
<br />
To manually instrument the server, the command is (as root):<br />
<br />
/usr/local/bin/jscoverage --no-instrument=help/ /opt/zimbra/jetty/webapps/zimbra /opt/zimbra/jetty/webapps/instrumented<br />
<br />
==Design==<br />
<br />
===Configuration===<br />
<br />
===Logging===<br />
<br />
===Coverage reporting===<br />
<br />
After executing the harness, the output will be written to ZimbraSelenium/test-output/.../coverage/jscoverage.html<br />
<br />
<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>Matthew Rhoadeshttps://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Tips&diff=24601Testing: Selenium: ZimbraSelenium Tips2011-05-04T23:48:52Z<p>Matthew Rhoades: /* Translation: xpath to css */</p>
<hr />
<div>==General Information==<br />
<br />
This page details some helpful tips regarding usage of the Zimbra Selenium Harness<br />
<br />
==Code==<br />
<br />
===Selenium===<br />
<br />
====Preferred Locator Formats====<br />
<br />
Using the most optimal locators is crucial for cross-browser compatibility. IE is notoriously slow for processing xpath locators. As per the [http://release.seleniumhq.org/selenium-remote-control/0.9.2/doc/dotnet/Selenium.html Selenium documentation], the preferred format of locators is:<br />
<br />
# by CSS (i.e. locator="css=a[href='#id3']")<br />
# by xpath (i.e. locator="//a(@href='@id3']")<br />
# by Identifier (i.e. locator="DWT233")<br />
<br />
=====Translation: xpath to css=====<br />
<br />
For those familiar with xpath but not css, here are some tips for translation.<br />
<br />
{| class="wikitable" style="width: 80%; text-align: center; border: 1px solid blue;" border="1"<br />
|-<br />
! xpath<br />
! css<br />
! preferred<br />
! description<br />
|-<br />
| "xpath=//div[@id='foo']" || "css=div#foo" || "css=div#foo" || div with id equals "foo" <br />
|-<br />
| "xpath=//tr[contains(@attr,'partial']" || "css=tr[attr*='foo']" || "css=tr[attr*='foo']" || attr contains foo<br />
|-<br />
| - || "css=tr[attr^='foo']" || "css=tr[attr^='foo']" || attribute starts with foo<br />
|-<br />
| - || "css=tr[attr$='foo']" || "css=tr[attr$='foo']" || attribute ends with foo<br />
|-<br />
| xpath=(//div[@id='foo'])@class || "css=div[id='foo']@class" || sGetAttribute("css=div[id='foo']@class") || CSS format for sGetAttribute()<br />
|-<br />
| xpath=//div//table || "css=div table" || "css=div table" || descendant<br />
|-<br />
| xpath=//div/table || "css=div>table" || "css=div>table" || child<br />
|}<br />
<br />
==Links==<br />
<br />
See http://saucelabs.com/blog/index.php/2010/01/selenium-totw-css-selectors-in-selenium-demystified/<br />
<br />
See http://saucelabs.com/blog/index.php/2010/03/selenium-tips-finding-elements-by-their-inner-text-using-contains-a-css-pseudo-class/<br />
<br />
See http://www.ivaturi.org/home/hackingseleniumtoimproveitsperformanceonie<br />
<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>Matthew Rhoadeshttps://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Tips&diff=24600Testing: Selenium: ZimbraSelenium Tips2011-05-04T23:48:13Z<p>Matthew Rhoades: /* Links */</p>
<hr />
<div>==General Information==<br />
<br />
This page details some helpful tips regarding usage of the Zimbra Selenium Harness<br />
<br />
==Code==<br />
<br />
===Selenium===<br />
<br />
====Preferred Locator Formats====<br />
<br />
Using the most optimal locators is crucial for cross-browser compatibility. IE is notoriously slow for processing xpath locators. As per the [http://release.seleniumhq.org/selenium-remote-control/0.9.2/doc/dotnet/Selenium.html Selenium documentation], the preferred format of locators is:<br />
<br />
# by CSS (i.e. locator="css=a[href='#id3']")<br />
# by xpath (i.e. locator="//a(@href='@id3']")<br />
# by Identifier (i.e. locator="DWT233")<br />
<br />
=====Translation: xpath to css=====<br />
<br />
For those familiar with xpath but not css, here are some tips for translation.<br />
<br />
{| class="wikitable" style="width: 80%; text-align: center; border: 1px solid blue;" border="1"<br />
|-<br />
! xpath<br />
! css<br />
! preferred<br />
! description<br />
|-<br />
| "xpath=//div[@id='foo']" || "css=div[id='foo']" || "foo" || element with id equals "foo" <br />
|-<br />
| "xpath=//tr[contains(@attr,'partial']" || "css=tr[attr*='foo']" || "css=tr[attr*='foo']" || attr contains foo<br />
|-<br />
| - || "css=tr[attr^='foo']" || "css=tr[attr^='foo']" || attribute starts with foo<br />
|-<br />
| - || "css=tr[attr$='foo']" || "css=tr[attr$='foo']" || attribute ends with foo<br />
|-<br />
| xpath=(//div[@id='foo'])@class || "css=div[id='foo']@class" || sGetAttribute("css=div[id='foo']@class") || CSS format for sGetAttribute()<br />
|-<br />
| xpath=//div//table || "css=div table" || "css=div table" || descendant<br />
|-<br />
| xpath=//div/table || "css=div>table" || "css=div>table" || child<br />
|}<br />
<br />
<br />
==Links==<br />
<br />
See http://saucelabs.com/blog/index.php/2010/01/selenium-totw-css-selectors-in-selenium-demystified/<br />
<br />
See http://saucelabs.com/blog/index.php/2010/03/selenium-tips-finding-elements-by-their-inner-text-using-contains-a-css-pseudo-class/<br />
<br />
See http://www.ivaturi.org/home/hackingseleniumtoimproveitsperformanceonie<br />
<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>Matthew Rhoadeshttps://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Tips&diff=24599Testing: Selenium: ZimbraSelenium Tips2011-05-04T23:41:10Z<p>Matthew Rhoades: </p>
<hr />
<div>==General Information==<br />
<br />
This page details some helpful tips regarding usage of the Zimbra Selenium Harness<br />
<br />
==Code==<br />
<br />
===Selenium===<br />
<br />
====Preferred Locator Formats====<br />
<br />
Using the most optimal locators is crucial for cross-browser compatibility. IE is notoriously slow for processing xpath locators. As per the [http://release.seleniumhq.org/selenium-remote-control/0.9.2/doc/dotnet/Selenium.html Selenium documentation], the preferred format of locators is:<br />
<br />
# by CSS (i.e. locator="css=a[href='#id3']")<br />
# by xpath (i.e. locator="//a(@href='@id3']")<br />
# by Identifier (i.e. locator="DWT233")<br />
<br />
=====Translation: xpath to css=====<br />
<br />
For those familiar with xpath but not css, here are some tips for translation.<br />
<br />
{| class="wikitable" style="width: 80%; text-align: center; border: 1px solid blue;" border="1"<br />
|-<br />
! xpath<br />
! css<br />
! preferred<br />
! description<br />
|-<br />
| "xpath=//div[@id='foo']" || "css=div[id='foo']" || "foo" || element with id equals "foo" <br />
|-<br />
| "xpath=//tr[contains(@attr,'partial']" || "css=tr[attr*='foo']" || "css=tr[attr*='foo']" || attr contains foo<br />
|-<br />
| - || "css=tr[attr^='foo']" || "css=tr[attr^='foo']" || attribute starts with foo<br />
|-<br />
| - || "css=tr[attr$='foo']" || "css=tr[attr$='foo']" || attribute ends with foo<br />
|-<br />
| xpath=(//div[@id='foo'])@class || "css=div[id='foo']@class" || sGetAttribute("css=div[id='foo']@class") || CSS format for sGetAttribute()<br />
|-<br />
| xpath=//div//table || "css=div table" || "css=div table" || descendant<br />
|-<br />
| xpath=//div/table || "css=div>table" || "css=div>table" || child<br />
|}<br />
<br />
<br />
==Links==<br />
<br />
See http://saucelabs.com/blog/index.php/2010/01/selenium-totw-css-selectors-in-selenium-demystified/<br />
<br />
See http://saucelabs.com/blog/index.php/2010/03/selenium-tips-finding-elements-by-their-inner-text-using-contains-a-css-pseudo-class/<br />
<br />
<br />
<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>Matthew Rhoadeshttps://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Tips&diff=24598Testing: Selenium: ZimbraSelenium Tips2011-05-04T23:40:45Z<p>Matthew Rhoades: /* Preferred Locator Formats */</p>
<hr />
<div>==General Information==<br />
<br />
This page details some helpful tips regarding usage of the Zimbra Selenium Harness<br />
<br />
==Code==<br />
<br />
===Selenium===<br />
<br />
====Preferred Locator Formats====<br />
<br />
Using the most optimal locators is crucial for cross-browser compatibility. IE is notoriously slow for processing xpath locators. As per the [http://release.seleniumhq.org/selenium-remote-control/0.9.2/doc/dotnet/Selenium.html Selenium documentation], the preferred format of locators is:<br />
<br />
# by CSS (i.e. locator="css=a[href='#id3']")<br />
# by xpath (i.e. locator="//a(@href='@id3']")<br />
# by Identifier (i.e. locator="DWT233")<br />
<br />
=====Translation: xpath to css=====<br />
<br />
For those familiar with xpath but not css, here are some tips for translation.<br />
<br />
{| class="wikitable" style="width: 80%; text-align: center; border: 1px solid blue;" border="1"<br />
|-<br />
! xpath<br />
! css<br />
! preferred<br />
! description<br />
|-<br />
| "xpath=//div[@id='foo']" || "css=div[id='foo']" || "foo" || element with id equals "foo" <br />
|-<br />
| "xpath=//tr[contains(@attr,'partial']" || "css=tr[attr*='foo']" || "css=tr[attr*='foo']" || attr contains foo<br />
|-<br />
| - || "css=tr[attr^='foo']" || "css=tr[attr^='foo']" || attribute starts with foo<br />
|-<br />
| - || "css=tr[attr$='foo']" || "css=tr[attr$='foo']" || attribute ends with foo<br />
|-<br />
| xpath=(//div[@id='foo'])@class || "css=div[id='foo']@class" || sGetAttribute("css=div[id='foo']@class") || CSS format for sGetAttribute()<br />
|-<br />
| xpath=//div//table || "css=div table" || "css=div table" || descendant<br />
|-<br />
| xpath=//div/table || "css=div>table" || "css=div>table" || child<br />
|}<br />
<br />
<br />
<br />
See http://saucelabs.com/blog/index.php/2010/01/selenium-totw-css-selectors-in-selenium-demystified/<br />
<br />
See http://saucelabs.com/blog/index.php/2010/03/selenium-tips-finding-elements-by-their-inner-text-using-contains-a-css-pseudo-class/<br />
<br />
<br />
<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>Matthew Rhoadeshttps://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Tips&diff=24597Testing: Selenium: ZimbraSelenium Tips2011-05-04T22:52:18Z<p>Matthew Rhoades: /* Translation: xpath to css */</p>
<hr />
<div>==General Information==<br />
<br />
This page details some helpful tips regarding usage of the Zimbra Selenium Harness<br />
<br />
==Code==<br />
<br />
===Selenium===<br />
<br />
====Preferred Locator Formats====<br />
<br />
Using the most optimal locators is crucial for cross-browser compatibility. IE is notoriously slow for processing xpath locators. As per the [http://release.seleniumhq.org/selenium-remote-control/0.9.2/doc/dotnet/Selenium.html Selenium documentation], the preferred format of locators is:<br />
<br />
# by Identifier (i.e. locator="DWT233")<br />
# by CSS (i.e. locator="css=a[href='#id3']")<br />
# by xpath (i.e. locator="//a(@href='@id3']")<br />
<br />
=====Translation: xpath to css=====<br />
<br />
For those familiar with xpath but not css, here are some tips for translation.<br />
<br />
{| class="wikitable" style="width: 80%; text-align: center; border: 1px solid blue;" border="1"<br />
|-<br />
! xpath<br />
! css<br />
! preferred<br />
! description<br />
|-<br />
| "xpath=//div[@id='foo']" || "css=div[id='foo']" || "foo" || element with id equals "foo" <br />
|-<br />
| "xpath=//tr[contains(@attr,'partial']" || "css=tr[attr*='foo']" || "css=tr[attr*='foo']" || attr contains foo<br />
|-<br />
| - || "css=tr[attr^='foo']" || "css=tr[attr^='foo']" || attribute starts with foo<br />
|-<br />
| - || "css=tr[attr$='foo']" || "css=tr[attr$='foo']" || attribute ends with foo<br />
|-<br />
| xpath=(//div[@id='foo'])@class || "css=div[id='foo']@class" || sGetAttribute("css=div[id='foo']@class") || CSS format for sGetAttribute()<br />
|-<br />
| xpath=//div//table || "css=div table" || "css=div table" || descendant<br />
|-<br />
| xpath=//div/table || "css=div>table" || "css=div>table" || child<br />
|}<br />
<br />
<br />
<br />
See http://saucelabs.com/blog/index.php/2010/01/selenium-totw-css-selectors-in-selenium-demystified/<br />
<br />
See http://saucelabs.com/blog/index.php/2010/03/selenium-tips-finding-elements-by-their-inner-text-using-contains-a-css-pseudo-class/<br />
<br />
<br />
<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>Matthew Rhoadeshttps://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Tips&diff=24596Testing: Selenium: ZimbraSelenium Tips2011-05-04T21:59:07Z<p>Matthew Rhoades: /* Translation: xpath to css */</p>
<hr />
<div>==General Information==<br />
<br />
This page details some helpful tips regarding usage of the Zimbra Selenium Harness<br />
<br />
==Code==<br />
<br />
===Selenium===<br />
<br />
====Preferred Locator Formats====<br />
<br />
Using the most optimal locators is crucial for cross-browser compatibility. IE is notoriously slow for processing xpath locators. As per the [http://release.seleniumhq.org/selenium-remote-control/0.9.2/doc/dotnet/Selenium.html Selenium documentation], the preferred format of locators is:<br />
<br />
# by Identifier (i.e. locator="DWT233")<br />
# by CSS (i.e. locator="css=a[href='#id3']")<br />
# by xpath (i.e. locator="//a(@href='@id3']")<br />
<br />
=====Translation: xpath to css=====<br />
<br />
For those familiar with xpath but not css, here are some tips for translation.<br />
<br />
{| class="wikitable" style="width: 80%; text-align: center; border: 1px solid blue;" border="1"<br />
|-<br />
! xpath<br />
! css<br />
! preferred<br />
! description<br />
|-<br />
| "xpath=//div[@id='foo']" || "css=div[id='foo']" || "foo" || element with id equals "foo" <br />
|-<br />
| "xpath=//tr[contains(@attr,'partial']" || "css=tr[attr*='foo']" || "css=tr[attr*='foo']" || attr contains foo<br />
|-<br />
| - || "css=tr[attr^='foo']" || "css=tr[attr^='foo']" || attribute starts with foo<br />
|-<br />
| - || "css=tr[attr$='foo']" || "css=tr[attr$='foo']" || attribute ends with foo<br />
|-<br />
| xpath=(//div[@id='foo'])@class || "css=div[id='foo']@class" || sGetAttribute("css=div[id='foo']@class") || CSS format for sGetAttribute()<br />
|}<br />
<br />
<br />
<br />
See http://saucelabs.com/blog/index.php/2010/01/selenium-totw-css-selectors-in-selenium-demystified/<br />
<br />
See http://saucelabs.com/blog/index.php/2010/03/selenium-tips-finding-elements-by-their-inner-text-using-contains-a-css-pseudo-class/<br />
<br />
<br />
<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>Matthew Rhoadeshttps://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Tips&diff=24595Testing: Selenium: ZimbraSelenium Tips2011-05-04T21:54:16Z<p>Matthew Rhoades: /* Translation: xpath to css */</p>
<hr />
<div>==General Information==<br />
<br />
This page details some helpful tips regarding usage of the Zimbra Selenium Harness<br />
<br />
==Code==<br />
<br />
===Selenium===<br />
<br />
====Preferred Locator Formats====<br />
<br />
Using the most optimal locators is crucial for cross-browser compatibility. IE is notoriously slow for processing xpath locators. As per the [http://release.seleniumhq.org/selenium-remote-control/0.9.2/doc/dotnet/Selenium.html Selenium documentation], the preferred format of locators is:<br />
<br />
# by Identifier (i.e. locator="DWT233")<br />
# by CSS (i.e. locator="css=a[href='#id3']")<br />
# by xpath (i.e. locator="//a(@href='@id3']")<br />
<br />
=====Translation: xpath to css=====<br />
<br />
For those familiar with xpath but not css, here are some tips for translation.<br />
<br />
{| class="wikitable" style="width: 80%; text-align: center; border: 1px solid blue;" border="1"<br />
|-<br />
! xpath<br />
! css<br />
! preferred<br />
! description<br />
|-<br />
| "xpath=//div[@id='foo']" || "css=div[id='foo']" || "foo" || element with id equals "foo" <br />
|-<br />
| "xpath=//tr[contains(@attr,'partial']" || "css=tr[attr*='foo']" || "css=tr[attr*='foo']" || attr contains foo<br />
|-<br />
| - || "css=tr[attr^='foo']" || "css=tr[attr^='foo']" || attribute starts with foo<br />
|-<br />
| - || "css=tr[attr$='foo']" || "css=tr[attr$='foo']" || attribute ends with foo<br />
|}<br />
<br />
<br />
<br />
See http://saucelabs.com/blog/index.php/2010/01/selenium-totw-css-selectors-in-selenium-demystified/<br />
<br />
See http://saucelabs.com/blog/index.php/2010/03/selenium-tips-finding-elements-by-their-inner-text-using-contains-a-css-pseudo-class/<br />
<br />
<br />
<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>Matthew Rhoadeshttps://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Tips&diff=24594Testing: Selenium: ZimbraSelenium Tips2011-05-04T21:49:36Z<p>Matthew Rhoades: /* Translation: xpath to css */</p>
<hr />
<div>==General Information==<br />
<br />
This page details some helpful tips regarding usage of the Zimbra Selenium Harness<br />
<br />
==Code==<br />
<br />
===Selenium===<br />
<br />
====Preferred Locator Formats====<br />
<br />
Using the most optimal locators is crucial for cross-browser compatibility. IE is notoriously slow for processing xpath locators. As per the [http://release.seleniumhq.org/selenium-remote-control/0.9.2/doc/dotnet/Selenium.html Selenium documentation], the preferred format of locators is:<br />
<br />
# by Identifier (i.e. locator="DWT233")<br />
# by CSS (i.e. locator="css=a[href='#id3']")<br />
# by xpath (i.e. locator="//a(@href='@id3']")<br />
<br />
=====Translation: xpath to css=====<br />
<br />
For those familiar with xpath but not css, here are some tips for translation.<br />
<br />
{| class="wikitable" style="width: 80%; text-align: center; border: 1px solid blue;" border="1"<br />
|-<br />
! xpath<br />
! css<br />
! preferred<br />
! usage<br />
|-<br />
| "xpath=//div[@id='foo']" || "css=div[id='foo']" || "foo" || sIsElementPresent("foo") <br />
|-<br />
| "xpath=//tr[contains(@attr,'partial']" || "css=tr[attr*='foo']" || "css=tr[attr*='foo']" || sIsElementPresent("css=tr[attr*='foo']")<br />
|}<br />
<br />
<br />
<br />
See http://saucelabs.com/blog/index.php/2010/01/selenium-totw-css-selectors-in-selenium-demystified/<br />
<br />
See http://saucelabs.com/blog/index.php/2010/03/selenium-tips-finding-elements-by-their-inner-text-using-contains-a-css-pseudo-class/<br />
<br />
<br />
<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>Matthew Rhoadeshttps://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Tips&diff=24593Testing: Selenium: ZimbraSelenium Tips2011-05-04T21:48:28Z<p>Matthew Rhoades: </p>
<hr />
<div>==General Information==<br />
<br />
This page details some helpful tips regarding usage of the Zimbra Selenium Harness<br />
<br />
==Code==<br />
<br />
===Selenium===<br />
<br />
====Preferred Locator Formats====<br />
<br />
Using the most optimal locators is crucial for cross-browser compatibility. IE is notoriously slow for processing xpath locators. As per the [http://release.seleniumhq.org/selenium-remote-control/0.9.2/doc/dotnet/Selenium.html Selenium documentation], the preferred format of locators is:<br />
<br />
# by Identifier (i.e. locator="DWT233")<br />
# by CSS (i.e. locator="css=a[href='#id3']")<br />
# by xpath (i.e. locator="//a(@href='@id3']")<br />
<br />
=====Translation: xpath to css=====<br />
<br />
{| class="wikitable" style="width: 80%; text-align: center; border: 1px solid blue;" border="1"<br />
|-<br />
! xpath<br />
! css<br />
! preferred<br />
! usage<br />
|-<br />
| "xpath=//div[@id='foo']" || "css=div[id='foo']" || "foo" || sIsElementPresent("foo") <br />
|-<br />
| "xpath=//tr[contains(@attr,'partial']" || "css=tr[attr*='foo']" || "css=tr[attr*='foo']" || sIsElementPresent("css=tr[attr*='foo']")<br />
|}<br />
<br />
<br />
<br />
See http://saucelabs.com/blog/index.php/2010/01/selenium-totw-css-selectors-in-selenium-demystified/<br />
<br />
See http://saucelabs.com/blog/index.php/2010/03/selenium-tips-finding-elements-by-their-inner-text-using-contains-a-css-pseudo-class/<br />
<br />
<br />
<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>Matthew Rhoadeshttps://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Tips&diff=24592Testing: Selenium: ZimbraSelenium Tips2011-05-04T21:24:04Z<p>Matthew Rhoades: Created page with '==General Information== This page details some helpful tips regarding usage of the Zimbra Selenium Harness ==Code== ===Selenium=== ====Locators==== Using the most optimal lo…'</p>
<hr />
<div>==General Information==<br />
<br />
This page details some helpful tips regarding usage of the Zimbra Selenium Harness<br />
<br />
==Code==<br />
<br />
===Selenium===<br />
<br />
====Locators====<br />
<br />
Using the most optimal locators is crucial for cross-browser compatibility. IE is notoriously slow for processing xpath locators. As per the [http://release.seleniumhq.org/selenium-remote-control/0.9.2/doc/dotnet/Selenium.html Selenium documentation], the preferred format of locators is:<br />
<br />
# by Identifier (i.e. locator="DWT233")<br />
# by CSS (i.e. locator="css=a[href='#id3']")<br />
# by xpath (i.e. locator="//a(@href='@id3']")<br />
<br />
=====xpath to css translation=====<br />
<br />
{| class="wikitable" style="width: 80%; text-align: center; border: 1px solid blue;"<br />
|-<br />
! xpath<br />
! css<br />
! preferred<br />
! usage<br />
|-<br />
| "xpath=//div[@id='foo']" || "css=div[id='foo']" || "foo" || sIsElementPresent("foo") <br />
|-<br />
| "xpath=//div[@id='foo']" || "css=div[id='foo']" || "foo" || sIsElementPresent("foo") <br />
|}<br />
<br />
<br />
<br />
See http://saucelabs.com/blog/index.php/2010/01/selenium-totw-css-selectors-in-selenium-demystified/<br />
<br />
See http://saucelabs.com/blog/index.php/2010/03/selenium-tips-finding-elements-by-their-inner-text-using-contains-a-css-pseudo-class/<br />
<br />
<br />
<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>Matthew Rhoadeshttps://wiki.zimbra.com/index.php?title=GAL_Sync_Account&diff=16594GAL Sync Account2009-12-22T00:08:45Z<p>Matthew Rhoades: </p>
<hr />
<div>=Description=<br />
Enabling a GAL sync account will permit browsing and paging of the global address list when selecting contacts during message composition with the Zimbra web client. Contact data from Zimbra's internal GAL and external sources can be synced to the account. The galsync account is a resource account and does not consume a Zimbra license.<br />
<br />
To setup an account properly for sync, there must be <br />
*A GAL sync account<br />
*An internal or external datasource on the GAL sync account.<br />
<br />
=Setting Up Internal GAL Sync=<br />
For the internal setup, the internal datasource is automatically created when using the following steps.<br />
==Admin Console==<br />
#In the server admin console, select a domain for GAL sync under "Domains".<br />
#Click "Configure GAL".<br />
#Set "GAL mode:" "Internal".<br />
#Enter a value for "Most results returned by GAL Search".<br />
#Enter a new account name for "GAL sync account name".<br />
#Set "Datasource" name to ''InternalGAL''.<br />
#Enter a GAL polling interval. The GAL polling interval is the time between syncs to the internal LDAP.<br />
#Next, then Finish.<br />
#To force sync, go to the CLI and use zmgsautil<br />
zmgsautil forceSync -a galsync@domain.com -n InternalGAL<br />
<br />
==Command Line==<br />
zmgsautil createAccount -a galsync@domain.com -n InternalGAL --domain domain.com -t zimbra -f _InternalGAL<br />
zmgsautil forceSync -a galsync@domain.com -n InternalGAL<br />
<br />
=Setting Up External GAL Sync=<br />
Every domain in the Zimbra installation can have a single Active Directory or external LDAP GAL configuration. The '''first''' external ''datasource'' for the galsync account will use the external LDAP or Active Directory GAL configuration. Additional datasources require the configuration for the external source to be within the datasource itself. For example, consider this external GAL configuration for AD:<br />
<br />
<pre><br />
## Get Domain<br />
zmprov gd domain.com | grep -i gal<br />
zimbraGalLdapBindDn: CN=galsync, OU=Service Accounts, OU=Servers, DC=Corp, DC=domain, DC=com<br />
zimbraGalLdapBindPassword: thePassword<br />
zimbraGalLdapFilter: ad<br />
zimbraGalLdapPageSize: 1000<br />
zimbraGalLdapSearchBase: DC=Corp, DC=domain, DC=com<br />
zimbraGalLdapURL: ldap://ds1.corp.domain.com:3268<br />
zimbraGalMaxResults: 100<br />
zimbraGalMode: both<br />
zimbraGalSyncInternalSearchBase: DOMAIN<br />
<br />
## Get Datasource <br />
zmprov gds galsync@domain.com<br />
# name ActiveDirectoryGAL<br />
# type gal<br />
objectClass: zimbraDataSource<br />
objectClass: zimbraGalDataSource<br />
zimbraCreateTimestamp: 20090728211318Z<br />
zimbraDataSourceEnabled: TRUE<br />
zimbraDataSourceFolderId: 257<br />
zimbraDataSourceId: 4c94f205-43fb-4706-a13b-8ce64eadde4e<br />
zimbraDataSourceName: ActiveDirectoryGAL<br />
zimbraDataSourcePollingInterval: 1d<br />
zimbraDataSourceType: gal<br />
zimbraGalLastFailedSyncTimestamp: 20090818071009Z<br />
zimbraGalLastSuccessfulSyncTimestamp: 20090925155938Z<br />
zimbraGalStatus: enabled<br />
zimbraGalType: ldap<br />
</pre><br />
The ''ActiveDirectoryGAL'' datasource uses the GAL configuration stored in the domain's GAL configuration attributes.<br />
<br />
==Admin Console==<br />
#Specify "GAL mode:" as one of "External" or "Both".<br />
#Choose a datasource name. ''E.g., ActiveDirectoryGAL or ExternalGAL''.<br />
#Enter a polling interval.<br />
#Specify "Server type" and configure the the rest of the external GAL settings. <br />
<br />
==Command Line==<br />
If the external GAL was configured on the command line, or is already configured without a datasource, ''zmgsautil'' can be used to setup the external LDAP datasource. If the galsync account is being created for the first time and external GAL is configured, the datasource will be setup with the ''zmgsautil createAccount'' command.<br />
<pre><br />
zmgsautil createAccount -a galsync@domain.com -n ExternalGAL --domain domain -t ldap -f _ExternalGAL<br />
</pre><br />
<br />
==Adding Additional Datasources==<br />
Additional datasources are configured with the ''zmgsautil'' tool and the ''createAccount'' sub command. This creates an additional datasource on the galsync account and does not overwrite the account. Specific values for the datasource URL, bind DN, bind password and search base are then provisioned with ''zmprov''.<br />
*Retrieve current datasources for the galsync account.<br />
<pre><br />
## Get Datasource <br />
zmprov gds galsync@domain.com<br />
# name ActiveDirectoryGAL<br />
# type gal<br />
objectClass: zimbraDataSource<br />
objectClass: zimbraGalDataSource<br />
zimbraCreateTimestamp: 20090728211318Z<br />
zimbraDataSourceEnabled: TRUE<br />
zimbraDataSourceFolderId: 257<br />
zimbraDataSourceId: 4c94f205-43fb-4706-a13b-8ce64eadde4e<br />
zimbraDataSourceName: ActiveDirectoryGAL<br />
zimbraDataSourcePollingInterval: 1d<br />
zimbraDataSourceType: gal<br />
zimbraGalLastFailedSyncTimestamp: 20090818071009Z<br />
zimbraGalLastSuccessfulSyncTimestamp: 20090925155938Z<br />
zimbraGalStatus: enabled<br />
zimbraGalType: ldap<br />
</pre><br />
*Optionally create a new contact folder in the galsync account to store the GAL with ''zmmailbox''.<br />
<pre><br />
zmmailbox -z -m galsync@domain.com createFolder --view contact /_AnotherGAL<br />
257<br />
</pre><br />
*Add new datasource with ''zmgsautil createAccount''.<br />
<pre><br />
zmgsautil createAccount -a galsync@domain.com -n AnotherGAL --domain domain.com -t ldap -f _AnotherGAL -p 1d<br />
</pre><br />
* Configure the newly created ''AnotherGAL'' datasource with the proper server and authentication credentials. '''Not performing this step will result in the datasource inheriting the GAL configuration from the domain.'''<br />
<pre><br />
zmprov mds galsync@domain.com AnotherGAL \<br />
zimbraGalSyncLdapBindDn uid=zimbra,cn=admins,cn=zimbra \<br />
zimbraGalSyncLdapBindPassword thePassword \<br />
zimbraGalSyncLdapFilter '(&(mail=*)(zimbraAccountStatus=active)(!(zimbraHideInGAL=TRUE)))' \<br />
zimbraGalSyncLdapSearchBase dc=anotherdomain,dc=com \<br />
zimbraGalSyncLdapURL ldap://ldap.anotherdomain.com:389 \<br />
</pre><br />
*Finally, show all datasources for the galsync account.<br />
<pre><br />
zmprov gds galsync@domain.com <br />
# name ActiveDirectoryGAL<br />
# type gal<br />
objectClass: zimbraDataSource<br />
objectClass: zimbraGalDataSource<br />
zimbraCreateTimestamp: 20090728211318Z<br />
zimbraDataSourceEnabled: TRUE<br />
zimbraDataSourceFolderId: 257<br />
zimbraDataSourceId: 4c94f205-43fb-4706-a13b-8ce64eadde4e<br />
zimbraDataSourceName: ActiveDirectoryGAL<br />
zimbraDataSourcePollingInterval: 1d<br />
zimbraDataSourceType: gal<br />
zimbraGalLastFailedSyncTimestamp: 20090818071009Z<br />
zimbraGalLastSuccessfulSyncTimestamp: 20090925155938Z<br />
zimbraGalStatus: enabled<br />
zimbraGalType: ldap<br />
<br />
# name AnotherGAL<br />
# type gal<br />
objectClass: zimbraDataSource<br />
objectClass: zimbraGalDataSource<br />
zimbraCreateTimestamp: 20090729085331Z<br />
zimbraDataSourceEnabled: TRUE<br />
zimbraDataSourceFolderId: 25212<br />
zimbraDataSourceId: 1fb50a98-7168-4ade-98e0-fccd414047a2<br />
zimbraDataSourceName: AnotherGAL<br />
zimbraDataSourcePollingInterval: 1d<br />
zimbraDataSourceType: gal<br />
zimbraGalLastSuccessfulSyncTimestamp: 20090925124604Z<br />
zimbraGalStatus: enabled<br />
zimbraGalSyncLdapBindDn: uid=zimbra,cn=admins,cn=zimbra<br />
zimbraGalSyncLdapBindPassword: thePassword<br />
zimbraGalSyncLdapFilter: (&(mail=*)(zimbraAccountStatus=active)(!(zimbraHideInGAL=TRUE)))<br />
zimbraGalSyncLdapPageSize: 100<br />
zimbraGalSyncLdapSearchBase: dc=anotherdomain,dc=com<br />
zimbraGalSyncLdapURL: ldap://ldap.anotherdomain.com:389<br />
zimbraGalType: ldap<br />
</pre><br />
<br />
The server providing data to the ''AnotherGAL'' datasource just happens to be an external Zimbra server, but could be any other LDAP or AD. Be sure to use ''zimbraGALType '''ldap''''' and not '''zimbra''' if the external LDAP is Zimbra. The '''zimbra''' GAL type is reserved for the internal GAL only.<br />
<br />
==External Contacts From Active Directory==<br />
Multiple datasources can be specified for external contacts which contain email addresses with domains not homed on any Zimbra servers; e.g., vendor accounts, outside affiliates, etc. As of this time of writing, external contacts for GAL can only be managed by external datasources. See [http://bugzilla.zimbra.com/show_bug.cgi?id=29697 bug 29697].<br />
<pre><br />
zmgsautil createAccount -a galsync@domain.com -n ExternalContactsGAL --domain domain.com -t ldap -p 1d<br />
zmprov mds galsync@domain.com ExternalContactsGAL \<br />
> zimbraGalSyncLdapBindDn zimbra@corp.domain.com \<br />
> zimbraGalSyncLdapBindPassword thePassword \<br />
> zimbraGalSyncLdapFilter "(&(objectClass=contact)(mail=*))" \<br />
> zimbraGalSyncLdapSearchBase dc=corp,dc=domain,dc=com \<br />
> zimbraGalSyncLdapURL ldap://ds1.corp.domain.com:3268 \<br />
</pre><br />
<br />
=Troubleshooting=<br />
*GAL paging or external GAL sync is not functioning with multiple datasources.<br />
Verify ''zimbraDataSourceEnabled'' is not '''FALSE''' for any one datasource. If one datasource must be disabled, then it should be deleted.<br />
*GAL search skips the first external GAL DS in the galsync account.<br />
Make sure ''zimbraGALMode'' is set to '''both''' on the domain. Remember, the first external DS on the galsync account inherits the external GAL settings configured for the domain. See [http://bugzilla.zimbra.com/show_bug.cgi?id=41321 bug 41321].<br />
<pre><br />
zmprov md domain.com zimbraGALMode both<br />
</pre><br />
*GAL contains duplicate entries.<br />
If multiple datasources are specified, galsync can grab duplicates if the search scope overlaps. Duplicates will not be reconciled. Open the galsync account from the admin console and find out which contact folders are holding the duplicated entry. Refine the search base on the datasource and force another sync with ''zmgsautil''.<br />
<br />
=References=<br />
[http://www.zimbra.com/forums/users/31243-gal-browsing-6-0-a-2.html Forums: GAL Browsing]<br><br />
[http://bugzilla.zimbra.com/show_bug.cgi?id=29697 Bug 29697] External (non-Zimbra) addresses in GAL<br />
{{Article_Footer|ZCS 6.0.x|09/30/2009}}<br />
<br />
[[Category:Administration]]<br />
[[Category:GAL]]</div>Matthew Rhoades