1

I am trying to automate my web application using Selenium. I am able to log in by using Selenium, but after that one web applet is generated where I can't get the handle of that application.

Is it really possible to get the automation?

Deepak Rai
  • 2,163
  • 3
  • 21
  • 36
VNS
  • 158
  • 1
  • 10

2 Answers2

0

Not that I know of, the Selenium WebDriver itself is, as you've found out, not going to get you any where with Java Applets.

For the Java language though, the Robot class might help.

http://docs.oracle.com/javase/7/docs/api/java/awt/Robot.html

Arran
  • 24,648
  • 6
  • 68
  • 78
  • i am trying to use FEST-SWING with Selenium-RC to automate my application. But it is not worked out for me. The issues i faced are 1) It will work on only Swing based applications, not for AWT components. 2) I don't have any control over the application code i need to test. So based on my analysis i come to conclusion that we are not able to automate applet from selenium. Correct me when i am wrong. @Arran Thanks for your reply. – VNS Apr 22 '13 at 07:30
0

Sorry, I know its too late :). I assume when you say "one web applet is generated", it means a new pop-up is generated. (correct me if I'm wrong)

I use to switch between window handles like this,

//Save your current(i.e old) handle //Find new window & Get the new handle and switch window

 string currentHandle = driver.CurrentWindowHandle;
 PopupWindowFinder finder = new PopupWindowFinder(driver);
 string newHandle = finder.Click(driver.FindElement(By.Id("primarycontactid")));
  driver.SwitchTo().Window(newHandle);