File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Testing and the fly likes selenium, testng, eclipse processing a form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "selenium, testng, eclipse processing a form" Watch "selenium, testng, eclipse processing a form" New topic
Author

selenium, testng, eclipse processing a form

Manon Baratt
Ranch Hand

Joined: Jan 30, 2006
Posts: 58
Hi,

I am using selenium and testng in eclipse. I have a struts application. I fill out the form using selenium ide, export it to Java. The collected data by selenium does not get passed to the form to be processed by my ProcessRequest action. Here are part of the code I am running:

selenium.type("lastName_field", "Tester");
selenium.type("firstName_field", "Test");
...
...
selenium.open("/requests/ProcessRequest.do");
selenium.click("submit");
selenium.waitForPageToLoad("30000");

How do I pass it?

Thanks for your help.
Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
Most likely it should be in this order


Manon Baratt
Ranch Hand

Joined: Jan 30, 2006
Posts: 58
Thanks for your reply. Actually, the order I have is correct. First I fill out the form and then let the action process it.
Manon Baratt
Ranch Hand

Joined: Jan 30, 2006
Posts: 58
This is so weird. Selenium ide is not consistent. I reran the code, exported the result and it does not have the ProcessRequest line and it works fine without it. In one attempt, it did put it before entering the data in the fields.
Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
I personalty would not rely on record-playback feature
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: selenium, testng, eclipse processing a form