TestingHobo
10 years agoContributor
How do i validate a URL redirect
Hi
I am currently trying to validate a URL redirect, we have a process that if you navigate to http on login it will redirect you to https.
I am using javascript but i am unalble to use indexOf in an if statement.
In short i want to know how i can say:
var Page = Sys.Browser("*").Page("*");
var url = Page.URL
IF (url == "https*")
{
//do something
Log.Message(url, "Page redirectd to https")
}
You can use a property checkpoint for the URL property:
var redirected = aqObject.CheckProperty(Page, "URL", cmpStartsWith, "https://");
// The checkpoint posts a log entry
if (redirected) { // Do something }