JStudio SiteWalker Service Board Forum Index JStudio SiteWalker Service Board
Find out / share information about our product, experience and requirements. To serve all user all postings must be written in English language. We are looking for constructive meanings and experience. Disrespectful postings will be deleted immediately.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

dynamic contents

 
Post new topic   Reply to topic    JStudio SiteWalker Service Board Forum Index -> How To: Specific requirements in practise
View previous topic :: View next topic  
Author Message
Ricardo
Guest





PostPosted: Wed May 24, 2006 6:52 am    Post subject: dynamic contents Reply with quote

Hi team,
we evaluated JStudio but still have problems to automate our online applications. Because contents are generated frequently many attributes of relevant HTML elements to be automated or tested have no stable values, because they will change when generating an updated version. Also the position index can not be used when content changes. Is there another way for automating when content and attributes values often change ?
Thanks for your immediate advice.
Back to top
sitewalker
Site Admin


Joined: 09 Feb 2006
Posts: 39

PostPosted: Thu May 25, 2006 8:50 am    Post subject: generate IDs for HTML elements at runtime Reply with quote

Hello Ricardo,

thanks for your interest in JStudio SiteWalker.

Automating web based application surly needs elements attributes they do not change permanentely. Without stable value to re-identify HTML elements necessary for the automated process test automation becomes hard or at least raises efforts to change automated tests frequently.

You might try the following: for each page / frame with nested elements just select at first it's body-tag element and add it as Navigation Step to the project before adding the HTML elements as steps needed for the process. This (body-tag) step always executes the following JavaScript (that has to be copied into a .js - file and assigned to the step):

Code:
for(i=0; i <document.getElementsByTagName("INPUT").length -1; i++){
   if (!document.getElementsByTagName("INPUT")[i].id){
       document.getElementsByTagName("INPUT")[i].id = document.getElementsByTagName("INPUT")[i].tagName + "(" + i + ")";

   }
}

Copy this scriptlet for each HTML tag type you want automate as steps (e.g. if an SPAN-tag also is used then copy it and replace "INPUT" by "SPAN")

This scripts just set id's to all elements of the specified tag type if no id's already exists. By executing the script above each element of tag name "INPUT" gets the attribute id=INPUT(index) which is unique within the document. After executing the Task and it's body tag proceeding recording can be done by using the generated id's as reidentifier attribute for all elements. This solution of dynamic id's is resistant on changes as long as no elements of the tag type with lower index are added or removed.

Hope these suggestion might help to get stable automated tests with generic contents.

In next version 2.5.1 (coming soon) there will be a new reidentifier attribute "TypeIndex" that will support similar approaches.

Enjoy working with JStudio SiteWalker.

regards,

Frank
Back to top
View user's profile Send private message Send e-mail
Ricardo



Joined: 25 May 2006
Posts: 1

PostPosted: Thu May 25, 2006 7:26 pm    Post subject: excellent Reply with quote

Frank,

fantastic. It works excellent. Thank you very much.

Ricardo
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    JStudio SiteWalker Service Board Forum Index -> How To: Specific requirements in practise All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group