Advice on redirects?

3 views
Skip to first unread message

Josh Allen

unread,
Aug 15, 2011, 5:55:50 PM8/15/11
to tellurium-users
I've yet to find a dependable way to handle redirects. Suppose I jump
directly to a url (using urlConnect) we'll call Page A, which
immediately redirects to Page B. After connecting to Page A, my test
continues and looks for an element on Page B by calling
waitForElementPresent. Tellurium hangs indefinitely here, presumably
because it's searching for the element on Page A. Oddly, it never
times out after the specified 10 seconds.

One solution I was examining: after connecting to Page A, I can
examine the url (using the getLocation method) until it matches
something that looks like Page B, at which point I can proceed.
getLocation seems to hang indefinitely as well.

Any general advice for tackling this problem?

Thanks!
- Josh

Jian Fang

unread,
Aug 17, 2011, 6:30:46 PM8/17/11
to telluri...@googlegroups.com
The code of waitForElementPresen is as follows in the Accessor class,

def boolean waitForElementPresent(WorkflowContext context, String
locator, int timeout) {

//boolean result = false

for (int second = 0; second < timeout; second += 500) {
try {
if (cbp.isElementPresent(context, locator)) {
//result = true
return true
}
} catch (Exception e) {

}

Helper.pause(500)
}

//return result;
return false
}

Did you see multiple commands issued to Selenium server during the
wait time? If not, on which command did Tellurium hang?

Perhaps you could also try to delay the tests for a while and run the
tests after the redirect.

Thanks,

Jian

> --
> You received this message because you are subscribed to the Google Groups "tellurium-users" group.
> To post to this group, send email to telluri...@googlegroups.com.
> To unsubscribe from this group, send email to tellurium-use...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/tellurium-users?hl=en.
>
>

Reply all
Reply to author
Forward
0 new messages