0

I'm using the Selenium IDE to create some test scenario's. I want to create a scenario where a user tries to visit a certain url without logging in. But the webpage should redirect the user to the login screen instead, since the user needs to login first But I can't find any information about redirecting with the Selenium IDE.

Peter Boomsma
  • 8,851
  • 16
  • 93
  • 185

1 Answers1

1

Check this out. That will prevent javascript redirect:

getEval       | window.location.href = 'http://your.page'; 
storeLocation | url
while         | storedVars['url'] != 'http://your.page'
storeLocation | url
endWhile
getEval       | window.stop();

You need Selenium IDE flow control for that.

if you just need to check that redirection happens:

open          | http://your.page
pause         | 5000
storeLocation | url
verifyEval    | storedVars['url'] == 'http://crocodile.page' | true

If you need something else try to make your question a little bit more detailed. It is hard to understand what are you trying to do.

Antesser
  • 669
  • 4
  • 5