Difference between revisions of "PMC:QA:Selenium with ZK Webui POC"

From ADempiere
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.
(References)
(Links)
 
(One intermediate revision by the same user not shown)
Line 72: Line 72:
 
* http://docs.zkoss.org/wiki/How_to_Test_ZK_Application_with_Selenium
 
* http://docs.zkoss.org/wiki/How_to_Test_ZK_Application_with_Selenium
  
==Links==
+
* In this SF thread there is debate that the IDGenerator is resolved [http://red1.org/adempiere/viewtopic.php?f=29&t=1251&p=6832#p6832]. - [[User:Red1|Redhuan D. Oon]] 04:08, 18 October 2011 (UTC)
  
 +
==Links==
 
* Go back to [[PMC:QA]]
 
* Go back to [[PMC:QA]]
 +
* [http://red1.org/adempiere/viewtopic.php?f=28&t=1424 POC of Selenium testing] with movie of it in action.
  
 
[[Category: Testing]]
 
[[Category: Testing]]

Latest revision as of 04:50, 2 November 2011

Selenium with hudson and ADwebui

Recorded test script

Record Sahi script via Selenium ide(Selenium ide 1.0.5).

how to do please refer to PMC:QA:selenium

Problems

problem 1

Here has a problem:"Your browser doesnt support Xml Http Request"

Sead.png

It's a Selenium's bug.Check it out here:

http://code.google.com/p/selenium/issues/detail?id=388

The fix should be implemented in version 1.0.6.

Meanwhile, you can fix it by yourself. Here is how I did it:

  • search for "selenium-ide-common.xul" file

for windows:in "C:\Documents and Settings\<your username>\" folder

for linux:in /home/<your username>/.mozilla/firefox/xokico1w.default/extensions/{a6fd85ed-e919-4a43-a5af-8da18bda539f}/chrome/content

  • edit it and add the following code in e.g. line 64:
<script type="application/x-javascript"
src="chrome://selenium-ide/content/selenium/scripts/xmlextras.js"/>
  • restart Firefox.

now,done!

problem 2

we can take a look of the generated HTML by using Firefox with Firebug.

Adempiere webui based on ZK.,we can find that the element's id is different in every time testing.(eg.First time i get z_ve_5, but second time i get z_0f_5).

the textbox:UserId

Sead3.png

the generated html by using Firefox with Firebug.

  • first time

Sead1.png

  • second time

Sead2.png

it is more convenient if we know the ID of it. (If your case is complicated, you will get a long, hard to find XPath) So we can use the id generator function of ZK to generate predictable id of HTML element. Thus, we can get it by using Selenium.method("the name").

How to test ZK Application with Selenium please refer to:http://docs.zkoss.org/wiki/How_to_Test_ZK_Application_with_Selenium

But now Adempiere webui haven't integrate with IdGenerator.


References

  • In this SF thread there is debate that the IDGenerator is resolved [1]. - Redhuan D. Oon 04:08, 18 October 2011 (UTC)

Links