カスタムコマンドのサンプル集
From GXtest Wiki
Contents |
GoToObject
タイプ:イベント 説明:GeneXus オブジェクトの名前をパラメーターとして受け取り、その URL に移動します。
if (currentLanguage=="java")
{
window.location=paramJS;
}
else if (currentLanguage=="net")
{
window.location=paramJS+".aspx";
}
else
{
window.alert("language: " + currentLanguage);
}
result = "OK";
return result;
VerifyURL
タイプ:検証 説明:URL をパラメーターとして受け取り、ブラウザーの URL がパラメーターの URL と一致するかどうかを検証します。
var url=window.document.location.href;
if(url.indexOf(paramJS)==-1)
result = "OK";
else
result="falla";
VerifyTitle
タイプ:検証 説明:タイトルをパラメーターとして受け取り、ブラウザーのタイトルがパラメーターのタイトルと一致するかどうかを検証します。
if (document.location.href.indexOf(paramJS)!=-1)
{
result = "OK";
}
else
{
result= "The string ("+paramJS+") is not in the url ("+document.location.href+")";
}
ClickGridButtons
タイプ:アクション 説明:グリッドのボタン ([先頭]、[前へ]、[次へ]、または [最後]) をクリックします。
function CustomCommand (paramJS, currentGXVersion, currentLanguage)
{
window.document.getElementsByClassName("PagingButtons" + paramJS)[0].click();
result = "OK";
return result;
}