Difference between revisions of "Custom Commands Repository"
From GXtest Wiki
(New page: == Go To Object == <pre> if (currentLanguage=="java") { window.location=paramJS; } else if (currentLanguage="net") { window.location=paramJS+".aspx"; } else { alert("language: " + ...) |
(→Go To Object) |
||
| Line 2: | Line 2: | ||
== Go To Object == | == Go To Object == | ||
| + | '''Tipo''': Evento | ||
| + | '''Descripción''': se pasa por parámetro un nombre de un objeto GeneXus y navega a la url de dicho objeto. | ||
| + | |||
<pre> | <pre> | ||
| Line 8: | Line 11: | ||
window.location=paramJS; | window.location=paramJS; | ||
} | } | ||
| − | else if (currentLanguage="net") | + | else if (currentLanguage=="net") |
{ | { | ||
window.location=paramJS+".aspx"; | window.location=paramJS+".aspx"; | ||
| Line 14: | Line 17: | ||
else | else | ||
{ | { | ||
| − | alert("language: " + currentLanguage); | + | window.alert("language: " + currentLanguage); |
} | } | ||
result = "OK"; | result = "OK"; | ||
return result; | return result; | ||
| + | </pre> | ||
| + | |||
| + | == VerifyUrl == | ||
| + | '''Tipo''': Validacion | ||
| + | '''Descripción''': se pasa por parámetro una url y valida que la url del browser coincida con dicha url | ||
| + | |||
| + | <pre> | ||
| + | var url=window.document.location.href; | ||
| + | if(url.indexOf(paramJS)==-1) | ||
| + | result = "OK"; | ||
| + | else | ||
| + | result="falla"; | ||
| + | </pre> | ||
| + | |||
| + | |||
| + | == VerifyTitle == | ||
| + | '''Tipo''': Validacion | ||
| + | '''Descripción''': se pasa por parámetro un titulo y valida que el titulo del browser coincida con el pasado como parámetro. | ||
| + | |||
| + | <pre> | ||
| + | |||
| + | |||
| + | if (document.location.href.indexOf(paramJS)!=-1) | ||
| + | { | ||
| + | result = "OK"; | ||
| + | } | ||
| + | else | ||
| + | { | ||
| + | result= "The string ("+paramJS+") is not in the url ("+document.location.href+")"; | ||
| + | } | ||
</pre> | </pre> | ||
Revision as of 18:45, 10 January 2011
Go To Object
Tipo: Evento Descripción: se pasa por parámetro un nombre de un objeto GeneXus y navega a la url de dicho objeto.
if (currentLanguage=="java")
{
window.location=paramJS;
}
else if (currentLanguage=="net")
{
window.location=paramJS+".aspx";
}
else
{
window.alert("language: " + currentLanguage);
}
result = "OK";
return result;
VerifyUrl
Tipo: Validacion Descripción: se pasa por parámetro una url y valida que la url del browser coincida con dicha url
var url=window.document.location.href;
if(url.indexOf(paramJS)==-1)
result = "OK";
else
result="falla";
VerifyTitle
Tipo: Validacion Descripción: se pasa por parámetro un titulo y valida que el titulo del browser coincida con el pasado como parámetro.
if (document.location.href.indexOf(paramJS)!=-1)
{
result = "OK";
}
else
{
result= "The string ("+paramJS+") is not in the url ("+document.location.href+")";
}