[wtr-general] Re: click on html element
So it is not possible to access using something like brow.element(:id,xxx) or brow.object(:id,xxx) or something similar. The only way is to know before hand what kind of tag we'll be accessing. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: undefined method `element_by_xpath' for #Watir::IE:0x2bbabf0 (NoMethodError)
how in the world would I know what URL you need to use? it's your app not mine. And you've never shared the URL with us. I'm good, but I'm not a mindreader You can attach using either the URL of the page the window is currently displaying or the Title of the page For URL look at the 'address' area of your browser. For title you can look at the titlebar of the browser window, looking at the source HTML, or via using something like firebug or the IE developer Toolbar. Note with title, omit anything like - Internet explorer provided by... which you might see when looking at the titlebar, just match on the part before that. On Aug 17, 8:35 am, goutham mandadi goutham.mand...@gmail.com wrote: Hi Chuck, yeah you are right when logging in to application it is displayed as https and then at home page it is normal http. is their any specific url i need to give in how can u please give me an example Thanks, Goutham On Tue, Aug 17, 2010 at 8:39 PM, Chuck van der Linden sqa...@gmail.comwrote: The most likely explanation when you see 'undefined method' (and you haven't mispelled the method or something like that) is that the browser object is no longer pointing at an instance of a web browser. That can happen in IE when the security context of the site changes (e.g. the browser starts up in 'internet' but you are working with a 'trusted site'. it's almost like IE starts a fresh browser instance and discards the old one, on the fly. Try using something like browser = Watir::IE.attach(:how, what) (how usually being either title or url) to ensure you are pointing at an instance a browser session, immediately before the step that is failing. On Aug 16, 10:07 pm, goutham mandadi goutham.mandad...@gmail.com wrote: Hai, can any one please help me on how to resolve this Thanks, Mandadi -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@goog legroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
[wtr-general] Regression in watir
Iam new to watir and would like to maintain regression tests. If one can suggest me to create a batch file or any tool that cn be referred? Thanks Nix -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: undefined method `element_by_xpath' for #Watir::IE:0x2bbabf0 (NoMethodError)
Mandadi, You need to share the code you are using, and if html is required to demonstrate an error, preferably a minimal snippet of html (do not paste several thousand lines of html into your email as some people have done). see the guidelines: http://wiki.openqa.org/display/WTR/Support On Wed, Aug 18, 2010 at 11:19, Chuck van der Linden sqa...@gmail.comwrote: how in the world would I know what URL you need to use? it's your app not mine. And you've never shared the URL with us. I'm good, but I'm not a mindreader You can attach using either the URL of the page the window is currently displaying or the Title of the page For URL look at the 'address' area of your browser. For title you can look at the titlebar of the browser window, looking at the source HTML, or via using something like firebug or the IE developer Toolbar. Note with title, omit anything like - Internet explorer provided by... which you might see when looking at the titlebar, just match on the part before that. On Aug 17, 8:35 am, goutham mandadi goutham.mand...@gmail.com wrote: Hi Chuck, yeah you are right when logging in to application it is displayed as https and then at home page it is normal http. is their any specific url i need to give in how can u please give me an example Thanks, Goutham On Tue, Aug 17, 2010 at 8:39 PM, Chuck van der Linden sqa...@gmail.com wrote: The most likely explanation when you see 'undefined method' (and you haven't mispelled the method or something like that) is that the browser object is no longer pointing at an instance of a web browser. That can happen in IE when the security context of the site changes (e.g. the browser starts up in 'internet' but you are working with a 'trusted site'. it's almost like IE starts a fresh browser instance and discards the old one, on the fly. Try using something like browser = Watir::IE.attach(:how, what)(how usually being either title or url) to ensure you are pointing at an instance a browser session, immediately before the step that is failing. On Aug 16, 10:07 pm, goutham mandadi goutham.mandad...@gmail.com wrote: Hai, can any one please help me on how to resolve this Thanks, Mandadi -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com watir-general%2bunsubscr...@goog legroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Does anybody have experience to run ruby watir script in a cgi script?
Hi, Bill, I found the problem, I first put runner on G:\Documents and Settings\Administrator\My Documents\runner I saw some errors ruby G:\Documents and ., Could not access G:\Documnets and ... Wed Aug 18 12:19:54 -0400 2010: Read error: #Errno::ECONNABORTED: An establishe d connection was aborted by the software in your host machine. Then I put runner on G:\runner It works fine now. Thanks! Jennifer On Mon, Aug 16, 2010 at 9:50 PM, Bill Agee billa...@gmail.com wrote: Hi, After you launched your script via the runner app, did it seem to execute successfully? (I'm assuming you used the google test suite that's displayed on the main page of the app after it's started...) Or did the script you attempted to launch not run? The behavior you saw is normal if a test suite takes a long time to complete - the viewconsole page (the one with the header Console output:) will refresh itself every 2 seconds while a test is running. But if a test suite finishes and the viewconsole page keeps refreshing, it's probably because the script being launched does not use Test::Unit. The viewconsole page waits for one of the result lines seen in Test::Unit's output to appear in the output...but if that line is never seen then the refresh will recur until the browser is closed. I wrote that part a really long time ago when depending on Test::Unit seemed like a reasonable idea. :) In hindsight the app should simply stop refreshing the viewconsole page as soon as the script completes. Thanks Bill On Mon, Aug 16, 2010 at 2:48 PM, WatirJoy chengfeng...@gmail.com wrote: Hi, Charles and other Watir experts, When I tried to execute a few line of ruby watir scripts in a cgi script, the page keep waiting, then timeout. Anyway, you mentioned rails app wiki:http://wiki.openqa.org/display/WTR/Rails+test+runner +example+app is what I am looking for. I followed the steps mentioned in the web page: 1)On the client that will run the tests, install rails with 'gem install rails' 2)Download runner.zip from the link below, and extract it in any dir on the client. 3)Start a cmd.exe shell and cd into the extracted 'runner' dir. 4)Launch the app with the command ruby script/server 5)From either the local or a remote machine, open a browser and access http://HOST:3000 http://host:3000/ (where HOST is your machine's address) 6)Attempt to run the google test suite. (Note: Watir must be installed for the google suite to work.) But no console output, web server looked like keep looping: Processing RunnerController#viewconsole (for 127.0.0.1 at 2010-08-16 17:39:56) POST] Parameters: {authenticity_token=D9j5PjYTwpBxKU4CyVQH/ cHn14FVGl8Vak9BIjs8j g=} Rendering runner/viewconsole Completed in 0ms (View: 0 | 200 OK [http://localhost/runner/ viewconsole] sole] Processing RunnerController#viewconsole (for 127.0.0.1 at 2010-08-16 17:39:58) POST] Parameters: {authenticity_token=D9j5PjYTwpBxKU4CyVQH/ cHn14FVGl8Vak9BIjs8j g=} Rendering runner/viewconsole Completed in 0ms (View: 0 | 200 OK [http://localhost/runner/ viewconsole] sole] Processing RunnerController#viewconsole (for 127.0.0.1 at 2010-08-16 17:40:00) POST] Parameters: {authenticity_token=D9j5PjYTwpBxKU4CyVQH/ cHn14FVGl8Vak9BIjs8j g=} Rendering runner/viewconsole Completed in 0ms (View: 0 | 200 OK [http://localhost/runner/ viewconsole] sole] Processing RunnerController#viewconsole (for 127.0.0.1 at 2010-08-16 17:40:02) POST] Parameters: {authenticity_token=D9j5PjYTwpBxKU4CyVQH/ cHn14FVGl8Vak9BIjs8j g=} Rendering runner/viewconsole Completed in 0ms (View: 0 | 200 OK [http://localhost/runner/ viewconsole] sole] Did I miss something? Thanks! On Aug 13, 4:11 pm, Charley Baker charley.ba...@gmail.com wrote: I don't have experience doing that with cgi. And you definitely want to back up a few steps and give us more information. Honestly, I wouldn't do that, there's a rails app that's a good start on the Watir wiki: http://wiki.openqa.org/display/WTR/Rails+test+runner+example+app If you want continuous integration then there are multiple pages and refs out there for that. Hopefully that app will give you a starting point, though I've not used it, people can chime in. My only guess is you want to do something like that? Again given your email it's hard to tell what you're looking for and what if any errors you're experiencing. hth, Charley Baker Lead Developer, Watir,http://watir.com On Fri, Aug 13, 2010 at 1:15 PM, WatirJoy chengfeng...@gmail.com wrote: Hi, I tried to execute a few line of ruby watir scripts in a cgi script: #!/ruby/bin/ruby -w require 'cgi' require 'stringio' require 'rubygems' require 'mysql' require 'watir' require 'time' cgi = CGI.new serverIpValue = cgi.params['serverIp'][0] mailIpValue = cgi.params['mailIp'][0] mediaDrive = cgi.params['mediaDrive'][0]
Re: [wtr-general] Re: unable to find element using xpath
I don't think that you should be using element_by_xpath at all. It does not return a Watir::Element. You should use a normal element accessor with the :xpath specifier: ie.area(:xpath, //whatever/).click On Wed, Aug 18, 2010 at 13:18, goutham mandadi goutham.mand...@gmail.comwrote: Hai charley, I ahev installed from gems C:\ruby\lib\ruby\gems\1.8\gems in this path i am having commonwatir-1.6.5 and firewatir-1.6.5 and watir-1.6.5 folders when i run from this path i am getting th following error one.rb:7: undefined method `click' for nil:NilClass (NoMethodError) require 'watir' ie = Watir::IE.start(http://www.snapfish.com/login;) ie.text_field(:name, emailaddress).set(goutham.mand...@valuelabs.net) ie.text_field(:name, password).set(sfqatest) ie.button(:name, log in).click ie.element_by_xpath(//ar...@href='www5.snapfish.com/snapfish/youraccount' ]).click waht might be the reason for this anyone help me Thankyou, Goutham this is code i am using On Tue, Aug 17, 2010 at 10:52 PM, Charley Baker charley.ba...@gmail.comwrote: Shouldn't be in site_ruby, that's gotta be version 1.4.1 with the Watir installer. Uninstall that and make sure you're reinstall the Watir gem, worst case wipe the ruby directory and install the latest Watir gem, should be 1.6.5 and run from the gem directory, not site_ruby. Charley Baker Lead Developer, Watir, http://watir.com On Tue, Aug 17, 2010 at 11:08 AM, goutham mandadi goutham.mand...@gmail.com wrote: Hai, c:/ruby/lib/ruby/site_ruby/1.8/watir.rb this is path from which it is executing here in watir.rb i couldnot find method element_by_xpath how to add this thanks, goutham On Tue, Aug 17, 2010 at 9:08 PM, goutham mandadi goutham.mand...@gmail.com wrote: Hi eric, I did not get you what are orb and .flash i am new to watir Thanks, Goutham On Tue, Aug 17, 2010 at 8:58 PM, Eric Mathiesen mathiese...@gmail.com wrote: You could also use orb and .flash the index. On Aug 17, 2010 8:23 AM, goutham mandadi goutham.mand...@gmail.com wrote: Hai Chuck, Thanks for ur reply we can add id or name for this element but why is element by xpath is not working for me can u help me on this Thankyou, Goutham On Tue, Aug 17, 2010 at 8:48 PM, Chuck van der Linden sqa...@gmail.com wrote: As an alternativ... -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
[wtr-general] Select an element when :id and :class are not completely known
In the jQuery world, it isn't uncommon for me to dynamically add classes to an element. Depending on various circumstances, the class of a div might be something like amount or amount required or amount required invalid. In my particular situation, the problem is compounded by the fact that my id is partially made up of a random number, so I can't simply do div(:id,amount). What I do know is the first chunk of the id (e.g. it always starts with amount_). I also know that the class will always contain amount, though it may also contain additional classes. An example: div id=amount_1239783 class=required amount invalid.../div 1. I've tried to do @ff.div(:class,amount) but it only works if they other classes haven't been added 2. I know I can do @ff.div(:class,required amount invalid) but sometimes the classes get added in a different order (and some classes don't get added every time, so maintaining all the possible combinations is ridiculous) 3. I know I can do each through the divs looking to see if the class contains the given value, or the id starts with amount, but that seems excessive Does anyone know if there is a simple way to do this? -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Select an element when :id and :class are not completely known
When I run into this I use :index, # On Aug 18, 2010 2:52 PM, jasbro jas...@gmail.com wrote: In the jQuery world, it isn't uncommon for me to dynamically add classes to an element. Depending on various circumstances, the class of a div might be something like amount or amount required or amount required invalid. In my particular situation, the problem is compounded by the fact that my id is partially made up of a random number, so I can't simply do div(:id,amount). What I do know is the first chunk of the id (e.g. it always starts with amount_). I also know that the class will always contain amount, though it may also contain additional classes. An example: div id=amount_1239783 class=required amount invalid.../div 1. I've tried to do @ff.div(:class,amount) but it only works if they other classes haven't been added 2. I know I can do @ff.div(:class,required amount invalid) but sometimes the classes get added in a different order (and some classes don't get added every time, so maintaining all the possible combinations is ridiculous) 3. I know I can do each through the divs looking to see if the class contains the given value, or the id starts with amount, but that seems excessive Does anyone know if there is a simple way to do this? -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Select an element when :id and :class are not completely known
After I posted this question, I started thinking that the best solution would be if I could use a regular expression to select the element: @browser.div(:id,/^amount_.*/) or @browser.div(:class,/.*amount.*/) So I tried it, and it worked for both Firefox and IE. This may just be a benefit of using Ruby, or it may have been intentional (I don't know...I'm a Java guy) but I'm really glad it worked. Hope anyone else who comes across this question finds this useful. On Aug 18, 2:40 pm, jasbro jas...@gmail.com wrote: In the jQuery world, it isn't uncommon for me to dynamically add classes to an element. Depending on various circumstances, the class of a div might be something like amount or amount required or amount required invalid. In my particular situation, the problem is compounded by the fact that my id is partially made up of a random number, so I can't simply do div(:id,amount). What I do know is the first chunk of the id (e.g. it always starts with amount_). I also know that the class will always contain amount, though it may also contain additional classes. An example: div id=amount_1239783 class=required amount invalid.../div 1. I've tried to do @ff.div(:class,amount) but it only works if they other classes haven't been added 2. I know I can do @ff.div(:class,required amount invalid) but sometimes the classes get added in a different order (and some classes don't get added every time, so maintaining all the possible combinations is ridiculous) 3. I know I can do each through the divs looking to see if the class contains the given value, or the id starts with amount, but that seems excessive Does anyone know if there is a simple way to do this? -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com