On 8/15/11 6:11 PM, Rahul Sharma wrote:
I have tried it already but won't work as the form is not on the page. So 
browser won't know what form it is!!
Two questions:

1. Why can't you drive the original application itself? (no local form)

If there are some serious reasons for not being able to do that, then

2. What happens exactly if you save this artificial form locally, then drive the browser to file:///my_local_form.html and do browser.form(:name, "input").submit ?
On 15 Aug 2011, at 20:57, orde wrote:

Does this work (from http://rdoc.info/gems/watir/2.0.1/Watir/Form)?

browser.form(:name, "input").submit

Hope it helps.

orde


On Aug 15, 7:48 am, Rahul Sharma<[email protected]>  wrote:
Hi Dimitry,

The reason I wanted to submit a local form is that I can not simulate user
clicks as part of the tests. The form in the question is:

<html><head>  <meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">  </head><body><form name="input" action="
test-environment-url/promotion-code.promotion-codecheck" method="post">

promotions code:<input name="promotions_code" value="PromotionName" type="
text">  <input value="Submit" type="submit">  </form>  </body></html>

Mind the formatting. This is the source of the form I want to post. For some
reason I can not click on the Submit button to post it in the test. Is there
another way?
On 12 August 2011 21:20, Dmitriy Korobskiy<[email protected]>  wrote:









On 8/6/11 1:33 PM, Rahul Sharma wrote:
Thanks for the information there Dimitry and Chuck. I forgot to add one
thing in my post. The form I am talking about is a form that has been
created by a developer to assist automated testing. In real world, users of
our website will see a promotion somewhere(let's say google). When one
clicks on that advertisement it will bring the user to our website with the
promotion code filled in and letting the users fill the rest of the form to
be able to register and claim the promotion. So the form here is a HTML page
written by a developer so that when I click on the button in the form it
will do the same thing as in the real world when a customer clicks on a
promotion on Google. I actually don;t have the HTML of the form handy but I
can paste it on Monday when I get back to work. So basically my question was
to whether I can define that<form>   </form>   in my Page and use it with the
page object to post it and give me the website page filled with the
promotion code just like the user would do actually.
  Rahul,
Getting back to your original question of submitting a local form, why do
you need to that? Do you really need to manipulate the form in a non-trivial
way?
If you don't, Watir can drive the browser to reproduce user clicks and
filling the text on the form quite well without extra complications.
--
DK
AIM: DKroot1, Skype: DKroot
--
Before posting, please readhttp://watir.com/support. In short: search
before you ask, be nice.
[email protected]
http://groups.google.com/**group/watir-general<http://groups.google.com/group/watir-general>
watir-general+unsubscribe@**googlegroups.com<watir-general%2Bunsubscribe@go 
oglegroups.com>
--
Regards,

Rahul Sharma
Ph:+44 7800 736851
--
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]
Regards,
Rahul Sharma



--
DK
AIM: DKroot1, Skype: DKroot

--
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

Reply via email to