[wtr-general] watir/testcase in WATIR 3
Hi All, I have been working on WATIR 2.0.4 since last 6 months and now as WATIR is updated to 3, I cant find watir/testcase in the commonwatir folder. Seems as if watir/testcase has not been included in the latest WATIR version. Can any one help me out of this. And is their any way to by which I can use my existing gem libraries, into some other system instead of installing it from them using gem install Thanks Regards, Manav Gupta Bangalore -- 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: watir webdriver and javascript drop down menu in IE
On Tue, Apr 24, 2012 at 11:53 PM, mndude ibo...@gmail.com wrote: Since watir-webdriver is essentially wrapping the Selenium webdriver is there a way I can access the Action Builder as shown in that hover class mentioned in the link? You should be able to do something like this to get access to the webdriver browser.wd http://rubydoc.info/gems/watir-webdriver/Watir/Element#wd-instance_method Željko -- watir.com/book - author -- 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: Getting Hash value instead of actual link from email.
On Wed, Apr 25, 2012 at 5:13 AM, Bhavesh bhavesh1_sha...@yahoo.com wrote: Only thing if someone can help is, i got the email body but as same time i want to mark that email as read instead of unread, so that next time when i have another new email, i get content from that new email and previous all emails are in read state. I guess Chuck is trying to tell you that Watir automates browsers, and you want to automate Outlook. It does not matter if you are using Watir to send mail, you have to use another tool to read mail. Are you aware that you are not using Watir to drive Outlook? (You are using Ruby.) I have done a lot of mail sending/reading/parsing and I would highly suggest that you use another tool (like mail gem) for that, instead of automating Outlook. If you have questions on how to do that, I would be glad to help. Željko -- watir.com/book - author -- 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: Getting Hash value instead of actual link from email.
Hi Zeljko, Thanks. You are always helpful. I think you are on vacation Yesterday, otherwise i could have done it yesterday. I tried doing the stuff using mail gem, but it didn't worked [Reason is : im not much aware of this gem]. I posted query on ruby mail forum too, but no replies to solve my problem. If i use mail gem, then when i try to access new unread email, it fails, it always returns first mail whether it is read or unread. Here is what i posted on mail forum : ## Hi, I added following code in my WATIR script, and abel to get first email from my Inbox require 'mail' require 'openssl' Mail.defaults do retriever_method :pop3, :address= email.someemail.com, :port = 995, :user_name = 'domain/username', :password = 'pwd', :enable_ssl = true end puts Mail.first I am new to this forum and have following questions : 1. How can I get all the unread emails ? 2. How can I get all links that are present inside emails? or mail message body from the email? 3. Can I click Links present inside an email? [This i can do once i have an link] 4. How can I get emails from a specific folder, if I have subfolders? If some one can help me, then that will be nice. Thanks in advance. Bhavesh ### The webpage for mail gem states that if you use mail.first, it will return first unread email, so oi did that. When i have not received any input/help here, i thought i can use Autoit, to get it working from outlook. With autoit, still im struggling to mark mail as read from unread once i get details [mail body] from the mail. And if i use mail gem, then in that case, im totally stuck. If you can help me on mail gem, with questions i posted, then it will be very helpfull. Also if you tell me how to mark mail as read from unread when i use mail gem. thanks Bhavesh On Apr 25, 12:31 am, Željko Filipin zeljko.fili...@gmail.com wrote: On Wed, Apr 25, 2012 at 5:13 AM, Bhavesh bhavesh1_sha...@yahoo.com wrote: Only thing if someone can help is, i got the email body but as same time i want to mark that email as read instead of unread, so that next time when i have another new email, i get content from that new email and previous all emails are in read state. I guess Chuck is trying to tell you that Watir automates browsers, and you want to automate Outlook. It does not matter if you are using Watir to send mail, you have to use another tool to read mail. Are you aware that you are not using Watir to drive Outlook? (You are using Ruby.) I have done a lot of mail sending/reading/parsing and I would highly suggest that you use another tool (like mail gem) for that, instead of automating Outlook. If you have questions on how to do that, I would be glad to help. Željko -- watir.com/book - author -- 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: Getting Hash value instead of actual link from email.
Comments are inline. On Wed, Apr 25, 2012 at 5:57 PM, Bhavesh bhavesh1_sha...@yahoo.com wrote: I think you are on vacation Yesterday, otherwise i could have done it yesterday. Not on vacation, just really busy. :) If i use mail gem, then when i try to access new unread email, it fails, it always returns first mail whether it is read or unread. As far as I remember, when you get mail via POP3 (as you are doing) there is no way to mark an e-mail message as read. You can just download it and delete it. You should use IMAP if you want to mark message as read. 1. How can I get all the unread emails ? Looks like this should do it: Mail.all More info: http://rubydoc.info/gems/mail/Mail/IMAP http://rubydoc.info/gems/mail/Mail/POP3 2. How can I get all links that are present inside emails? I do not think mail gem provides that functionality. or mail message body from the email? mail.body.decoded More info: https://github.com/mikel/mail 3. Can I click Links present inside an email? [This i can do once i have an link] No, but you can save a link in a variable and than open the page with Watir. You have to understand that mail gem and watir gem are really focused. Mail gem just reads, sends and receives mail, does not know anything about browsers or links. Watir gem just drives browsers, does not know anything about e-mail. 4. How can I get emails from a specific folder, if I have subfolders? Do you want to access e-mail messages on a server, or on your local machine? Željko -- 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: Getting Hash value instead of actual link from email.
Thanks . I will write the code around and get it working. For subfolders, actually inside Inbox, there are sub folder where specific mails are getting collected based on the policy/rules. That is the reason i need to get the mails from subfolder, but let me try it out. thanks bhavesh On Apr 25, 9:15 am, Željko Filipin zeljko.fili...@gmail.com wrote: Comments are inline. On Wed, Apr 25, 2012 at 5:57 PM, Bhavesh bhavesh1_sha...@yahoo.com wrote: I think you are on vacation Yesterday, otherwise i could have done it yesterday. Not on vacation, just really busy. :) If i use mail gem, then when i try to access new unread email, it fails, it always returns first mail whether it is read or unread. As far as I remember, when you get mail via POP3 (as you are doing) there is no way to mark an e-mail message as read. You can just download it and delete it. You should use IMAP if you want to mark message as read. 1. How can I get all the unread emails ? Looks like this should do it: Mail.all More info: http://rubydoc.info/gems/mail/Mail/IMAPhttp://rubydoc.info/gems/mail/Mail/POP3 2. How can I get all links that are present inside emails? I do not think mail gem provides that functionality. or mail message body from the email? mail.body.decoded More info: https://github.com/mikel/mail 3. Can I click Links present inside an email? [This i can do once i have an link] No, but you can save a link in a variable and than open the page with Watir. You have to understand that mail gem and watir gem are really focused. Mail gem just reads, sends and receives mail, does not know anything about browsers or links. Watir gem just drives browsers, does not know anything about e-mail. 4. How can I get emails from a specific folder, if I have subfolders? Do you want to access e-mail messages on a server, or on your local machine? Željko -- 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: Getting Hash value instead of actual link from email.
On Wed, Apr 25, 2012 at 6:39 PM, Bhavesh bhavesh1_sha...@yahoo.com wrote: For subfolders, actually inside Inbox, there are sub folder where specific mails are getting collected based on the policy/rules. Are you using Gmail? Željko -- 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: Getting Hash value instead of actual link from email.
On Tuesday, April 24, 2012 4:31:14 PM UTC-7, Bhavesh wrote: Hi chuck, You are still not getting me. Im am using Watir, and an webapplicaiton. From my application, i can send notification. Once notification is received in Outlook Inbox, i have to get the links in that emails. I automated using Watir till i can send the notification on an web application. I have written code to get emails also from the Outlook in watir script [which i have pasted in last thread]. Thanks for providing that detail, if you had started out saying something to that effect then what you were trying to do would have been a lot clearer, instead of just presenting us with some code that has nothing to do with watir and no context to how this relates to work you are doing in watir. That little bit of background, a single sentence such as I am generating an email via automating a web app with watir, but now I need to validate the content of the resulting mail, especially links within the mail body would have greatly helped people to understand the overall nature of the problem. Then you could go into the fact you are getting a hash value and not the link and does anyone know how you would get the link, or iterate the hashes to get the info you need. Still, and as Zeljko has explained also, this is really not the forum for help with automating outlook or pop3 mail access. I now understand you are using watir to send the mail, but your challenge at this point, how to receive and verify the mail contents, has little to do with watir unless you were using something like OWA, Gmail or another web interface to an email system to handle the mail. I would strongly suggest moving this to StackOverflow, and putting some appropriate tags on the question. You can post a link to it here so anyone else with a similar problem (or time to assist you) can follow over to it. You are far more likely to find more folks with experience dealing with email via ruby, and get some good answers to your question (and the code can be properly formatted, questions edited and updated as well as answers). You can also post a link to the question on the google group that deals with the mail gem. I really think that might be a better way for you to get this issue resolved. At the very least you are far more likely to find people with experience doing that kind of coding, than asking the question here in the Watir group since at this point your challenge is not really with watir. -- 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: Getting Hash value instead of actual link from email.
On Wed, Apr 25, 2012 at 7:13 PM, Bhavesh bhavesh1_sha...@yahoo.com wrote: By the way zeljko, im still not able to get the unread emails if i use Mail.all, mail.first or mail.,last. You will have to provide more information. I am monitoring mail gem list so feel free to post there. Željko -- 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: Getting Hash value instead of actual link from email.
OK, i will update my query with more details in that forum. On Apr 25, 10:17 am, Željko Filipin zeljko.fili...@gmail.com wrote: On Wed, Apr 25, 2012 at 7:13 PM, Bhavesh bhavesh1_sha...@yahoo.com wrote: By the way zeljko, im still not able to get the unread emails if i use Mail.all, mail.first or mail.,last. You will have to provide more information. I am monitoring mail gem list so feel free to post there. Željko -- 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 and extjs = split button click problem
I have a split button that when clicked in the middle or left side will perform a default action on that page. But if clicked on the right side it will drop down a menu to select from a set of actions. I can't get Watir webdriver to click and drop down the menu. It only is able to click and perform the default action in the page. There is a similar item at http://dev.sencha.com/deploy/ext-4.1.0-gpl/examples/kitchensink/index.html#basic-toolbar Try the Menu Button drop down The html of my button is somewhat similar to the link above and I'm having the same problem getting Watir webdriver to click on the right side and drop down the menu: td class=x-btn-mc em id=ext-gen49 class=x-btn-split unselectable=on style=background-color: transparent; button id=ext-gen22 class= x-btn-text type=buttonAdd/button /em /td Is there a way to get Watir webdriver to click somewhere besides the middle of an object? I wonder if I could click a few pixels to the right of center if the menu would appear. -- 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] using .parent to click in UI.
Hi, I have an Table inside which there are entries for folders. I need to select specific folder, but because it is an EXTJS development, all the folders have same div id, spanid, image id etc. Here is the code snippet. # TABLE id=resultTable style=BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px cellSpacing=0 cellPadding=1 TBODY TR TD align=rightSPAN onmouseover=return overlib('Choose what type of repository to show in left data repository list'); onmouseout=nd();Show SELECT id=filter style=BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; WIDTH: 100px; BORDER-BOTTOM: 0px onchange=repsSelected_addSourceRepository.filter() name=filterOPTION value=All selectedAll/OPTIONOPTION value=SOURCEONEARCHIVESOURCEONEARCHIVE/OPTION/SELECT /SPANSPAN onmouseover=return overlib('Update the left hand list of repositories'); onmouseout=nd();INPUT class=refresh-true id=refreshButton onclick=repsSelected_addSourceRepository.refresh() type=button /SPAN/TD TD/TD TD/TD TD/TD TD/TD/TR TR TD align=right DIV class=dir-tree-div id=treeView style=TEXT-ALIGN: left DIV class=x-panel x-tree id=ext-comp-1077 style=WIDTH: 400px DIV class=x-panel-bwrap id=ext-gen946 DIV class=x-panel-body x-panel-body-noheader id=ext-gen947 style=OVERFLOW: auto; WIDTH: 400px; HEIGHT: 300px UL class=x-tree-root-ct x-tree-lines id=ext-gen948 DIV class=x-tree-root-node LI class=x-tree-node DIV class=x-tree-node-el x-unselectable x-tree-node-expanded unselectable=on ext:tree-node-id=/Repositories/ES1SPAN class=x- tree-node-indent/SPANIMG class=x-tree-ec-icon x-tree-elbow-end- minus src=https://vm-bhaveshok1/images/c.gif;IMG class=x-tree- node-icon sourceonearchive-icon src=https://vm-bhaveshok1/images/ c.gif unselectable=onA class=x-tree-node-anchor hideFocus tabIndex=1 href=https://vm-bhaveshok1/legal/dashboard.htm#;SPAN unselectable=on ext:qtip=Registered repositories that may added to the right listingES1/SPAN/A/DIV UL class=x-tree-node-ct id=ext-gen1269 style=LEFT: auto; VISIBILITY: visible; POSITION: static; TOP: auto LI class=x-tree-node DIV class=x-tree-node-el x-unselectable x-tree-node-collapsed unselectable=on ext:tree-node-id=/Repositories/ES1/bugfixSPAN class=x-tree-node-indentIMG class=x-tree-icon src=https://vm- bhaveshok1/images/c.gif/SPANIMG class=x-tree-ec-icon x-tree- elbow-plus src=https://vm-bhaveshok1/images/c.gif;IMG class=x-tree- node-icon src=https://vm-bhaveshok1/images/c.gif; unselectable=onA class=x-tree-node-anchor hideFocus tabIndex=1 href=https://vm-bhaveshok1/legal/dashboard.htm#;SPAN unselectable=on ext:qtip=Registered repositories that may added to the right listingbugfix/SPAN/A/DIV UL class=x-tree-node-ct style=DISPLAY: none/UL/LI LI class=x-tree-node DIV class=x-tree-node-el x-unselectable x-tree-node-collapsed unselectable=on ext:tree-node-id=/Repositories/ES1/f_tSPAN class=x-tree-node-indentIMG class=x-tree-icon src=https://vm- bhaveshok1/images/c.gif/SPANIMG class=x-tree-ec-icon x-tree- elbow-plus src=https://vm-bhaveshok1/images/c.gif;IMG class=x-tree- node-icon src=https://vm-bhaveshok1/images/c.gif; unselectable=onA class=x-tree-node-anchor hideFocus tabIndex=1 href=https://vm-bhaveshok1/legal/dashboard.htm#;SPAN unselectable=on ext:qtip=Registered repositories that may added to the right listingf_t/SPAN/A/DIV UL class=x-tree-node-ct style=DISPLAY: none/UL/LI So i have to select folder by name f_T Only thing that i can use is : $ie.span(:text, f_t).click. This works fine. Now my requirement is to click on the image that is appearing just before this folder. Since all the folders have same image, it is very difficult to click on the image that is appearing before to this folder f_t. I tried using : $ie.span(:text,f_t).parent.link(:class, x-tree-node- anchor).parent.div(:class, x-tree-node-el x-unselectable x-tree-node- collapsed).image(:class,x-tree-ec-icon x-tree-elbow-end-plus).click But it fails with error that class x-tree-node-anchor not found. So how can i click on this image which is appearing before the folder f_t. Can some one help me with this? Bhavesh -- 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: Watir 3 Released!
Great, thanks for all the hard work! Regards, Zhimin Zhan -- testwisely.com - Watir IDE -- 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: Getting Hash value instead of actual link from email.
No..im not using gmail. im using my own corporate emial account. I already posted the query for this on : http://groups.google.com/group/mail-ruby Bhavesh On Apr 25, 10:26 am, Bhavesh bhavesh1_sha...@yahoo.com wrote: OK, i will update my query with more details in that forum. On Apr 25, 10:17 am, Željko Filipin zeljko.fili...@gmail.com wrote: On Wed, Apr 25, 2012 at 7:13 PM, Bhavesh bhavesh1_sha...@yahoo.com wrote: By the way zeljko, im still not able to get the unread emails if i use Mail.all, mail.first or mail.,last. You will have to provide more information. I am monitoring mail gem list so feel free to post there. Željko -- 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] Need help in Invoking multiple IE's
Hi, I have watir installed. Im starting 1 IE sesion afor my webapplication and soing some stuff. At the same time in paralle, i need to invoke 1 more IE. do some stuff there. Once done close this IE and attach to the previous IE. Will it be possible? Code snippet : # def test $ie = Watir::IE.new() $ie.goto($someLink) some porcessijg here Now open another IE $ie1 = Watir::IE.new() $ie1.goto($someaddress) some more processing on this new IE $ie1.close $ie.attach(/previous IE/) $ie.close end ### But this fails, it opens first IE, but then nothing being done. so it is possible to automate such scenarios? Thanks Bhavesh -- 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: watir webdriver and javascript drop down menu in IE
OK, I was able to implement now using browser.wd. Important to note that the elements need to be found with browser.wd.find_element() before trying to put them into browser.action.click( menu ).click( submenu ).perform. Only problem is that my original code doesn't work for the very first sub menu item in 3 of the 7 top drop down menus I have to work with. :( It is like WebDriver just isn't getting quite the right thing clicked. On one menu the first item from the next menu is clicked instead, other two just don't get clicked at all. I think it may be a timing issue, but I don't know how to slow down the process of the Selenium Action Manager. I've verified that I've located the correct link in the submenus... Thanks for the help, guys! I'll have to work around this some other way. -- 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: watir webdriver and javascript drop down menu in IE
Oh that is in IE that the problems persist. All of the menus work OK in Firefox and Chrome using browser.wd. On Wednesday, April 25, 2012 9:51:41 PM UTC-5, mndude wrote: OK, I was able to implement now using browser.wd. Important to note that the elements need to be found with browser.wd.find_element() before trying to put them into browser.action.click( menu ).click( submenu ).perform. Only problem is that my original code doesn't work for the very first sub menu item in 3 of the 7 top drop down menus I have to work with. :( It is like WebDriver just isn't getting quite the right thing clicked. On one menu the first item from the next menu is clicked instead, other two just don't get clicked at all. I think it may be a timing issue, but I don't know how to slow down the process of the Selenium Action Manager. I've verified that I've located the correct link in the submenus... Thanks for the help, guys! I'll have to work around this some other way. -- 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