ZK - Open Source Ajax Java FrameworkZK - Open Source Ajax Java Framework

ZTL issues

halyph
4 Oct 2011 07:17:40 GMT
4 Oct 2011 07:17:40 GMT

Hi All,

I'd like to clarify several ZTL related issues:

1. What's the official ZTL home page?
a) http://code.google.com/p/zk-ztl/
or
b) https://github.com/zkoss/ztl
2. What's the official ZTL issue tracker:
a) Jira - http://tracker.zkoss.org/browse/ZTL
or
b) GitHub issue page - https://github.com/zkoss/ztl/issues

3. Can I somehow record ZK UI actions via Selenium to automate this routine process?

4. What's the official ZTL related communication channel? (I guess this forum :-)

crc83
4 Oct 2011 10:14:24 GMT
4 Oct 2011 10:14:24 GMT

I have some issues with this.
I made fork from repo on http://code.google.com/p/zk-ztl/
han I made fork from repo on https://github.com/zkoss/ztl
What fork should I support to be up to date with you?

matthewgo
6 Oct 2011 03:57:16 GMT
6 Oct 2011 03:57:16 GMT

@ halyph

The ztl in google code is the old version for Selenium-RC .
and jira is the official ZTL issue tracker.
About third question ,do you mean that you want to test automatically everyday?

halyph
6 Oct 2011 06:58:33 GMT
6 Oct 2011 06:58:33 GMT

@matthewgo
I need to get ZTL compatible jq selectors. But, plain Selenium doesn't work well for this purpose.

crc83
6 Oct 2011 09:06:47 GMT
6 Oct 2011 09:06:47 GMT

@matthewgo
So I should follow repository on github to up to date with you?

matthewgo
6 Oct 2011 20:35:16 GMT
6 Oct 2011 20:35:16 GMT

@crc83

google code is ztl 1.0.0 for selenium rc
github is ztl 2.0.0 for selenium web driver

Whether to choose goodlecode or github will depend on your requirement and the use case.

crc83
6 Oct 2011 22:41:18 GMT
6 Oct 2011 22:41:18 GMT

@matthewgo
Is there some reqirements for thouse, who whant to contribute in a project?

jumperchen
7 Oct 2011 04:21:03 GMT
7 Oct 2011 04:21:03 GMT

Hi All,

Let me clarify the confusion for you

1. What's the official ZTL home page?

http://www.zkoss.org/product/ztl

2. What's the official ZTL issue tracker:

Jira - http://tracker.zkoss.org/browse/ZTL

3. What's the differences between the two source code repositories.

* ZTL 1.0.0 (with our own vision test) for Selenium RC
- http://code.google.com/p/zk-ztl/

* ZTL 2.0.0 for Selenium Web driver
- https://github.com/zkoss/ztl/

The reason we keep both repositories is that the Selenium Web driver does not support the vision test well,
and currently the web driver version is not stable for all of the browsers. But for ZK app developer they can choose which version is suitable to their requirement.

In ZK framework development environment, we use two repositories at the same time, ZTL 1.0.0 for our vision test and ZTL 2.0.0 for our function test.

crc83
7 Oct 2011 06:35:15 GMT
7 Oct 2011 06:35:15 GMT

can I help you to migrate vision tests from ZTL 1.0.0 to ZTL 2.0.0?
maybe some inputs from your sied can help me to start faster.

jumperchen
12 Oct 2011 20:19:36 GMT
12 Oct 2011 20:19:36 GMT

That means we have to change selenium-server (2.x) source code?
I tried before to use the official selenium web driver API, but in IE it will snapshot the different scene from the original screen that is the reason I went back to use the ZTL 1.0.0 version.
And the selenium web driver doesn't support Safari browser yet. From the functional-wise the vision test in ZTL 1.0.0 is more power than that Selenium 2.x provided.
If you can solve those issues for us that would be great. :D

crc83
13 Oct 2011 02:25:27 GMT
13 Oct 2011 02:25:27 GMT

I'm using Selenium 2.7 and corresponding IE Web Driver. I made some fixes in ZTL so captureScreenshot works fine with IE.
You could see https://github.com/crc83/ztl/commit/67896fe35ffed40096e4e7ce96eeb048bda5cd2e
file : ztl/ztl/src/main/java/org/zkoss/ztl/ZKTestCase.java

	public void captureScreenshot(String filename) {
		try {
			if (isIE()) {
				File screenshot = ((InternetExplorerDriver) getWebDriver()).getScreenshotAs(OutputType.FILE);
            	File dest = new File(filename);
            	if (dest.exists()) {
            		dest.delete();
            	}
            	screenshot.renameTo(dest);
        	} else {
        		getCurrent().captureScreenshot(filename);
        	}
            System.err.println("Saved screenshot " + filename);
        } catch (Exception e) {
            System.err.println("Couldn't save screenshot " + filename + ": " + e.getMessage());
            e.printStackTrace();
        }
	}

jumperchen
13 Oct 2011 02:40:40 GMT
13 Oct 2011 02:40:40 GMT

From the tracker I posted, it is not solved yet - http://code.google.com/p/selenium/issues/detail?id=2247.

Have you checked whether it captures a unnecessary scrollbar in IE?

crc83
13 Oct 2011 06:30:36 GMT
13 Oct 2011 06:30:36 GMT

I didn't saw any scrollbar issues.
I'm using IE9 on windows 7.

maybe this issue is related to specific component? I could check it on my environment.

crc83
17 Oct 2011 05:51:31 GMT
17 Oct 2011 05:51:31 GMT

Another question for ZKoss team.
I'm locating elements of the tree in next way

	public ClientWidget treeCellByLabel(String label){
		return jq("@treecell[label=\""+label+"\"] div.z-treecell-cnt");
	}

Is there some convenient methods to extract default zClasses for components?
Could zClasses change in future?

jumperchen
17 Oct 2011 20:21:47 GMT
17 Oct 2011 20:21:47 GMT

You can use the following instead.

return jq("@treecell[label=\""+label+"\"]").toWidget().$n("cave");

halyph
19 Oct 2011 01:46:50 GMT
19 Oct 2011 01:46:50 GMT

@jumperchen,
I have the next questions:
1. We are working with tables, trees and grids. Could you please suggest some meaningful samples how we can test such components?
2. Can we use "HtmlUnit Driver" just to avoid Browser usage? What's you experiences with this? Does "HtmlUnit Driver" work fine with ZK?

jumperchen
19 Oct 2011 02:23:24 GMT
19 Oct 2011 02:23:24 GMT

@Halyph

1. The answer is depended on which aspect would you want to test for? In ZK internal testing, if we want to test the layout display, we will use vision test to compare the images, and most of the cases in the grid, tree, tables, or layouts are layout display issue.
2. Yes, you can use HtmlUnit to test with ZK. In the past, I have only tested a few cases that work well, but not too many. From my thought at that time, the HtmlUnit is not mush fast than opening a chrome browser to test.

By the way, if you want to test a dynamic zul page in ZTL, the new Scala support in ZK project is mush fast than the ztl format to compile it (I mean the productivity for writing ZTL), you can take a look at this example.

halyph
19 Oct 2011 04:52:09 GMT
19 Oct 2011 04:52:09 GMT

@jumperchen,
Regarding tables, trees and grids components. All these components are build via Java code, almost all zul file are plain <tree>, <grid> tags without complicated zul customization. And we need to walk through the tree, verify tree cells, tree expands, hide/show tree column, validate data, etc.
I.e. simulate different users behavior.

Could you please suggest some proved way for testing such cases?

crc83
23 Oct 2011 15:16:33 GMT
23 Oct 2011 15:16:33 GMT

@jumperchen,
Hi, I made small article related to subject. Maybe it will be interesting for you and community
http://crc83.blogspot.com/2011/10/zkoss-ui-testing-experience.html

terrytornadoTop Contributor
23 Oct 2011 16:44:28 GMT
23 Oct 2011 16:44:28 GMT

Thanks Белей Сергей for your work.

1 2