0

Is there any way to make selenium pause/hold util next JavaScript event. For Example :

If i design same login page as Gmail with user name ,password and a button. with selenium test case, it will fill username ,password and submit.

but what i want is, if i put user name in mytextbox so on focuslost event i want to fill the same textbox on gmail page,same with password, and if i click on login button on my page then it should also perform click event on main gmail page.

Is it possible..? running selenium on specific events?

Plz share any which will be helpful

Thanks in advance..

Zee
  • 41
  • 2
  • 8
  • Not sure what you're asking. Do you want Selenium to click the login button on Gmail? – Shaun Jun 03 '15 at 17:41
  • I want to create a remote controller.if i click on my button it should also click on gmail login button. – Zee Jun 04 '15 at 04:25

1 Answers1

0

If you use JavascriptExecutor and executeScript method it pauses all execution after until the result is returned. There are good amount of discussion on StackOverflow regarding the difference between executeScript and executeAsyncScript which can help you in this case.

And, the Java api doc is here

Community
  • 1
  • 1
Saifur
  • 16,081
  • 6
  • 49
  • 73