[wtr-general] Re: Watir -Ajax Application working in IE6 but not in IE7
Actually, the application is automated in Watir .. Since it has multiple frames, Watir recognises all the frames only in IE 6, but says Cannot recognise the frame in IE7. We r using Watir 1.5 and Ruby 1.3 We initially tried working the application in IE6 (Windows XP) and it worked fine. But according to the requirement of the team , we need to do the automation in Vista machine which has IE 7 only in its package. Any idea, why IE6 works whereas IE7 doesnt recognises the frames. Regards, Amudha --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Watir -Ajax Application working in IE6 but not in IE7
We r using Watir 1.5 and Ruby 1.3 Can you update in the newest version and have a try? On Oct 12, 3:06 pm, Amudha Priya amudha.bu...@gmail.com wrote: Actually, the application is automated in Watir .. Since it has multiple frames, Watir recognises all the frames only in IE 6, but says Cannot recognise the frame in IE7. We r using Watir 1.5 and Ruby 1.3 We initially tried working the application in IE6 (Windows XP) and it worked fine. But according to the requirement of the team , we need to do the automation in Vista machine which has IE 7 only in its package. Any idea, why IE6 works whereas IE7 doesnt recognises the frames. Regards, Amudha --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] spam
We had two spam e-mails on the list in the last few days. Is it Google Groups fault or did somebody of the moderators approve them by mistake? Subjects were: wholesale and retail HOGAN | Nike shoes | Puma | Men's clothing T-shirt Cheap sell nike,adidas,AFI,max,Jordan,bape,Timberland, sandal etc I have reported them as spam at Google Groups, banned senders from the group and removed the e-mails from the group web site. Željko -- http://watirpodcast.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Get X and Y Coordinates of an Object
Hi Is it possible to get X and Y co-ordinates of an object using Watir and FireWatir? Please let me know. Thanks, Pallavi. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Unable to create a new IE instance
Hi ALl, I am using below package. Watir version - 1.6.2 Ruby version - 1.8.6 I am using below code for log-in in batch running. require 'watir/ie' require 'watir/testcase' require 'watir/cookiemanager' require 'watir\contrib\enabled_popup' require 'watir/winClicker' require 'time' require 'win32/clipboard' include Win32 Watir::CookieManager::WatirHelper.deleteSpecialFolderContents (Watir::CookieManager::WatirHelper::COOKIES) Watir::CookieManager::WatirHelper.deleteSpecialFolderContents (Watir::CookieManager::WatirHelper::INTERNET_CACHE) $url = http://iic66/icomettest/iCometTest13/Login.aspx; $corp_id = admin $corp_password = admin def page_login(user_id, password) @ie = Watir::IE.new @ie.goto $url @ie.maximize @ie.bring_to_front @ie.text_field(:id,txtUserName).set user_id @ie.text_field(:id,txtPassword).set password @ie.button(:id,btnSubmit).click end class Test1 Watir::TestCase def test_a page_login($corp_id, $corp_password) # Some validation codes end end since its a batch running, this function creates more than 60 IE instances in the test and i didn't face any issues. Last week i updated my IE version from 6 to 7 and ran the script again. But that function struggled in many times and didn't created some IE instances and threw below error. But the same code worked good in IE 6, but it failed in IE 7. It failed 5 times out of 62 new IE instances. Error: test_b(Test92): WIN32OLERuntimeError: failed to create WIN32OLE object from `InternetExplorer.Application' HRESULT error code:0x80004005 Unspecified error c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 167:in `initialize' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 167:in `new' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 167:in `create_browser_window' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 91:in `_new_window_init' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 87:in `initialize' StoresSpares_Masters.RB:196:in `new' StoresSpares_Masters.RB:196:in `page_login' StoresSpares_Masters.RB:424:in `test_b' So friends please take a look on my code, if any error in my code please correct it. If any workaround or some other ways are there please post it. Thanks, Prince3105 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Watir -Ajax Application working in IE6 but not in IE7
On Mon, Oct 12, 2009 at 9:06 AM, Amudha Priya amudha.bu...@gmail.com wrote: but says Cannot recognise the frame in IE7. Did you read this? http://wiki.openqa.org/display/WTR/Frames Željko --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Watir -Ajax Application working in IE6 but not in IE7
Hi, As suggested, we tried all the options in the given link, but no success. http://wiki.openqa.org/display/WTR/Frames 1 ) IE.goto We couldnt access the frame straight away. We ' ll hav to cross the all pages from the Login to the destiny. 2) Tried truting the Site 3) It requires High security.. By default it changes to Medium even after we tried putting it to Low. Hope there would be soln. Thanks for ur help Regards, Amudha --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Wiki cleanup: blogs
I have moved the most of the content of wiki blogs page to watir.com/blogs. I did not move `Feeds` section of the page, because I do not find it very useful. If you think I am wrong, please let me know. I plan to delete Blogs (http://wiki.openqa.org/display/WTR/Blogs) and Blog Feeds (http://wiki.openqa.org/display/WTR/Blog+Feeds) page from the wiki in the next few days. I did not move any content from Blogs Feeds wiki page because I think feeds can easily be found. Please take a look and let me know if anything should be fixed, if you have a blog and you write a lot about Watir, but you are not on the list, if you thing a blog should be removed from the list... Željko -- http://watirpodcast.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] How to use the watir inputs the special character?
Deal All, I try to use the watir to input some special character in the text_field,but failure. Such as, I want to fill Bjørvik in the text_field. In window: the ? will instead ø. In Mac: I use the SafariWatir, the application will stop when input the Bj,and get the following error: irb(main):023:0 sf.text_field(:id,user_id).set(Bjørvik) TypeError: Not valid UTF8 data: \nfunction dispatchOnChange(element) {\n var event = document.createEvent('HTMLEvents');\n event.initEvent ('change', true, true); \n element.dispatchEvent(event);\n}\n (function() {\n var element = document.getElementById('user_id');\nif (element) {\n element.value += '\303';\ndispatchOnChange(element); \nelement.setSelectionRange(element.value.length, element.value.length);\n} else {\n return '__safari_watir_element_unfound__';\n}\n})() from /usr/local/lib/ruby/gems/1.8/gems/rb-appscript-0.5.1/lib/_aem/ codecs.rb:199:in `pack' from /usr/local/lib/ruby/gems/1.8/gems/rb-appscript-0.5.1/lib/ appscript.rb:182:in `pack' from /usr/local/lib/ruby/gems/1.8/gems/rb-appscript-0.5.1/lib/_aem/ send.rb:157:in `initialize' from /usr/local/lib/ruby/gems/1.8/gems/rb-appscript-0.5.1/lib/_aem/ send.rb:157:in `each' from /usr/local/lib/ruby/gems/1.8/gems/rb-appscript-0.5.1/lib/_aem/ send.rb:157:in `initialize' from /usr/local/lib/ruby/gems/1.8/gems/rb-appscript-0.5.1/lib/aem.rb: 224:in `new' from /usr/local/lib/ruby/gems/1.8/gems/rb-appscript-0.5.1/lib/aem.rb: 224:in `event' from /usr/local/lib/ruby/gems/1.8/gems/rb-appscript-0.5.1/lib/ appscript.rb:508:in `_send_command' from /usr/local/lib/ruby/gems/1.8/gems/rb-appscript-0.5.1/lib/ appscript.rb:642:in `method_missing' from /usr/local/lib/ruby/gems/1.8/gems/safariwatir-0.3.3/./ safariwatir/scripter.rb:561:in `eval_js' from /usr/local/lib/ruby/gems/1.8/gems/safariwatir-0.3.3/./ safariwatir/scripter.rb:491:in `execute' from /usr/local/lib/ruby/gems/1.8/gems/safariwatir-0.3.3/./ safariwatir/scripter.rb:246:in `append_text_input' from /usr/local/lib/ruby/gems/1.8/gems/safariwatir-0.3.3/./ safariwatir.rb:378:in `set' from /usr/local/lib/ruby/gems/1.8/gems/safariwatir-0.3.3/./ safariwatir.rb:377:in `times' from /usr/local/lib/ruby/gems/1.8/gems/safariwatir-0.3.3/./ safariwatir.rb:377:in `set' from /usr/local/lib/ruby/gems/1.8/g ems/safariwatir-0.3.3/./safariwatir/scripter.rb:167:in `instance_eval' from /usr/local/lib/ruby/gems/1.8/gems/safariwatir-0.3.3/./ safariwatir/scripter.rb:167:in `highlight' from /usr/local/lib/ruby/gems/1.8/gems/safariwatir-0.3.3/./ safariwatir.rb:375:in `set' from (irb):23 So what should I do when input the special character? Many thanks! -Zhong --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: How to use the watir inputs the special character?
On Mon, Oct 12, 2009 at 12:28 PM, yuping zhong littlezhong...@gmail.com wrote: In window: the ? will instead ø. Try the new build, maybe it is fixed: http://wiki.openqa.org/display/WTR/Development+Builds Željko -- http://watirpodcast.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Watir 1.6.5.rc1 - release candidate available for testing
- all examples at Windows 2003 Server machine 1) clean Watir 1.6.5 - uninstall Ruby - install ruby186-26.exehttp://rubyforge.org/frs/download.php/29263/ruby186-26.exe - update rubygems - install watir-1.6.5.rc1.gem - everything is fine 2) clean Watir 1.6.2 - uninstall Ruby - install ruby186-26.exehttp://rubyforge.org/frs/download.php/29263/ruby186-26.exe - update rubygems - install Watir 1.6.2 - everything is fine 3) upgrade Watir from 1.6.2 to 1.6.5. - machine with Watir 1.6.2 (from the second example) - install watir-1.6.5.rc1.gem gem install watir --no-rdoc --no-ri Successfully installed commonwatir-1.6.5.rc1 Successfully installed nokogiri-1.3.3-x86-mswin32 Successfully installed watir-1.6.5.rc1 3 gems installed - firewatir 1.6.5. was not installed - sample IRB session irb(main):001:0 require watir = true irb(main):002:0 puts Watir::IE::VERSION LoadError: no such file to load -- watir/ie from (irb):2 irb(main):003:0 b = Watir::IE.new NameError: uninitialized constant Watir::IE from (irb):3 irb(main):004:0 b = Watir::Browser.new LoadError: (eval):1:in `klass': no such file to load -- firewatir from c:/ruby/lib/ruby/gems/1.8/gems/commonwatir-1.6.5.rc1/lib/watir/browser.rb:89:in `klass' from c:/ruby/lib/ruby/gems/1.8/gems/commonwatir-1.6.5.rc1/lib/watir/browser.rb:65:in `eval' from c:/ruby/lib/ruby/gems/1.8/gems/commonwatir-1.6.5.rc1/lib/watir/browser.rb:89:in `klass' from c:/ruby/lib/ruby/gems/1.8/gems/commonwatir-1.6.5.rc1/lib/watir/browser.rb:65:in `new' from (irb):4 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Watir 1.6.5.rc1 - release candidate available for testing
The upgrade works fine if I first uninstall 1.6.2 versions of watir, firewatir and commonwatir, and then install 1.6.5. Željko --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Html Elements Supported by Watir
I just wanted to say thanks to everybody that said a few nice words about me. That was one of the best presents I got for my birthday this year. :) Željko --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Html Elements Supported by Watir
On Thu, Oct 8, 2009 at 7:18 AM, Bret Pettichord bpettich...@gmail.com wrote: I think we should treat comments just like the other information on the page. If they seem irrelevant or confusing, they should be deleted. If they make suggestions which have been addressed, they should be deleted. I do this sometimes myself. Good point. I will do that from now on. Željko --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Watir 1.6.5.rc1 - release candidate available for testing
If you get this: gem update --system Updating RubyGems Nothing to update gem -v 1.2.0 you should read this: http://stackoverflow.com/questions/566614/how-can-i-force-gem-to-upgrade-to-gem-1-3-1 http://soft-dev-pro.blogspot.com/2009/07/update-rubygems.html Probably the easiest way to update rubygems 1.2.0 is to reinstall ruby and then update rubygems. Željko --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Watir 1.6.5.rc1 - release candidate available for testing
We have a fix for this and it will be included in RC2. Željko Filipin wrote: 3) upgrade Watir from 1.6.2 to 1.6.5. - machine with Watir 1.6.2 (from the second example) - install watir-1.6.5.rc1.gem gem install watir --no-rdoc --no-ri Successfully installed commonwatir-1.6.5.rc1 Successfully installed nokogiri-1.3.3-x86-mswin32 Successfully installed watir-1.6.5.rc1 3 gems installed - firewatir 1.6.5. was not installed - sample IRB session irb(main):001:0 require watir = true irb(main):002:0 puts Watir::IE::VERSION LoadError: no such file to load -- watir/ie from (irb):2 irb(main):003:0 b = Watir::IE.new NameError: uninitialized constant Watir::IE from (irb):3 irb(main):004:0 b = Watir::Browser.new LoadError: (eval):1:in `klass': no such file to load -- firewatir from c:/ruby/lib/ruby/gems/1.8/gems/commonwatir-1.6.5.rc1/lib/watir/browser.rb:89:in `klass' from c:/ruby/lib/ruby/gems/1.8/gems/commonwatir-1.6.5.rc1/lib/watir/browser.rb:65:in `eval' from c:/ruby/lib/ruby/gems/1.8/gems/commonwatir-1.6.5.rc1/lib/watir/browser.rb:89:in `klass' from c:/ruby/lib/ruby/gems/1.8/gems/commonwatir-1.6.5.rc1/lib/watir/browser.rb:65:in `new' from (irb):4 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Unable to create a new IE instance
60 IE instances is a lot. My first guess would be that IE7 uses more memory that IE6 and that therefore you can't create as many instances of it. You might consider getting more RAM to fix your problem. Bret Prince3105 wrote: Hi ALl, I am using below package. Watir version - 1.6.2 Ruby version - 1.8.6 I am using below code for log-in in batch running. require 'watir/ie' require 'watir/testcase' require 'watir/cookiemanager' require 'watir\contrib\enabled_popup' require 'watir/winClicker' require 'time' require 'win32/clipboard' include Win32 Watir::CookieManager::WatirHelper.deleteSpecialFolderContents (Watir::CookieManager::WatirHelper::COOKIES) Watir::CookieManager::WatirHelper.deleteSpecialFolderContents (Watir::CookieManager::WatirHelper::INTERNET_CACHE) $url = http://iic66/icomettest/iCometTest13/Login.aspx; $corp_id = admin $corp_password = admin def page_login(user_id, password) @ie = Watir::IE.new @ie.goto $url @ie.maximize @ie.bring_to_front @ie.text_field(:id,txtUserName).set user_id @ie.text_field(:id,txtPassword).set password @ie.button(:id,btnSubmit).click end class Test1 Watir::TestCase def test_a page_login($corp_id, $corp_password) # Some validation codes end end since its a batch running, this function creates more than 60 IE instances in the test and i didn't face any issues. Last week i updated my IE version from 6 to 7 and ran the script again. But that function struggled in many times and didn't created some IE instances and threw below error. But the same code worked good in IE 6, but it failed in IE 7. It failed 5 times out of 62 new IE instances. Error: test_b(Test92): WIN32OLERuntimeError: failed to create WIN32OLE object from `InternetExplorer.Application' HRESULT error code:0x80004005 Unspecified error c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 167:in `initialize' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 167:in `new' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 167:in `create_browser_window' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 91:in `_new_window_init' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 87:in `initialize' StoresSpares_Masters.RB:196:in `new' StoresSpares_Masters.RB:196:in `page_login' StoresSpares_Masters.RB:424:in `test_b' So friends please take a look on my code, if any error in my code please correct it. If any workaround or some other ways are there please post it. Thanks, Prince3105 -- Bret Pettichord Lead Developer, Watir, www.watir.com Blog, www.io.com/~wazmo/blog Twitter, www.twitter.com/bpettichord --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Get X and Y Coordinates of an Object
Pallavi - Here is how to do it with IE: http://wiki.openqa.org/display/WTR/Right+Click+an+Element http://wiki.openqa.org/display/WTR/Right+Click+an+ElementI don't know how to do this in FireWatir although I'm sure there is a way. Anyone know how to do this in FF? Alan On Mon, Oct 12, 2009 at 4:00 AM, Pallavi Sharma write2pall...@gmail.comwrote: Hi Is it possible to get X and Y co-ordinates of an object using Watir and FireWatir? Please let me know. Thanks, Pallavi. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Right Click and Element Script
Sorry, I missed this reply. You should not need those requires, the script works fine without them. If you have further issues, please send me the stacktrace of the error. Also, you may need to play with the offsets to get the mouse in the element space. Alan On Tue, Sep 29, 2009 at 11:24 PM, Pallavi Sharma write2pall...@gmail.comwrote: Hi Alan Thanks for the reply, i saw your post but until i made these require 'rubygems' require 'watir' require 'pp' require 'win32ole' require win32ole_pp require 'watir/WindowHelper' require statements i was getting the Name Error, which was over after i included them all. I don't know the reason. I am using watir 1.6.2 and ruby 1.86. What i will do today is let u know for which require statement it fails. Also, my query is i am not able to click on a Div tag calendar table which is openend by another div tag which was openend by link. Is it something to do with the Page_container ??? Where am i going wrong? Any help.. Thanks Pallavi. On Wed, Sep 30, 2009 at 8:28 AM, Alan Baird aba...@bairdsnet.net wrote: Pallavi - I've tested the code at http://wiki.openqa.org/display/WTR/Right+Click+an+Element a lot and I'm pretty sure it works. If you run the code that's in the box it should work. I would try that first. You should not have to do any additional requires to make it work (since win32api is required by watir). See if you can get this to work first. If you are still having issues after that, let me know. Alan On Tue, Sep 29, 2009 at 7:08 AM, Pallavi Sharma write2pall...@gmail.comwrote: Hi Ravee How do i change it?? Any clue? I dont know what it stands for...?? Thanks On Tue, Sep 29, 2009 at 5:11 PM, Raveendran P jazzezr...@gmail.comwrote: Hi Pallavi, May be the focus missing here. So please adjust the changes here and try it. (its not a exact solution but it may be help some times) # Windows API constants INPUT_MOUSE = 0 MOUSEEVENTF_LEFTDOWN = 0x0002 MOUSEEVENTF_LEFTUP = 0x0004 MOUSEEVENTF_RIGHTDOWN = 0x0008 MOUSEEVENTF_RIGHTUP = 0x0010 This code is available under Watir module (which was you pasted in first thread.) Thanks. On Tue, Sep 29, 2009 at 4:55 PM, Pallavi Sharma write2pall...@gmail.com wrote: Hey Ravee Its not working :( I have a scenario in which : 1. A link opens a Div tag on which a image open another div tag which contains a table. 2. Now, i have to click on a table cell to select my date 3. For the same i am using this function. 4. It open the calendar div but doesn't click on the table cell present inside the calendar div. The coordinates it returns for the cell are x=0,y=112 [doesn't work] The icon which opens the calendar, its coordinates are: x=503,y=499 [this one works] Is my page_container wrong or whats the issue? The screen shot is attached and i am trying to save the page but not able to. The code snippets are attached. Please help!! Thanks Pallavi On Tue, Sep 29, 2009 at 4:43 PM, Raveendran P jazzezr...@gmail.comwrote: Hi pallavi, Yes. Def it will work.. If not then pls paste ur html code here. Thanks P.Raveendran On Tue, Sep 29, 2009 at 4:10 PM, Pallavi Sharma write2pall...@gmail.com wrote: Hey Ravee Thanks a ton, maybe some one can update the stuff there at tha link, it will surely help. by the way: win32ole_pp throws an error so i removed it. One more thing i will be using this on a div containg table, and its table cell will it work?? Thanks Pallavi On Tue, Sep 29, 2009 at 3:58 PM, Raveendran P raveend...@railsfactory.org wrote: Hi pallavi, Pls add and try again May be try this all possibilities require 'rubygems' require 'watir' require 'pp' require 'win32ole' require win32ole_pp require 'watir/WindowHelper' Awaiting your reply... Thanks On Tue, Sep 29, 2009 at 3:17 PM, Pallavi Sharma write2pall...@gmail.com wrote: Hi All I am trying to work on the script: require 'watir' module Watir class Element def top_edge assert_exists assert_enabled ole_object.getBoundingClientRect.top.to_i end def top_edge_absolute top_edge + container.document.parentWindow.screenTop.to_i end def left_edge assert_exists assert_enabled ole_object.getBoundingClientRect.left.to_i end def left_edge_absolute left_edge + container.document.parentWindow.screenLeft.to_i end def right_click x = left_edge_absolute y = top_edge_absolute #puts x: #{x}, y: #{y} WindowsInput.move_mouse(x, y) WindowsInput.right_click end end end module WindowsInput # Windows API functions SetCursorPos = Win32API.new('user32','SetCursorPos', 'II', 'I') SendInput = Win32API.new('user32','SendInput', 'IPI', 'I') # Windows API constants INPUT_MOUSE = 0 MOUSEEVENTF_LEFTDOWN = 0x0002 MOUSEEVENTF_LEFTUP = 0x0004