1

I am automating a webmail which log off every 15 minutes when it loses focus. So i need to find out the idle time of the browser to refresh the browser when its idle time reaches 15 minutes. I am using WatiN to automate that web mail. Please suggest me a proper way to find out the browser's idle time. Thanks


Thanks for your reply.

I am using C# program and WatiN to automate that web mail application. I don't know how to use java script in C# form program. Could you please suggest me how to implement this in my code. Thanks in advance.

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
Manoj
  • 11
  • 1

2 Answers2

0

You can also use javascript and reset a 15 minute timer when the user does an action. If that 15 minute mark is ever reached, it can forward to a page and log them off.

Justin
  • 6,373
  • 9
  • 46
  • 72
0

Using JavaScript, you can detect whether the user has the web page active (i.e. in focus). As soon as the focus is lost, you start your timer, and when it elapses, you redirect the user to a page that logs them out.

If the page regains focus within the preset time, you have to stop and reset the timer.

Community
  • 1
  • 1
CodeCaster
  • 147,647
  • 23
  • 218
  • 272