I have a web form with two buttons on it, each runs a different javascript in the page. The problem is, WebRecorder records them both as identical steps, even though they should run different functions:
(WebRecorder results for either button)
Code: Select all
Let>FrameName={"workarea_frame"}
Let>FormName={"ReportQuery"}
Let>TagValue={""}
IE_ClickTag>%IE[3]%,str:FrameName,str:FormName,INPUT,NAME,str:TagValue,r
Here are the button sources:
Code: Select all
<input onClick="javascript: doCustomQuery('ReportQuery')" class="cGoButton" value="Go" type="BUTTON"></input>
<input onClick="javascript: doSearch('ReportQuery', '');" class="cGoButton" value="Go" type="BUTTON"></input>
Code: Select all
function doSearch(formId, searchText)
{
if(searchText == '')
{
searchText = getElementValue(formId, formId + '_search_text');
searchText = replace(searchText, "%", "");
}
// we need to wrap the string 'null' in quotes
// otherwise it does not come in as a parameter to the list filtering
if(searchText.toLowerCase() == 'null')
{
searchText = "'" + searchText + "'";
}
setElementValue(formId, formId + '_search_text', TRIM(searchText));
var actionLink = "/long/dynamic........./URL/here";
eval('document.' + formId + '.action = actionLink;');
eval('document.' + formId + '.submit();');
}
function doCustomQuery(formId)
{
var actionLink = "/ANOTHER/long/dynamic........./URL/here";
eval('document.' + formId + '.action = actionLink;');
eval('document.' + formId + '.submit();');
}
TIA
-mp