Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

selenium, testng, eclipse processing a form

 
Manon Baratt
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 470
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most likely it should be in this order


 
Manon Baratt
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 470
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I personalty would not rely on record-playback feature
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic