6 messages in com.canoo.lists.webtestRe: [Webtest] Problem setting radio b...
FromSent OnAttachments
Christian Kölle15 Jan 2008 00:00 
Marc Guillemot15 Jan 2008 04:21 
Christian Kölle16 Jan 2008 03:27 
Marc Guillemot16 Jan 2008 04:00 
Christian Kölle16 Jan 2008 23:58 
Marc Guillemot17 Jan 2008 00:07 
Subject:Re: [Webtest] Problem setting radio button (incl. Javascript)
From:Marc Guillemot (mgui@yahoo.fr)
Date:01/15/2008 04:21:18 AM
List:com.canoo.lists.webtest

Hi,

can you provide the full stack trace?

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

Christian Kölle wrote:

Hi

I have a strange problem with setting radio buttons in my test. After the step the radio button sometimes is set correctly and sometimes not. I wasn't able to find some regularities in the behavior. Without changing anything subsequent attempts succeed or fail.

The only thing i've noticed is the following error message in the log file:

[setRadioButton] ERROR (com.gargoylesoftware.htmlunit.html.HtmlForm) - org.jaxen.XPathSyntaxException: Expected: ]

But this occurs every time (even if the setting succeeds).

I've tried it with several webtest builds (1643, 1649 and some older ones) and get the same result. I work on a linux box with Java 1.5.

Any hints?

Thanks Christian

-------------------------------------------------------------------------------

The webtest script is like this:

<storeXPath xpath="//tr[contains(td/a/text(), 'dn03-domain.ch')]/td/input[@type='radio' and starts-with(@name, 'selectedDeleteTimeItems')]/@name" property="deleteTime"/> <echo>------- Test:#{deleteTime}</echo> <setRadioButton name="#{deleteTime}" value="immediate"/>

The radio button is defined like this:

<input type="radio" value="immediate" name="selectedDeleteTimeItems['-375616497']"
onClick="ConfirmSelectionAsync('dn0302ItemSelection.action;jsessionid=928342894623946','immediate','-375616497',this)" />

The JavaScript function(s):

function ConfirmSelectionAsync(actionname,type,id,ck) {

var args = 'checktype='+type+'&pid='+id+'&selection='+ck.checked; SendConfirmation(actionname,args,true);

}

function SendConfirmation(actionname,args,synch) {

var xmlHttp = false; // Internet Explorer try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { xmlHttp = false; } } // Mozilla, Opera und Safari if (!xmlHttp && typeof XMLHttpRequest != 'undefined') { xmlHttp = new XMLHttpRequest(); } if (xmlHttp) { xmlHttp.open('GET', actionname+'?'+args, synch); xmlHttp.onreadystatechange = function () { }; xmlHttp.send(null); }

return xmlHttp; }