[wtr-general] Re: Object no longer attached to the DOM error on doing a exists call
Nice. Alister's blog post seemed to tell differently. Jarmo On Aug 14, 3:15 pm, Jari Bakken jari.bak...@gmail.com wrote: It is enabled by default. Den 14. aug. 2011 kl. 10:44 skrev Jarmo Pertman jarm...@gmail.com:i I'd even vote this to be enabled by default :) Jarmo On Aug 14, 7:45 am, Alister Scott alister.sc...@gmail.com wrote: This has been released. Thanks to Jari. See an article about how to use it here:http://watirmelon.com/2011/08/14/telling-watir-webdriver-to-always-lo... -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Post form not on the page
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: htmlhead meta http-equiv=content-type content=text/html; charset=ISO-8859-1 /headbodyform 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 dkro...@gmail.com 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 thatform /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 read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/**group/watir-generalhttp://groups.google.com/group/watir-general watir-general+unsubscribe@**googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Regards, Rahul Sharma Ph:+44 7800 736851 -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Post form not on the page
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 rahulsharma@gmail.com 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: htmlhead meta http-equiv=content-type content=text/html; charset=ISO-8859-1 /headbodyform 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 dkro...@gmail.com 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 thatform /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. watir-general@googlegroups.com http://groups.google.com/**group/watir-generalhttp://groups.google.com/group/watir-general watir-general+unsubscribe@**googlegroups.comwatir-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. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Post form not on the page
On 8/15/11 3:57 PM, 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 Sharmarahulsharma@gmail.com 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: htmlhead meta http-equiv=content-type content=text/html; charset=ISO-8859-1 /headbodyform 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? Rahul, this looks quite simple and it should work. Try the orde's suggestion above. -- DK AIM: DKroot1, Skype: DKroot -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Post form not on the page
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!! 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 rahulsharma@gmail.com 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: htmlhead meta http-equiv=content-type content=text/html; charset=ISO-8859-1 /headbodyform 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 dkro...@gmail.com 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 thatform /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. watir-general@googlegroups.com http://groups.google.com/**group/watir-generalhttp://groups.google.com/group/watir-general watir-general+unsubscribe@**googlegroups.comwatir-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. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com Regards, Rahul Sharma -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] How do I select the second identical table?
I'm somewhat stumped trying to select the second table out of multiple identical tables on the page in Watir 2.0.1. It should be simple, right? In Watir-WebDriver: carts = @browser.*tables*(:xpath = table_xpath(carts))[1] # works carts = @browser.*table*(:xpath = table_xpath(carts), :index = 1) # works as well In Watir: carts = @browser.*tables*(:xpath = table_xpath(carts)) # Watir::Exception::MissingWayOfFindingObjectException: xpath is an unknown way of finding a Table element carts = @browser.*table*(:xpath = table_xpath(carts), :index = 1) # Selects the first table regardless of the index passed. I have an impression that it is ignored because carts = @browser.*table*(:xpath = table_xpath(carts), :index = 2) selects the same table. One solution I could think of so far is to add index into the XPath expression itself. Another is to introduce table ids into the source application. Both are somewhat hairy. -- DK AIM: DKroot1, Skype: DKroot -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Post form not on the page
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 Sharmarahulsharma@gmail.com 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: htmlhead meta http-equiv=content-type content=text/html; charset=ISO-8859-1 /headbodyform 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 Korobskiydkro...@gmail.com 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 thatform /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. watir-general@googlegroups.com http://groups.google.com/**group/watir-generalhttp://groups.google.com/group/watir-general watir-general+unsubscribe@**googlegroups.comwatir-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. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com Regards, Rahul Sharma -- DK AIM: DKroot1, Skype: DKroot -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] [Watir-Webdriver] Carriage Returns
I have a text area that allows the user to copy and past from a file values that are separated by a carriage return like this: a b c In watir, this code worked: b.text_field(:id, x).set(a b c) But when i tried this in web-driver it doesn't anymore. It enters text but the values are no longer separated by a carriage return. I've tried everything in this posthttps://groups.google.com/d/topic/watir-general/SONhM3BnJD4/discussion. And I can't use send_keys because the text area doesn't allow the user to use up, down, or enter/return. Does anyone have any ideas? -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com