[wtr-general] running watir scripts in batch mode
Hi All, I have been trying to run ruby scripts in batch mode, the thing i tried was putting scripts in .bat file and calling them one after other, This works fine but i wonder if could write a script in ruby to do so as ruby gives better option to handle exceptions and report them. One silly way i tried was using require command but what happens is as soon as the first script is done it throws c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- Contract_Search (MissingSourceFile) and exits what this error suggests is it cannot find the source file but if i comment the first one and run the script it works again only for the first script called. I wonder if there is a nicer way to do so Please suggest me .. Santosh Solpaurkar Software Engineer CGI Mumbai --~--~-~--~~~---~--~~ 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 attach to a page on makemytrip
Hi All, This doent seem to be frame or other issue at all, what i see this as there is a problem with the website itself. once we do the search for the international flights the web page doesnot completely load, as in eventhough it shows done it still keeps on downloading some thing probably javascript namely sort(5). To test this you can do a simple test. after the ie.image(:src, http://www.makemytrip.com/images/search-for-flights.gif;).click statement put a puts command to print some thing and run the script. this still hangs and doenot print any thing on console . require 'watir' ie=Watir::IE.new ie.speed=:fast ie.goto(www.makemytrip.com) ie.link(:href,http://www.makemytrip.com/international-flights/;).click ie.text_field(:id,departure_0).value=Delhi,India-Indira Gandhi Intl(DEL) ie.text_field(:id,arrival_0).value=Chicago,US-All airports-IL(CHI) ie.image(:src,http://www.makemytrip.com/images/search-for-flights.gif;).click #This works, after which IDE hangs puts the page has loaded # This never gets executed.. #ie.image(:src, http://cheapfaresindia.makemytrip.com/international/img/us/booknow.gif;).click #DOESNT GET EXECUTED I dont know how to resolve this but need to stop the java script from downloading . Hope we resolve this.. Cheers, Santosh On Mon, May 11, 2009 at 11:02 AM, Pallavi Sharma write2pall...@gmail.comwrote: Hi Everyone require 'watir' ie=Watir::IE.new ie.speed=:fast ie.goto(www.makemytrip.com) ie.link(:href,http://www.makemytrip.com/international-flights/;).click ie.text_field(:id,departure_0).value=Delhi,India-Indira Gandhi Intl(DEL) ie.text_field(:id,arrival_0).value=Chicago,US-All airports-IL(CHI) ie.image(:src,http://www.makemytrip.com/images/search-for-flights.gif;).click #This works, after which IDE hangs ie.image(:src, http://cheapfaresindia.makemytrip.com/international/img/us/booknow.gif;).click #DOESNT GET EXECUTED Thanks for the reply so far, but i just want to clear my understanding, The last step of the above script is not getting executed, the reason for it is because 'watir' is not able to access the frames on the page. But I have checked with IE Devloper tool bar there are no frames on the Search Result page, which you get after you execute the second last step of the script. I am sorry, if i am missing something out from the answers i have recieved sod far, but i am not able to understand why this above script is not getting executed. Meanwhile i have tried the above on 5 different machines, but it doesn't works. On Sun, May 10, 2009 at 6:14 AM, Vicky Goyal vikasrattango...@gmail.comwrote: @Pallavi As siva has mentioed, tht same defect is already open. If you are not able to see the frames of a link in command bar, you will not be able to access the objects in that link. not very sure, i guess this s because some latest patches might be missing from our personal desktops. As when i tried in my organization, infosys, same was wrking. Now what you can do is to access those links, you can use Firefox browser, that should not give any issues. siva has tried the script, though i am sturuggling right now to install the latest version for same. hope this helps regds Vicky Vikas Rattan Goyal Test Lead, Telecommunication Infosys Tech Ltd On May 9, 1:57 pm, sHiVa krapa.ph...@gmail.com wrote: I tried to print the frame set in a page using this code snippet and able to view frmaes require 'watir' ie=Watir::IE.start('http://www.quackit.com/html/templates/frames/ frames_example_3.html') puts ie.show_frames But when i tired to print the frames inwww.makemytrip.com, 'access denied' error is displayed. Might be the error is not due to security.There might be an another issue. I have seen a defect in zira regarding this. http://jira.openqa.org/browse/WTR-96 Regars Siva Phaneendra Krapa -- Santosh Solpaurkar Software Engineer CGI Mumbai --~--~-~--~~~---~--~~ 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 in JRuby?
Hi All, I also was looking for a way to call waiter api from JRuby as our web application has interface with Weblogic JMS server to send and receive XML files with legacy applications, and for which i had posted long back. JRuby did not work for me as i could not call Ruby Script (Watir API) from JRuby or vice versa, But we can easly write class in RJB Ruby Java Bridge which can be called from ruby or lets say Watir code. I really dont know what are the limitatios of RJB as compared to JRuby but this really worked for me. So juts to extend this discussion if we need to call some java code why not use RJB over JRuby. Cheers, Santosh On Tue, May 5, 2009 at 11:34 AM, Jared xflib...@gmail.com wrote: Thanks, I will take a look. I'm dreaming of being able to run Watir and set my browser to be :raw_http, or something like that though :) Jared http://www.quinert.com/blog/ On May 5, 2:02 pm, Manish Sapariya man...@gslab.com wrote: Check this out.http://github.com/langalex/culerity/tree/master It makes it possible to run watir test using celerity from C-Ruby. You need jRuby and Celerity though. Regards, Manish Jared wrote: I keep thinking I'd like to have access to a celerity-style driver when I'm running from normal Ruby for faster feedback...Is this on the radar? What would be required to get celerity to run under Ruby rather than JRuby? Jared You could run your tests throughCeleritywhich wraps HtmlUnit in a Watir API through JRuby Aidy- Hide quoted text - - Show quoted text - -- Santosh Solpaurkar Software Engineer CGI Mumbai --~--~-~--~~~---~--~~ 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] Using RJB to send XML file to Weblogic JMS
Hi Dudes, I had posted this topic but did not receive any response earlier, so here i go again. Well what i am trying to is send messages to Weblogic JMS Queue with ruby as i am attempting to automate web application which uses JMS as interface. I did see JRuby as option and was able to search some coding done on this also a whole bunch of Lib WMQ which is for websphere MQ.but as Jruby methods cannot be called in conventional ruby and needs some wrapper to be written (Seen posting on Jwatir) which leads to more of coading. Where as RJB doesnot have this issue we can call RJB code from conventional Ruby. So did i go with it and started putting some code which is messy right now. I am able to successfully connect to the weblogic JMS as this doesnot throw ConnectionException. But when trying to send message to Queue i am getting error `send': ##Class:0x2dcb660:0x2dc8adc is not a symbol (TypeError) from TestJms.rb:55 which i guess is because of the data type missmatch. But when i invove message.getText() then i get approprate data in XML file which does mean the message object has been set correct. I am not able to figure out what exactly is causing this. Below is spec of code that i have written. Please let me know if there is any way we can remove this error. ## require 'rjb' Rjb::load(C:/ruby/jms.jar;C:/ruby/weblogic.jar) Context = Rjb::import(javax.naming.Context) InitialContext = Rjb::import(javax.naming.InitialContext) MessageListener = Rjb::import(javax.jms.MessageListener) Hastbl = Rjb::import(java.util.Hashtable) NamingException=Rjb::import(javax.naming.NamingException) PortableObj=Rjb::import(javax.rmi.PortableRemoteObject) QueueConFac = Rjb::import(javax.jms.QueueConnectionFactory) QueueConn = Rjb::import(javax.jms.QueueConnection) Qsession= Rjb::import(javax.jms.QueueSession) Qsender = Rjb::import(javax.jms.QueueSender) Tpublisher = Rjb::import(javax.jms.TopicPublisher) Queues = Rjb::import(javax.jms.Queue) Tmsg = Rjb::import(javax.jms.TextMessage) Session = Rjb::import(javax.jms.Session) String1 = Rjb::import(java.lang.String) JNDI_FACTORY = weblogic.jndi.WLInitialContextFactory # Parameters JMS_FACTORY= ConnectionFactory; # e.g. weblogic.sandbox.connectionFactory QUEUE = ContractInbound;# e.g. weblogic.sandbox.topic URL = t3://10.233.0.123:8005/esmeim;# e.g. t3://192.168.249.128:7001 env = Hastbl.new() env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY); env.put(Context.PROVIDER_URL, URL); env.put(weblogic.jndi.createIntermediateContexts, true); ctx = InitialContext.new(env) puts ctx factory=ctx.lookup(JMS_FACTORY) puts factory @connection = factory.createQueueConnection() puts @connection @Qsession1 = @connection.createQueueSession(false, Qsession.AUTO_ACKNOWLEDGE) QueueSet = ctx.lookup(QUEUE) qsender = @Qsession1.createSender(QueueSet) puts @Qsession1 filename = Contract_The Guidance_Center_Inc_Cost_TC_22_C.xml @connection.start data = f = File.open(filename, r) f.each_line do |line| data += line end msg = String1.new() msg = data message = @Qsession1.createTextMessage() message.setText(msg) puts message.getText() qsender.send(message) @connection.close ## Santosh Solpaurkar Software Engineer CGI Mumbai --~--~-~--~~~---~--~~ 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] has any one worked on using Jruby to send XML to Weblogic JMS
Hi All, Lot of web applications use Java Message service and to transfer records between web server and database use Websphere or Weblogic MQ, JMS liberary allows to do so. Does any one has experience of automating the entire process. I did find some information on JMS in book .Practical.JRuby.on.Rails.Web.2.0.Projects. but i am not able to get ahead as the example shown is too complex to understand. Does any one has a simple example to send XML to JMS Topic. Santosh Solapurkar Software Engineer --~--~-~--~~~---~--~~ 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: Using Watir to test AS400 mainframe AND testing strategy
What kind of terminal eimulator you are using, most of these Emulators support api/ehhlapi to interface with VB or other language for scription. Once you know that you can implement same functions in Ruby which will make your too free of cost... I had done same for our mainframe like emulator which is non standard 5250 or 3270 emulators. One of terminal emulator i know which has scripting is intelleterm http://www.distinct.com/intelliterm/intelliterm.htm which u can intregate with word excel for reporting purpose On Mon, Feb 9, 2009 at 12:08 PM, Bill Agee billa...@gmail.com wrote: 2. We also test a variety of browser based software this is currently done via QTP therefore strategically any move I would contemplate would demand that so far as is possible all testing should be on a single platform with a single scripting language. I think the single scripting language requirement you have may exclude this suggestion, but you might want to check out Expect - it's free and is available for Windows: http://expect.nist.gov/ http://en.wikipedia.org/wiki/Expect But since Expect scripts must be written in Tcl, and Expect cannot test Windows GUI apps, it may not work in your situation. A couple of Expect workalikes written for Ruby, Perl, and Python (and maybe more?) exist, but the Ruby version (Rexpect) does not function on Windows last I checked. Not sure about the Perl and Python libraries. Thanks Bill -- Santosh Solpaurkar Software Engineer CGI Mumbai --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---