[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4505: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3706)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4507: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3706)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4508: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3706)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4509: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3706)
From Flames To Fork, Comes Freedom • View topic - Selenium with Adempiere Integration

Selenium with Adempiere Integration

Automated Testing Tools are used to assure modifications are always backward compatible and safe for production
Forum rules
This forum is personally pruned to avoid redundant posts. Related topics are moved to the same sub-forum. Language will be corrected for readability.

Selenium with Adempiere Integration

Postby dravuri » Sun Feb 05, 2012 10:56 am

Hi All,
This thread is extension to the discussion i had with Carlos on the last Idempiere weekly meeting. Kindly see the below with steps I have performed. We need improve steps further to achieve the desired end goal.

1.Added Adempiere AdempiereIdGenerator.java ( Sample Code Below )

#####
private static final String DEFAULT_ZK_COMP_PREFIX = "zk_comp_";
private static final String DESKTOP_ID_ATTRIBUTE = "org.adempiere.comp.id";
public static final String ZK_COMPONENT_PREFIX_ATTRIBUTE = "zk_component_prefix";

@Override
public String nextComponentUuid(Desktop desktop, Component comp) {
String prefix = (String) comp.getAttribute(ZK_COMPONENT_PREFIX_ATTRIBUTE);
if (prefix == null || prefix.length() == 0){
prefix = DEFAULT_ZK_COMP_PREFIX;
}
else {
Pattern pattern = Pattern.compile("[^a-zA-Z_0-9]");
Matcher matcher = pattern.matcher(prefix);
StringBuffer sb = new StringBuffer();
while(matcher.find()) {
matcher.appendReplacement(sb, "_");
}
matcher.appendTail(sb);
prefix = sb.toString();
#####

2.Added Reference to AdempiereIDGenerator in zk.xml

####
<system-config>
<id-generator-class>org.adempiere.webui.AdempiereIdGenerator</id-generator-class>
</system-config>
#####
3.Now Made Changes in Weditor.java, to give our own specific attribute to each widget that is going to be rendered on the screen

#####
String gridTabName = gridField.getGridTab() != null
? "_" + gridField.getGridTab().getName() : "";
((HtmlBasedComponent)component).setAttribute(AdempiereIdGenerator.ZK_COMPONENT_PREFIX_ATTRIBUTE, "Field_" + gridField.getColumnName() + gridTabName);
#####
4.Created my own “Locator Buildor” for selenium IDE( created new MyNewLocator.js file)
######
LocatorBuilders.add('zk_component_prefix', function(e) {
if (e.hasAttribute('zk_component_prefix')) {
if (e.getAttribute('zk_component_prefix')) {
return '//' + e.nodeName + '[@zk_component_prefix=\'' +
e.getAttribute("zk_component_prefix") + '\']';
}
}
return null;
});

5. Now Associated Locator Builder to selenium IDE, look at “Selenium IDE Extensions”
AddingExtention.png
Adempiere Selenium Integration Steps
AddingExtention.png (47.13 KiB) Viewed 6033 times



6.Now Changed the Order of “Locator Builders” , I put my new locator builder on top, Intention in this step, when selenium IDE, starts recording script, it should first identify the widget with newly added zk attribute
CustomLocatorOnTop.png
CustomLocatorOnTop.png (27.1 KiB) Viewed 6033 times


7.Now start your Adempiere and start recording the script
PurchaseOrder.png
PurchaseOrder.png (110.14 KiB) Viewed 6033 times


Next steps will be covered in next post( I can not add more than 3 images )

Thanks,
Suman
dravuri
 
Posts: 19
Joined: Wed May 18, 2011 10:33 am

Re: Selenium with Adempiere Integration

Postby dravuri » Sun Feb 05, 2012 11:02 am

8 .Here my expectation is when tester( In this my self) entered data in Business Partner widget, selenium IDE should record the widgets new attribute that was added( This step is important to achieve the desired goal )
seleniumrecordsteps.png
seleniumrecordsteps.png (44.14 KiB) Viewed 6032 times

9.Now verify the widget with 'FireBug' to check whether our unique attribute is appearing on firebug, Firebug also does not have the ZK attribute mentioned below.
firebug.png
firebug.png (62.3 KiB) Viewed 6032 times


Conclusion: If we can see the “attribute” we have defined for each widget in Adempiere appears on firebug, and if selenium IDE can record this direcly then our Goal will be achieved.

Thanks,
Suman
dravuri
 
Posts: 19
Joined: Wed May 18, 2011 10:33 am

Re: Selenium with Adempiere Integration

Postby globalqss » Sun Feb 05, 2012 11:59 pm

globalqss
Senior
 
Posts: 599
Joined: Thu Dec 29, 2005 4:15 am
Location: Bogotá, Colombia


Return to Quality Assurance

Who is online

Users browsing this forum: No registered users and 1 guest

cron