One thing i don't understand is that if you view source, it renders it as <input type="image"> but using it as button works? Why would that be the case?
Following is how it renders in Firefox 1.5
<h4>Step 3: Check out</h4>and in IE 7 beta as well:
<p style="width: 350px;">
Review your order and submit payment information.
</p>
<br >
<input name="template:ib_GetStarted" id= "template_ib_GetStarted" src="../../../../_img/button/subs/getstarted.gif" alt= "Get Started" border="0" type="image">
<h4>Step 3: Check out</h4>
<p style="width:350px;">
Review your order and submit payment information.
</p>
<br />
<input type="image" name="template:ib_GetStarted" id="template_ib_GetStarted" src="" alt="Get Started" border="0" />
And you are right on the money that recorder is not perfect, actually far from it. But it does help in recording the path and after doing that i can easily add more code for asserts, logging and what not manually.
On 2/24/06, Bret Pettichord <[EMAIL PROTECTED]> wrote:
The "image" on the page is actually a button. The recorder that you used to create the script has a bug, which you should report back to the creator of the recorder.
Also there is a ton of crap in this script, also presumably generated by the recorder. For example, i can see no reason to have successive calls to ie.goto in a script. The extra crud in the script appears to have confused the discussion of this problem.
The following script works for me (note that i trimmed your script and changed the final call from ie.imageto ie.button):
require 'watir'
include Watir
require 'test/unit'
class TC_recorded < Test::Unit::TestCase
def test_recorded
ie = IE.new
ie.goto(' http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx')
ie.button(:name, 'template:ib_GetStarted').click
end
end
If you still are having problems please send us a short bit of code that you think should work ( i.e. not something that you don't understand that was generated by a recorder).
This is not the correct forum to look for help in debugging other peoples recorders. You will need to contact them directly for help.
BretOn 2/22/06, saud aziz < [EMAIL PROTECTED]> wrote:Hi guys,_______________________________________________
When i try to run the following script, it just hangs and never clicks through the respective image buttons on site. Can someone run and tell me if it works for them? Or how i could possibly modify it to make it run? Another thing noticeable is that when you run this from command prompt, it sometimes doesn't even display the buttons that you are supposed to click on at all. So for instance on page ' http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx' you might not find button that says get started and you can make it appear only if you press refresh/reload for browser.
I am running latest version of Watir and Ruby available to General Public. Any help is much appreciated.
require 'watir'
include Watir
require 'test/unit'
class TC_recorded < Test::Unit::TestCase
def test_recorded
ie = IE.new
ie.goto('https://www.seattlesymphony.org/' )
#ie.link(:url, ' http://www.seattlesymphony.org/symphony/buy/subs/').click
#ie.goto('_javascript_:bakeCookie()')
#ie.button(:alt, 'New Subscription').click
ie.goto(' http://www.seattlesymphony.org/symphony/buy/subs/newsub/index.aspx')
ie.image(:name, 'template:ib_GetStarted').click
ie.goto(' http://www.seattlesymphony.org/symphony/buy/subs/newsub/package.aspx?id=1')
ie.goto(' http://www.seattlesymphony.org/symphony/buy/subs/newsub/detail.aspx?id=150' )
ie.button(:alt, 'Select This Series').click
ie.radio(:name, 'Section','73').set()
ie.button(:alt, 'Add This Series To My Cart').click
ie.button(:alt, 'Browse Series').click
ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2' )
ie.goto(' http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx')
ie.goto(' http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=3' )
ie.link(:url, 'http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/categories.aspx').click
ie.goto('http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/package.aspx?id=2' )
ie.goto(' http://www.seattlesymphony.org/symphony/buy/subs/newsub/alt/detail.aspx?id=176')
ie.button(:alt, 'Select This Series').click
ie.radio(:name, 'Section','62').set()
ie.button(:alt, 'Add This Series To My Cart').click
ie.button(:alt, 'Continue To Next Step').click
end
end
Any help is much appreciated. obviously it is not even complete script, but if you can get past 'ie.button(:alt, 'Select This Series').click' this step, then it would be great to know. For me it just hangs and does nothing, no errors, nada.
--
Saud Aziz
"Whenever you find yourself on the side of the majority, it is time to pause and reflect." - Mark Twain
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
--
Saud Aziz
"Whenever you find yourself on the side of the majority, it is time to pause and reflect." - Mark Twain
_______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general
