Hi Marc and all, 

Sorry to bring this up again. After some attempts but not succeed, here I 
extract the javascript code that is related. Any idea about what went wrong?

Thanks, 
Katherine

----- Original Message ----
From: Marc Guillemot <[EMAIL PROTECTED]>
To: [email protected]
Sent: Tuesday, March 11, 2008 7:35:03 PM
Subject: Re: [Webtest] clickLink triggers the load of a new page

 Hi,

the link onclick class submitEvent but without this function, it is
difficult to say what is going wrong.

Cheers,
Marc.
-- 
Blog: http://mguillem.wordpress.com


Katherine Dinh wrote:
> Hi Marc, thanks for replying.
> 
> In browser, when clickLink is executed (page1), it
> goes to a new page (page2 - trimmed). But in canoo
> result, no new page is triggered (result). 
> 
> My company use MDA, what I use is just model/abstract
> language, and the 'studio' will render the rest, so I
> have no way of changing the produced html code. 
> 
> The link have no id, dummy href, there's in fact
> another shorter option using <clickElement
> xpath="//a[starts-with(@title,'Select row')]"> but it
> has the same problem as above. 
> 
> Thanks
> Katherine
> 
> --- Marc Guillemot <[EMAIL PROTECTED]> wrote:
> 
>> Katherine,
>>
>> what happens when clickLink is executed?
>>
>> Btw: do you really need the whole label to uniquely
>> identify your link?
>> This is not really readable and therefore
>> maintainable.
>>
>> Cheers,
>> Marc.
>> -- 
>> Blog: http://mguillem.wordpress.com
>>
>>
>> Katherine Dinh wrote:
>>> Hi
>>>
>>> I'm trying to use Canoo for testing of our project
>> and have some problem
>>> with it. The scenario is product searching,
>> supposedly when I click on
>>> the detail icon, it should lead to product detail
>> page. But the result
>>> doesn't show as expected. Can you help me take a
>> look please?



HTML File

<SCRIPT type=text/javascript>
                        window.ajax_validation_enabled = false;
                        window.ajax_mode = 10;
                        window.ctxRoot = "/Teller_Web";
                        window.fileServlet = "/file";
</SCRIPT>
<A class=iconLink 
      title="Select row | 
en&#10;(com.finantix.stdlib.widgets:table.internal:TableRow 
<com.finantix.fxc.subjects.securitytrading::SOrderTrackingSearchResultItem>)&#10;(finder.currentFinder.results.currentRows[0].selectRow)"
 
      
onclick="submitEvent(document.forms['UX_FORM'],'finder.currentFinder.results.currentRows[0].selectRow');
 return false;" 
      
href="http://localhost:8080/Teller_Web/com.finantix.fxc.functions.securitytrading.UOrderTracking.(2C844).do#">
          <IMG 
      
onmouseup="imgRoll('finder.currentFinder.results.currentRows[0].selectRow_icon','/Teller_Web/file/(9852393708D7B53F)/com/finantix/stdlib/lang/lim/xsl/ux/util/img/BtnSelect_Over.gif');"
 
      
onmousedown="imgRoll('finder.currentFinder.results.currentRows[0].selectRow_icon','/Teller_Web/file/(9852393708D7B53F)/com/finantix/stdlib/lang/lim/xsl/ux/util/img/BtnSelect_Down.gif');"
 
      id=finder.currentFinder.results.currentRows[0].selectRow_icon 
      
onmouseover="imgRoll('finder.currentFinder.results.currentRows[0].selectRow_icon','/Teller_Web/file/(9852393708D7B53F)/com/finantix/stdlib/lang/lim/xsl/ux/util/img/BtnSelect_Over.gif');"
 
      
onmouseout="imgRoll('finder.currentFinder.results.currentRows[0].selectRow_icon','/Teller_Web/file/(9852393708D7B53F)/com/finantix/stdlib/lang/lim/xsl/ux/util/img/BtnSelect.gif');"
 
      alt="Select row | 
en&#10;(com.finantix.stdlib.widgets:table.internal:TableRow 
<com.finantix.fxc.subjects.securitytrading::SOrderTrackingSearchResultItem>)&#10;(finder.currentFinder.results.currentRows[0].selectRow)"
 
      src="abc_files/BtnSelect.gif"></IMG> 
</A>                    


SCRIPTS.JS

var AJAX_MODE_NONE = 0;
var AJAX_MODE_WIDGETS = 5;
var AJAX_MODE_ALL = 10;

function submitEvent(form, event, uuid){
        submitManager(form, generateEvent(event), uuid);
}

function submitManager(form, event, uuid){
        Reports.start("submitManager");
        if (!form.submitted) {
                form.submitted = true;
                form.toBeResubmitted = false;
                if(doBeforeSubmit()){
                        beginWait();
                        form.action = event;
                        switch (window.ajax_mode){
                                case AJAX_MODE_ALL :
                                        if (uuid == false){
                                                // forced NOT AJAX invocation, 
but tries the asynch validation if needed
                                                
if(window.ajax_validation_enabled){
                                                    form.toBeResubmitted = true;
                                                        openAjaxRequest(form, 
uuid);
                                                } else{
                                                        
updateFormEnctype(form); 
                                                        form.submit();
                                                }
                                        } else {
                                                openAjaxRequest(form, uuid);
                                        }
                                        break;
                                /* can be removed */
                                case AJAX_MODE_WIDGETS :
                                        <truncate>
                                default :
                                        <truncate>
                        }
                } else {
                        form.submitted = false;
                }
        }
        Reports.end();
}

function openAjaxRequest(form, uuid){
        new Ajax.Request(form.action, {
                parameters: serializeForm(form, uuid), 
                onSuccess: processAjaxResponse.bind({form:form}), 
                onException: processAjaxFailure.bind({form:form})
        });
}


PROTOTYPEJS
The code for Ajax is provided by Prototype JS

Reply via email to