On 8/16/11 5:21 AM, Rahul Sharma wrote:
On 15 August 2011 23:26, Dmitriy Korobskiy <[email protected]
<mailto:[email protected]>> wrote:
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)
Reason for not being able to drive the application is that the form is
not present on the application. It will be part of a clickable advert
outside the application.
Got it. It's a pretty solid reason. :)
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 ?
This should work I am pretty sure but the reason I do not want to save
this form locally and tun my tests is that the tests run on Hudson
build as well so I will have to maintain a copy on Hudson as well.
Plus I will have to incorporate this local form in my project some
where so that others can run this test on their machines as well.
Also, the path, if the form is saved locally might be different on
Hudson and local machine.
All I have in my project is feature files and ruby files. Would it be
alright to add html files in the project workspace?
Is there any other way out?
All the obstacles you mentioned are solvable. You can put the local form
somewhere along with the test-related files and get the absolute
location in your test code, e.g. in Ruby:
|File.dirname(|__FILE__)
||I would use a separate subdirectory for it.
In the worst case you can pass the absolute location from Hudson as an
environment variable (e.g. PROJECT_HOME=/somepath).
--
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]