[wtr-general] undefined method `element_by_xpath' for # (NoMethodError)

2010-08-16 Thread goutham mandadi
Hai,

can any one please help me on how to resolve this

Thanks,
Mandadi

-- 
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] unable to find element using xpath

2010-08-16 Thread goutham mandadi
Hai Angrez,

can u please help me on this i have seen ur post  regarding this but i am
unable to understand

Thanks,
Goutham

On Mon, Aug 16, 2010 at 10:02 PM, goutham mandadi  wrote:

> Hi,
>
> I am getting the following error message ,i am using IE8 browser
>
> one.rb:6: undefined method `element_by_xpath' for #
> (NoMethodError)
>
> can anyone help me out
>
> Thanks in advance,
> Goutham
>
> On Mon, Aug 16, 2010 at 4:23 PM, goutham mandadi <
> goutham.mand...@gmail.com> wrote:
>
>> Hai Angrez,
>>
>>  I have seen the example and tried to acces the element but when it comes
>> to that step ruby interpreter is closing. How can i know whether xpath is
>> working for me or not i have ruby along with rexml and i could not see the
>> error message in ruby interpreter as it is closing. Please help me out
>> waiting for your suggestions
>>
>> Thanks,
>> Goutham
>>
>>
>> On Mon, Aug 16, 2010 at 2:07 PM, Angrez Singh  wrote:
>>
>>> Hi Goutham,
>>>
>>> Please check the unit test cases for Watir you'll find example on how to
>>> access map/area element using XPath. It should be there in [ruby
>>> installation directory]\gems\1.8\firewatir-1.6.5\unittests.
>>>
>>> Thanks,
>>> Angrez
>>>
>>>   On Mon, Aug 16, 2010 at 9:09 AM, goutham mandadi <
>>> goutham.mand...@gmail.com> wrote:
>>>
  hai basim,

 below is the code
 >>>
 http://www.snapfish.com/snapfish/selectalbumreprints/"; title=" 
 Order prints " coords="9,53,113,72">





 

 
 how can we identify these elements by using xpath


 On Mon, Aug 16, 2010 at 12:20 AM, Basim Baassiri wrote:

> Hi Goutham
> You'll need to post some code and some html to illustrate better your
> problem
>
>
> On Sun, Aug 15, 2010 at 11:22 AM, goutham 
> wrote:
>
>> hai all,
>>
>> i am using element_by_xpath to find an element in watir but browser is
>> closing when i come to xpath step. does we need to install anything to
>> find element using xpath . waiting for ur suggestions
>>
>> Thankyou,
>> Goutham
>>
>> --
>> 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
>>
>
> --
> 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
>

 --
   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

>>>
>>> --
>>> 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
>>>
>>
>>
>

-- 
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: Unable to see error message in ruby interpreter

2010-08-16 Thread goutham mandadi
Hi ,

I am using xpath to identify the following element but it is displaying
error

one.rb:6: undefined method `element_by_xpath' for #
(NoMethodError)
ie.element_by_xpath("//area[@
href='www.snapfish.com/snapfish/youraccount']").click
this is the element i am trying to find using xpath

does xpath is supported by IE or not can anyone help me on this

Thanks,
Goutham


On Mon, Aug 16, 2010 at 11:44 PM, Eric Mathiesen wrote:

> My first piece of advice would be not to use x-path, but any of the other
> items to identify ( ID, Name, URL, Etc...)
>
> Cheers,
> Eric
>
>
> On Mon, Aug 16, 2010 at 10:59 AM, Charley Baker 
> wrote:
>
>> Not sure on that one, check the unittests for watir. I've created and
>> built out a test base of over 10k tests, not using xpath. Others are more
>> qualified to answer.
>>
>>
>> Charley Baker
>> Lead Developer, Watir, http://watir.com
>>
>>
>> On Mon, Aug 16, 2010 at 11:31 AM, goutham mandadi <
>> goutham.mand...@gmail.com> wrote:
>>
>>> Hi Charley,
>>>
>>> Thanks alot it is working fine now and one more issue is while using
>>> xpath i am getting the following error
>>>
>>> one.rb:6: undefined method `element_by_xpath' for #
>>> (NoMethodError)
>>> ie.element_by_xpath("//ar...@href='
>>> www.snapfish.com/snapfish/youraccount']").click
>>> this is the element i am trying to find using xpath
>>>
>>> Thanks,
>>> Goutham
>>>
>>> On Mon, HiAug 16, 2010 at 10:07 PM, Charley Baker <
>>> charley.ba...@gmail.com> wrote:
>>>
 Name the file with no spaces, something like my_ruby_program.rb.
 Filenames are conventionally snake cased - lower case with underscores.

 Charley Baker
 Lead Developer, Watir, http://watir.com


   On Mon, Aug 16, 2010 at 10:04 AM, goutham mandadi <
 goutham.mand...@gmail.com> wrote:

>   Hai Adam,
>
> Thanks for your reply i have installed scite and run the script it is
> giving the following message
>
> >ruby New Ruby Program.rb
> ruby: No such file or directory -- New (LoadError)
> >Exit code: 1
> the script is in my desktop should we place it in any specific
> directory to execute
>
> Thanks,
> Goutham
>
>On Mon, Aug 16, 2010 at 9:24 PM, Adam Reed wrote:
>
>> Hi Goutham,
>>
>> It sounds like you're double-clicking the script in order to run it
>> which closes the DOS window upon completion.
>>
>> If installed, you can execute the script using the SciTE editor.
>> Right click on the script, select Edit.  The output pane can be
>> enabled using F8 if it is not shown.
>>
>> Alternatively, you can open a DOS prompt and browse to the location of
>> the script you would like to run.  Execute the script from the command
>> line, and the DOS window will not close.
>>
>> Good luck,
>> Adam
>>
>> On Aug 16, 10:46 am, goutham  wrote:
>> > Hi all,
>> >
>> > I am new to watir ,I am trying to find element using xpath but i
>> could
>> > not and one more issue is that i couldnot see the error message what
>> > it is returning as ruby interpreter is getting closed how to see the
>> > error messages returned during execution
>> >
>> > Thankyou,
>> > Goutham
>>
>> --
>> 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
>>
>
> --
> 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
>

 --
  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

>>>
>>>  --
>>> 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
>>>
>>
>>  --
>> 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.

Re: [wtr-general] Re: Does anybody have experience to run ruby watir script in a cgi script?

2010-08-16 Thread Bill Agee
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  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
> (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  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 
> 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]
> > > retension=cgi.params['retension'][0]
> >
> > > puts "Content-type: text/html"
> > > puts ""
> > > puts ""
> > > puts "serverIpValue:#{serverIpValue}"
> > > puts "mailIpValue:#{mailIpValue}"
> > > puts "mediaDrive:#{mediaDrive}"
> > > puts "retension:#{retension}"
> > > puts "Start initial system state check and system
> > > configuration..."
> > >begin_time=Time.now
> > >ie = Watir::IE.new
> > >ie.go

Re: [wtr-general] Re: How to select a item from the dropbox

2010-08-16 Thread Pallavi Sharma
Hi Sudhir

Chuck is right in here stating the same, i am just trying here to identify
hat after you login you get frames in your application, just make sure if
your select list is in a frame you give the right object identification, and
another thing, if the select list is identified as an object than like Chuck
stated, there must be an event which has to be fired so that you are able to
select the element in the list, if just .select is not working.


require 'watir'
begin

test_site = 'http://newpmr2prod.jpmorgan.com/PM/PMlogin.do'
 b = Watir::Browser.new
 b.goto(test_site)
 b.text_field(:name, "userID").set("sudhikumar")
 b.text_field(:name, "password").set("jpm")
 b.form(:action, "/PM/PMlogin.do").submit
 b.show_frames
 b.frame(:name, "menuMiddle").link(:text, "Performance").click
 if b.select_list(:name, 'level0').exists? then
  puts "true"
   b.select_list(:name, 'level0').select ("00990")
 end
rescue Exception => ex
 puts ex.message
end


Whats your out put in here? Is it possible to give a session like using team
viewer or web ex, to see whats happening in there... if not allowed to
access the site?


Regards
Pallavi.

On Tue, Aug 17, 2010 at 4:37 AM, Chuck van der Linden wrote:

> It doesn't make any sense that a change later in the script would
> cause a problem with logging in, unless perhaps you had not logged out
> the prior user, it was the same browser session, and an active session
> still existed?, or there were cookies or some other means by which an
> active session was persisted?   For tests like this I'd always make
> sure the user is logged out, before you try to run the script.
>
> The selection list looks pretty much like a normal select list other
> than having a javascript onchange event in there.  So I'd try
> addressing it like a normal selection list, but I'd also after
> using .select  to pick an option by name, I'd add a command to fire
> the onchange method on the select_list element, which should give the
> javascript a chance to do it's stuff.
>
> On Aug 16, 6:04 am, sudhir  wrote:
> > require 'watir'
> > begin
> >  test_site = 'http://newpmr2prod.jpmorgan.com/PM/PMlogin.do'
> >  b = Watir::Browser.new
> >
> >  b.goto(test_site)
> >  b.text_field(:name, "userID").set("sudhikumar")
> >  b.text_field(:name, "password").set("jpm")
> >  b.form(:action, "/PM/PMlogin.do").submit
> >  #b.show_frames()
> >  b.frame(:name, "menuMiddle").link(:text, "Performance").click
> >  #b.select_list(:name, 'level0').select ("00990")
> >  rescue Exception => ex
> >
> >  end
> > => false
> > => 2.172
> > irb(main):087:0> require 'watir'
> > begin
> >  test_site = 'http://newpmr2prod.jpmorgan.com/PM/PMlogin.do'
> >  b = Watir::Browser.new
> >
> >  b.goto(test_site)
> >  b.text_field(:name, "userID").set("sudhikumar")
> >  b.text_field(:name, "password").set("jpm")
> >  b.form(:action, "/PM/PMlogin.do").submit
> >  #b.show_frames()
> >  b.frame(:name, "menuMiddle").link(:text, "Performance").click
> >  b.select_list(:name, 'level0').select ("00990")
> >  rescue Exception => ex
> >
> >  end
> > => false
> > Errno::EBADF: Bad file descriptor
> > from (irb):98:in `write'
> >
> > See the two executionFirst one able to login
> > but with b.show_frames() not able to login
> >
> > On Aug 16, 5:23 pm, Pallavi Sharma  wrote:
> >
> >
> >
> > > Sudhir
> >
> > > Do this:
> >
> > > require 'watir'
> > > begin
> > >  test_site = '.'
> > >  b = Watir::Browser.new
> > >  b.goto(test_site)
> > >  b.text_field(:name, "userID").set("sudhikumar")
> > >  b.text_field(:name, "password").set("jpm")
> > >  b.form(:action, "/PM/PMlogin.do").submit
> > >  b.show_frames()  ##TO GET THE NAME OF THE FRAMES##
> >
> > >  b.frame(:name, "menuMiddle").link(:text, "Performance").click
> > >  #b.select_list(:name, 'level0').select ("00990")
> > >  rescue Exception => ex
> > >  puts ex.message
> > >  end
> >
> > > Is it possible that the select list you are trying to access is also in
> a
> > > frame??
> >
> > > Regards
> > > Pallavi
> >
> > > 2010/8/16 Pallavi Sharma 
> >
> > > > Sudhir
> >
> > > > Do this:
> >
> > > > require 'watir'
> > > > begin
> > > >  test_site = '.'
> > > >  b = Watir::Browser.new
> >
> > > >  b.goto(test_site)
> > > >  b.text_field(:name, "userID").set("sudhikumar")
> > > >  b.text_field(:name, "password").set("jpm")
> > > >  b.form(:action, "/PM/PMlogin.do").submit
> > > >  b.show_frames()
> >
> > > >  b.frame(:name, "menuMiddle").link(:text, "Performance").click
> > > >  #b.select_list(:name, 'level0').select ("00990")
> > > >  rescue Exception => ex
> >
> > > >  end
> >
> > > > 2010/8/16 sudhir 
> >
> > > >> require 'watir'
> >
> > > >>  test_site = '.'
> >
> > > >> b = Watir::Browser.new
> >
> > > >>  b.goto(test_site)
> > > >>  b.text_field(:name, "userID").set("sudhikumar")
> > > >>  b.text_field(:name, "password").set("jpm")
> > > >>  b.form(:action, "/PM/PMlogin.do").submit
> > > >>  b.frame(:name, "menuMiddle").link(:text, "Performance").click
> >
> 

[wtr-general] Re: How I can do double click on a calendar?

2010-08-16 Thread Chuck van der Linden
OK so the jpg you attached look like a series of times, starting at
midnight, and ending at 6am

"You do double click over the row"   'the row'?? WHICH row is 'the
row' that you want?, how do you know which one to double-click?

If you use the IE developer Toolbar, or Firebug on it, what kind of
element is the 'row'  is it really a table row, or is it a cell?

Are you clicking on the text (which looks like it would be in the
first row if that's a table) or to the right of the text in an empty
cell? (which is a bit what the xpath looks like)

Try identifying the row by matching some of the text inside..
 browser.row(:text, /04:00/).flashsee if the right element flashes

If you want the second cell on that row you can try this
 browser.row(:text, /04:00/)[2].flash

If you have nested tables, then you might have to specify the table
containing the row, or a div or something else unique as an outer
container.

Once you find a good way to identify the element, (and are sure that's
the one with the javascript event handling specified) then replace the
flash with your fire_event_no_wait

On Aug 13, 3:35 pm, Carmen  wrote:
> There is a "calendar" with several rows, and you can do double click over
> the row like in the image attachment.
>
> 2010/8/13 Chuck van der Linden 
>
>
>
>
>
> > The problem is
> >  a) it makes for unreadable text code, there's no way to tell what
> > cell it's clicking etc
> >  b) next month, will the xpath be the same?
>
> > Are you folks using Coolite (EXTJS)   tools?
>
> > There's probably a better way to identify the place you are trying to
> > doubleclick.   possibly by the class of the row or div, and the text
> > that's inside the cell.
>
> > If you were doing this test manually, how would you know where to
> > click?
>
> > On Aug 13, 2:06 pm, Carmen  wrote:
> > > Im using the xpath because I dont have the ID but i talked ´to my Manager
> > > who is also a dev and the said me that the event is contained in the
> > > following xpath
>
> > html/body/div/div/div[2]/div[2]/div[2]/div/div/div[2]/div/div[2]/div/div/di
> > v[2]/div/div[25]/table/tbody/tr/td[2]
>
> > > 2010/8/13 Charley Baker 
>
> > > > Good god, I don't know why you would use an xpath like that, if you
> > even
> > > > have to use xpath. There's a js event tied to something in there, hard
> > to
> > > > tell what it is and where the event is tied to. I'd talk to your devs,
> > > > figure out where the event is occurring and fire it on that container
> > or
> > > > element.
>
> > > > Charley Baker
> > > > Lead Developer, Watir,http://watir.com
>
> > > > On Fri, Aug 13, 2010 at 2:35 PM, Carmen  wrote:
>
> > > >> The problem is that the double click is not doing anything action, but
> > if
> > > >> I send a single click, the click is sent.
>
> > > >>   b.div(:xpath,"
>
> > /html/body/div/div/div[2]/div[2]/div[2]/div/div/div[2]/div/div[2]/div/div/d
> > iv[2]/div/div[27]/table/tbody/tr/td[2]").fire_event_no_wait("ondblclick")
>
> > > >> See the attachment with the code
>
> > > >> --
> > > >> 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.com > > >>  legroups.com>
> > 
>
> > > >  --
> > > > 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.com > > >  legroups.com>
> > 
>
> > > --
> > > Attentamente:
> > > Carmen Elia!!
>
> > --
> > 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.com > legroups.com>
>
> --
> Attentamente:
> Carmen Elia!!
>
>  calendar.JPG
> 36KViewDownload

-- 
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: How to select a item from the dropbox

2010-08-16 Thread Chuck van der Linden
It doesn't make any sense that a change later in the script would
cause a problem with logging in, unless perhaps you had not logged out
the prior user, it was the same browser session, and an active session
still existed?, or there were cookies or some other means by which an
active session was persisted?   For tests like this I'd always make
sure the user is logged out, before you try to run the script.

The selection list looks pretty much like a normal select list other
than having a javascript onchange event in there.  So I'd try
addressing it like a normal selection list, but I'd also after
using .select  to pick an option by name, I'd add a command to fire
the onchange method on the select_list element, which should give the
javascript a chance to do it's stuff.

On Aug 16, 6:04 am, sudhir  wrote:
> require 'watir'
> begin
>  test_site = 'http://newpmr2prod.jpmorgan.com/PM/PMlogin.do'
>  b = Watir::Browser.new
>
>  b.goto(test_site)
>  b.text_field(:name, "userID").set("sudhikumar")
>  b.text_field(:name, "password").set("jpm")
>  b.form(:action, "/PM/PMlogin.do").submit
>  #b.show_frames()
>  b.frame(:name, "menuMiddle").link(:text, "Performance").click
>  #b.select_list(:name, 'level0').select ("00990")
>  rescue Exception => ex
>
>  end
> => false
> => 2.172
> irb(main):087:0> require 'watir'
> begin
>  test_site = 'http://newpmr2prod.jpmorgan.com/PM/PMlogin.do'
>  b = Watir::Browser.new
>
>  b.goto(test_site)
>  b.text_field(:name, "userID").set("sudhikumar")
>  b.text_field(:name, "password").set("jpm")
>  b.form(:action, "/PM/PMlogin.do").submit
>  #b.show_frames()
>  b.frame(:name, "menuMiddle").link(:text, "Performance").click
>  b.select_list(:name, 'level0').select ("00990")
>  rescue Exception => ex
>
>  end
> => false
> Errno::EBADF: Bad file descriptor
>         from (irb):98:in `write'
>
> See the two executionFirst one able to login
> but with b.show_frames() not able to login
>
> On Aug 16, 5:23 pm, Pallavi Sharma  wrote:
>
>
>
> > Sudhir
>
> > Do this:
>
> > require 'watir'
> > begin
> >  test_site = '.'
> >  b = Watir::Browser.new
> >  b.goto(test_site)
> >  b.text_field(:name, "userID").set("sudhikumar")
> >  b.text_field(:name, "password").set("jpm")
> >  b.form(:action, "/PM/PMlogin.do").submit
> >  b.show_frames()  ##TO GET THE NAME OF THE FRAMES##
>
> >  b.frame(:name, "menuMiddle").link(:text, "Performance").click
> >  #b.select_list(:name, 'level0').select ("00990")
> >  rescue Exception => ex
> >  puts ex.message
> >  end
>
> > Is it possible that the select list you are trying to access is also in a
> > frame??
>
> > Regards
> > Pallavi
>
> > 2010/8/16 Pallavi Sharma 
>
> > > Sudhir
>
> > > Do this:
>
> > > require 'watir'
> > > begin
> > >  test_site = '.'
> > >  b = Watir::Browser.new
>
> > >  b.goto(test_site)
> > >  b.text_field(:name, "userID").set("sudhikumar")
> > >  b.text_field(:name, "password").set("jpm")
> > >  b.form(:action, "/PM/PMlogin.do").submit
> > >  b.show_frames()
>
> > >  b.frame(:name, "menuMiddle").link(:text, "Performance").click
> > >  #b.select_list(:name, 'level0').select ("00990")
> > >  rescue Exception => ex
>
> > >  end
>
> > > 2010/8/16 sudhir 
>
> > >> require 'watir'
>
> > >>  test_site = '.'
>
> > >> b = Watir::Browser.new
>
> > >>  b.goto(test_site)
> > >>  b.text_field(:name, "userID").set("sudhikumar")
> > >>  b.text_field(:name, "password").set("jpm")
> > >>  b.form(:action, "/PM/PMlogin.do").submit
> > >>  b.frame(:name, "menuMiddle").link(:text, "Performance").click
>
> > >> Instead of exception I am able to login with above userid and pwd and
> > >> upto "Performance" click
>
> > >> On Aug 16, 2:40 pm, Pallavi Sharma  wrote:
> > >> > No Sudhir
>
> > >> > You are getting this exception for all objects in your application.
> > >> remove
> > >> > all code and just try the setting user id,
>
> > >> > Does your application has frames...?
>
> > >> > Regards
> > >> > Pallavi.
>
> > >> > On Mon, Aug 16, 2010 at 2:42 PM, sudhir  wrote:
> > >> > > require 'watir'
> > >> > >  test_site = '.'
>
> > >> > > b = Watir::Browser.new
>
> > >> > >  b.goto(test_site)
> > >> > >  b.text_field(:name, "userID").set("sudhikumar")
> > >> > >  b.text_field(:name, "password").set("jpm")
> > >> > >  b.form(:action, "/PM/PMlogin.do").submit
> > >> > >  b.frame(:name, "menuMiddle").link(:text, "Performance").click
> > >> > >  b.select_list(:name, 'level0').select ("00990")
>
> > >> b.select_list(:name,'selectedReportDetailsString').select("SecurityPerforma
> > >>  nce##4##
> > >> > > ## || ##RPTTYP##PERF|| ||")
> > >> > > => false
> > >> > > => "http://newpmr2prod.jpmorgan.com/PM/PMlogin.do";
> > >> > > => #
> > >> > > => 5.391
> > >> > > Watir::Exception::UnknownObjectException: Unable to locate element,
> > >> > > using :name, "userID"
> > >> > >        from
> > >> > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> > >> > > 56:in `assert_exists'
> > >> > >        from
> > >> > > C:/Ruby

[wtr-general] Re: Does anybody have experience to run ruby watir script in a cgi script?

2010-08-16 Thread WatirJoy
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
(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  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  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]
> > retension=cgi.params['retension'][0]
>
> > puts "Content-type: text/html"
> > puts ""
> > puts ""
> > puts "serverIpValue:#{serverIpValue}"
> > puts "mailIpValue:#{mailIpValue}"
> > puts "mediaDrive:#{mediaDrive}"
> > puts "retension:#{retension}"
> > puts "Start initial system state check and system
> > configuration..."
> >    begin_time=Time.now
> >    ie = Watir::IE.new
> >    ie.goto "#{serverIpValue}"
> >    if ie.text.include?("Password:")
> >    puts "login in as user admin"
> >    ie.text_field(:name, "j_username").set "admin"
> >    ie.text_field(:name, "j_password").set "admin"
> >    ie.button(:value, "Log in").click
> >    puts "ie.down_load_time"
> >    end
> >    ie.close if ie
> >    puts "Initial account login passed"
>
> > puts ""
> > puts ""
>
> > --
> > 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.com-
> >  Hide quoted text -
>
> - Show quoted text -

-- 
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: Unable to see error message in ruby interpreter

2010-08-16 Thread Eric Mathiesen
My first piece of advice would be not to use x-path, but any of the other
items to identify ( ID, Name, URL, Etc...)

Cheers,
Eric

On Mon, Aug 16, 2010 at 10:59 AM, Charley Baker wrote:

> Not sure on that one, check the unittests for watir. I've created and built
> out a test base of over 10k tests, not using xpath. Others are more
> qualified to answer.
>
>
> Charley Baker
> Lead Developer, Watir, http://watir.com
>
>
> On Mon, Aug 16, 2010 at 11:31 AM, goutham mandadi <
> goutham.mand...@gmail.com> wrote:
>
>> Hi Charley,
>>
>> Thanks alot it is working fine now and one more issue is while using xpath
>> i am getting the following error
>>
>> one.rb:6: undefined method `element_by_xpath' for #
>> (NoMethodError)
>> ie.element_by_xpath("//ar...@href='www.snapfish.com/snapfish/youraccount']").click
>> this is the element i am trying to find using xpath
>>
>> Thanks,
>> Goutham
>>
>> On Mon, HiAug 16, 2010 at 10:07 PM, Charley Baker <
>> charley.ba...@gmail.com> wrote:
>>
>>> Name the file with no spaces, something like my_ruby_program.rb.
>>> Filenames are conventionally snake cased - lower case with underscores.
>>>
>>> Charley Baker
>>> Lead Developer, Watir, http://watir.com
>>>
>>>
>>>   On Mon, Aug 16, 2010 at 10:04 AM, goutham mandadi <
>>> goutham.mand...@gmail.com> wrote:
>>>
   Hai Adam,

 Thanks for your reply i have installed scite and run the script it is
 giving the following message

 >ruby New Ruby Program.rb
 ruby: No such file or directory -- New (LoadError)
 >Exit code: 1
 the script is in my desktop should we place it in any specific directory
 to execute

 Thanks,
 Goutham

On Mon, Aug 16, 2010 at 9:24 PM, Adam Reed wrote:

> Hi Goutham,
>
> It sounds like you're double-clicking the script in order to run it
> which closes the DOS window upon completion.
>
> If installed, you can execute the script using the SciTE editor.
> Right click on the script, select Edit.  The output pane can be
> enabled using F8 if it is not shown.
>
> Alternatively, you can open a DOS prompt and browse to the location of
> the script you would like to run.  Execute the script from the command
> line, and the DOS window will not close.
>
> Good luck,
> Adam
>
> On Aug 16, 10:46 am, goutham  wrote:
> > Hi all,
> >
> > I am new to watir ,I am trying to find element using xpath but i
> could
> > not and one more issue is that i couldnot see the error message what
> > it is returning as ruby interpreter is getting closed how to see the
> > error messages returned during execution
> >
> > Thankyou,
> > Goutham
>
> --
> 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
>

 --
 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

>>>
>>> --
>>>  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
>>>
>>
>>  --
>> 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
>>
>
>  --
> 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
>

-- 
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: Unable to see error message in ruby interpreter

2010-08-16 Thread Charley Baker
Not sure on that one, check the unittests for watir. I've created and built
out a test base of over 10k tests, not using xpath. Others are more
qualified to answer.


Charley Baker
Lead Developer, Watir, http://watir.com


On Mon, Aug 16, 2010 at 11:31 AM, goutham mandadi  wrote:

> Hi Charley,
>
> Thanks alot it is working fine now and one more issue is while using xpath
> i am getting the following error
>
> one.rb:6: undefined method `element_by_xpath' for #
> (NoMethodError)
> ie.element_by_xpath("//ar...@href='www.snapfish.com/snapfish/youraccount']").click
> this is the element i am trying to find using xpath
>
> Thanks,
> Goutham
>
> On Mon, HiAug 16, 2010 at 10:07 PM, Charley Baker  > wrote:
>
>> Name the file with no spaces, something like my_ruby_program.rb. Filenames
>> are conventionally snake cased - lower case with underscores.
>>
>> Charley Baker
>> Lead Developer, Watir, http://watir.com
>>
>>
>>   On Mon, Aug 16, 2010 at 10:04 AM, goutham mandadi <
>> goutham.mand...@gmail.com> wrote:
>>
>>>   Hai Adam,
>>>
>>> Thanks for your reply i have installed scite and run the script it is
>>> giving the following message
>>>
>>> >ruby New Ruby Program.rb
>>> ruby: No such file or directory -- New (LoadError)
>>> >Exit code: 1
>>> the script is in my desktop should we place it in any specific directory
>>> to execute
>>>
>>> Thanks,
>>> Goutham
>>>
>>>On Mon, Aug 16, 2010 at 9:24 PM, Adam Reed wrote:
>>>
 Hi Goutham,

 It sounds like you're double-clicking the script in order to run it
 which closes the DOS window upon completion.

 If installed, you can execute the script using the SciTE editor.
 Right click on the script, select Edit.  The output pane can be
 enabled using F8 if it is not shown.

 Alternatively, you can open a DOS prompt and browse to the location of
 the script you would like to run.  Execute the script from the command
 line, and the DOS window will not close.

 Good luck,
 Adam

 On Aug 16, 10:46 am, goutham  wrote:
 > Hi all,
 >
 > I am new to watir ,I am trying to find element using xpath but i could
 > not and one more issue is that i couldnot see the error message what
 > it is returning as ruby interpreter is getting closed how to see the
 > error messages returned during execution
 >
 > Thankyou,
 > Goutham

 --
 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

>>>
>>> --
>>> 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
>>>
>>
>> --
>>  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
>>
>
>  --
> 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
>

-- 
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: Unable to see error message in ruby interpreter

2010-08-16 Thread goutham mandadi
Hi Charley,

Thanks alot it is working fine now and one more issue is while using xpath i
am getting the following error

one.rb:6: undefined method `element_by_xpath' for #
(NoMethodError)
ie.element_by_xpath("//ar...@href='www.snapfish.com/snapfish/youraccount']").click
this is the element i am trying to find using xpath

Thanks,
Goutham

On Mon, HiAug 16, 2010 at 10:07 PM, Charley Baker
wrote:

> Name the file with no spaces, something like my_ruby_program.rb. Filenames
> are conventionally snake cased - lower case with underscores.
>
> Charley Baker
> Lead Developer, Watir, http://watir.com
>
>
>   On Mon, Aug 16, 2010 at 10:04 AM, goutham mandadi <
> goutham.mand...@gmail.com> wrote:
>
>>   Hai Adam,
>>
>> Thanks for your reply i have installed scite and run the script it is
>> giving the following message
>>
>> >ruby New Ruby Program.rb
>> ruby: No such file or directory -- New (LoadError)
>> >Exit code: 1
>> the script is in my desktop should we place it in any specific directory
>> to execute
>>
>> Thanks,
>> Goutham
>>
>>On Mon, Aug 16, 2010 at 9:24 PM, Adam Reed wrote:
>>
>>> Hi Goutham,
>>>
>>> It sounds like you're double-clicking the script in order to run it
>>> which closes the DOS window upon completion.
>>>
>>> If installed, you can execute the script using the SciTE editor.
>>> Right click on the script, select Edit.  The output pane can be
>>> enabled using F8 if it is not shown.
>>>
>>> Alternatively, you can open a DOS prompt and browse to the location of
>>> the script you would like to run.  Execute the script from the command
>>> line, and the DOS window will not close.
>>>
>>> Good luck,
>>> Adam
>>>
>>> On Aug 16, 10:46 am, goutham  wrote:
>>> > Hi all,
>>> >
>>> > I am new to watir ,I am trying to find element using xpath but i could
>>> > not and one more issue is that i couldnot see the error message what
>>> > it is returning as ruby interpreter is getting closed how to see the
>>> > error messages returned during execution
>>> >
>>> > Thankyou,
>>> > Goutham
>>>
>>> --
>>> 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
>>>
>>
>> --
>> 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
>>
>
> --
>  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
>

-- 
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: Soap with Savon gem

2010-08-16 Thread jtk
Thanks for the response Charlie, I'll see if I can get that to work.

On Aug 13, 12:00 pm, Charley Baker  wrote:
> Definitely not a Watir question, more of related to Savon or general ruby
> lists. That being said, I've done soap service testing with Soap4R, which
> isn't a great library and had considered moving to Savon. It's been a long
> time since I looked at it, but hacked together a quick example given the
> Savon docs and found this as 
> well:http://blog.nofail.de/2010/01/savon-handsoap-shootout/
>
> Seems pretty trivial to do, here's my quick example from a free soap
> webservice:
>
> require 'rubygems'
> require 'savon'
> require 'pp'
>
> client = Savon::Client.new 
> "http://geocoder.us/dist/eg/clients/GeoCoderPHP.wsdl";
>
> response = client.geocode_address do |soapy|
>   soapy.body = {:location => '1600 Pennsylvania Av, Washington, DC'}
> end
> pp response.to_hash
>
> I don't know if that helps, but should give you some start. Savon docs are
> pretty good, took 10 minutes from installing the gem to finding a free web
> service to writing this. If you see the response back, it's hash within hash
> within hash, etc. I'm assuming the same is for input so in your example
> something like setting the body to (pseudocode):
>
> {:from_date => 'whatever', :to_date => 'sometime later', :service_address =>
> {:address1 => '123'}} etc etc
>
> should theoretically work.
>
>  Once again, this is unsupported hacky code, you're much better off asking
> elsewhere. :) Might make for a good blog post though, hrrrm... :)
>
> Charley Baker
> Lead Developer, Watir,http://watir.com
>
> On Fri, Aug 13, 2010 at 9:57 AM, jtk  wrote:
> > For a project at work I need the ability to submit transactions using
> > soap calls. I tried searching the group and the only posts I could
> > find were for soap4r. From what I've read soap4r does not work well
> > and I found a gem called savon. Supposedly it's easier and more
> > lightweight than soap4r but I can't find any basic examples of simply
> > submitting a soap request. All the examples I do find are more
> > complicated than this where the writers are trying to do something
> > quite more involved.
>
> > Can anyone here show me a simple request of submitting a soap request
> > using savon?
>
> > We are using basic auth no ssl and my soap envelope has no header.
>
> > Here is the call I am making
>
> > http://schemas.xmlsoap.org/soap/
> > envelope/" xmlns:ser="http://service.webservice.com/";>
> >   
> >   
> >      
> >         
> >         2010-08-13
> >         
> >         2010-08-23
> >         
> >         
> >            
> >            ?
> >            
> >            ?
> >            
> >            ?
> >            
> >            ?
> >            
> >            CA
> >            
> >            93230
> >            
> >            
> >         
> >         
> >         DIRECT
> >      
> >   
> > 
>
> > All I want to do is submit this to an endpoint and capture the
> > response. If someone could show me a simple example I would greatly
> > appreciate it.
>
> > --
> > 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.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: Unable to see error message in ruby interpreter

2010-08-16 Thread Charley Baker
Name the file with no spaces, something like my_ruby_program.rb. Filenames
are conventionally snake cased - lower case with underscores.

Charley Baker
Lead Developer, Watir, http://watir.com


On Mon, Aug 16, 2010 at 10:04 AM, goutham mandadi  wrote:

> Hai Adam,
>
> Thanks for your reply i have installed scite and run the script it is
> giving the following message
>
> >ruby New Ruby Program.rb
> ruby: No such file or directory -- New (LoadError)
> >Exit code: 1
> the script is in my desktop should we place it in any specific directory to
> execute
>
> Thanks,
> Goutham
>
> On Mon, Aug 16, 2010 at 9:24 PM, Adam Reed  wrote:
>
>> Hi Goutham,
>>
>> It sounds like you're double-clicking the script in order to run it
>> which closes the DOS window upon completion.
>>
>> If installed, you can execute the script using the SciTE editor.
>> Right click on the script, select Edit.  The output pane can be
>> enabled using F8 if it is not shown.
>>
>> Alternatively, you can open a DOS prompt and browse to the location of
>> the script you would like to run.  Execute the script from the command
>> line, and the DOS window will not close.
>>
>> Good luck,
>> Adam
>>
>> On Aug 16, 10:46 am, goutham  wrote:
>> > Hi all,
>> >
>> > I am new to watir ,I am trying to find element using xpath but i could
>> > not and one more issue is that i couldnot see the error message what
>> > it is returning as ruby interpreter is getting closed how to see the
>> > error messages returned during execution
>> >
>> > Thankyou,
>> > Goutham
>>
>> --
>> 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
>>
>
>  --
> 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
>

-- 
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] unable to find element using xpath

2010-08-16 Thread goutham mandadi
Hi,

I am getting the following error message ,i am using IE8 browser

one.rb:6: undefined method `element_by_xpath' for #
(NoMethodError)

can anyone help me out

Thanks in advance,
Goutham

On Mon, Aug 16, 2010 at 4:23 PM, goutham mandadi
wrote:

> Hai Angrez,
>
>  I have seen the example and tried to acces the element but when it comes
> to that step ruby interpreter is closing. How can i know whether xpath is
> working for me or not i have ruby along with rexml and i could not see the
> error message in ruby interpreter as it is closing. Please help me out
> waiting for your suggestions
>
> Thanks,
> Goutham
>
>
> On Mon, Aug 16, 2010 at 2:07 PM, Angrez Singh  wrote:
>
>> Hi Goutham,
>>
>> Please check the unit test cases for Watir you'll find example on how to
>> access map/area element using XPath. It should be there in [ruby
>> installation directory]\gems\1.8\firewatir-1.6.5\unittests.
>>
>> Thanks,
>> Angrez
>>
>>   On Mon, Aug 16, 2010 at 9:09 AM, goutham mandadi <
>> goutham.mand...@gmail.com> wrote:
>>
>>>  hai basim,
>>>
>>> below is the code
>>> >>
>>> http://www.snapfish.com/snapfish/selectalbumreprints/"; title=" 
>>> Order prints " coords="9,53,113,72">
>>>
>>>
>>>
>>>
>>> 
>>>
>>> 
>>> how can we identify these elements by using xpath
>>>
>>>
>>> On Mon, Aug 16, 2010 at 12:20 AM, Basim Baassiri wrote:
>>>
 Hi Goutham
 You'll need to post some code and some html to illustrate better your
 problem


 On Sun, Aug 15, 2010 at 11:22 AM, goutham wrote:

> hai all,
>
> i am using element_by_xpath to find an element in watir but browser is
> closing when i come to xpath step. does we need to install anything to
> find element using xpath . waiting for ur suggestions
>
> Thankyou,
> Goutham
>
> --
> 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
>

 --
 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

>>>
>>> --
>>>   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
>>>
>>
>> --
>> 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
>>
>
>

-- 
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] Where does watir stores object properties

2010-08-16 Thread Ethan
Sure. Feel free to submit a patch to firewatir. I don't think that project
has much activity lately though, and it seems like it may be some time
before anything happens.

2010/8/15 Amit 

> Does firewatir saves things in broswer_var ?? Can't we use multiple objects
> so we don't lose refrence of previous window?
>
>
>
> 2010/8/12 Ethan 
>
>> Firewatir saves things in javascript variables, and reuses the same
>> variables, so when you attach to a new window, it reuses the same variables
>> as it does for the old window and you lose references to that window.
>>
>> On Thu, Aug 12, 2010 at 10:36, Amit  wrote:
>>
>>> Hi Željko,
>>>
>>> Actually, i was checking behavior of attach function in firewatir.
>>> Currently, In firewatir, if we attach 2 windows then it loose control
>>> over first one.
>>>
>>> So, thats why i wanted to know wether it saves object properties or
>>> not... and if yes then where..
>>>
>>> Thank You
>>> Amit
>>>
>>> On 8/12/10, Željko Filipin  wrote:
>>> > On Thu, Aug 12, 2010 at 2:42 PM, Amit  wrote:
>>> >> I want to know where WATIR is storing this information so it can
>>> access
>>> > objects for both window.
>>> >
>>> > Why do you need that information?
>>> >
>>> > To be precise, Watir is not storing it, but Ruby is (as far as I
>>> understand
>>> > it).
>>> >
>>> > The most general answer would be in RAM. :)
>>> >
>>> > Željko
>>> > --
>>> > watir.com - community manager
>>> > watirpodcast.com - host
>>> > testingpodcast.com - audio podcasts on software testing. all of them
>>> > vidipodkast.com - pričamo o hardveru, softveru i časopisu Vidi
>>> >
>>> > --
>>> > 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
>>> >
>>>
>>> --
>>> 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
>>>
>>
>>  --
>> 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
>>
>
>  --
> 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
>

-- 
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: Unable to see error message in ruby interpreter

2010-08-16 Thread goutham mandadi
Hai Adam,

Thanks for your reply i have installed scite and run the script it is giving
the following message

>ruby New Ruby Program.rb
ruby: No such file or directory -- New (LoadError)
>Exit code: 1
the script is in my desktop should we place it in any specific directory to
execute

Thanks,
Goutham

On Mon, Aug 16, 2010 at 9:24 PM, Adam Reed  wrote:

> Hi Goutham,
>
> It sounds like you're double-clicking the script in order to run it
> which closes the DOS window upon completion.
>
> If installed, you can execute the script using the SciTE editor.
> Right click on the script, select Edit.  The output pane can be
> enabled using F8 if it is not shown.
>
> Alternatively, you can open a DOS prompt and browse to the location of
> the script you would like to run.  Execute the script from the command
> line, and the DOS window will not close.
>
> Good luck,
> Adam
>
> On Aug 16, 10:46 am, goutham  wrote:
> > Hi all,
> >
> > I am new to watir ,I am trying to find element using xpath but i could
> > not and one more issue is that i couldnot see the error message what
> > it is returning as ruby interpreter is getting closed how to see the
> > error messages returned during execution
> >
> > Thankyou,
> > Goutham
>
> --
> 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
>

-- 
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: Unable to see error message in ruby interpreter

2010-08-16 Thread Adam Reed
Hi Goutham,

It sounds like you're double-clicking the script in order to run it
which closes the DOS window upon completion.

If installed, you can execute the script using the SciTE editor.
Right click on the script, select Edit.  The output pane can be
enabled using F8 if it is not shown.

Alternatively, you can open a DOS prompt and browse to the location of
the script you would like to run.  Execute the script from the command
line, and the DOS window will not close.

Good luck,
Adam

On Aug 16, 10:46 am, goutham  wrote:
> Hi all,
>
> I am new to watir ,I am trying to find element using xpath but i could
> not and one more issue is that i couldnot see the error message what
> it is returning as ruby interpreter is getting closed how to see the
> error messages returned during execution
>
> Thankyou,
> Goutham

-- 
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] Unable to see error message in ruby interpreter

2010-08-16 Thread goutham
Hi all,

I am new to watir ,I am trying to find element using xpath but i could
not and one more issue is that i couldnot see the error message what
it is returning as ruby interpreter is getting closed how to see the
error messages returned during execution

Thankyou,
Goutham

-- 
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: How to select a item from the dropbox

2010-08-16 Thread sudhir
require 'watir'
begin
 test_site = 'http://newpmr2prod.jpmorgan.com/PM/PMlogin.do'
 b = Watir::Browser.new

 b.goto(test_site)
 b.text_field(:name, "userID").set("sudhikumar")
 b.text_field(:name, "password").set("jpm")
 b.form(:action, "/PM/PMlogin.do").submit
 #b.show_frames()
 b.frame(:name, "menuMiddle").link(:text, "Performance").click
 #b.select_list(:name, 'level0').select ("00990")
 rescue Exception => ex

 end
=> false
=> 2.172
irb(main):087:0> require 'watir'
begin
 test_site = 'http://newpmr2prod.jpmorgan.com/PM/PMlogin.do'
 b = Watir::Browser.new

 b.goto(test_site)
 b.text_field(:name, "userID").set("sudhikumar")
 b.text_field(:name, "password").set("jpm")
 b.form(:action, "/PM/PMlogin.do").submit
 #b.show_frames()
 b.frame(:name, "menuMiddle").link(:text, "Performance").click
 b.select_list(:name, 'level0').select ("00990")
 rescue Exception => ex

 end
=> false
Errno::EBADF: Bad file descriptor
from (irb):98:in `write'



See the two executionFirst one able to login
but with b.show_frames() not able to login


On Aug 16, 5:23 pm, Pallavi Sharma  wrote:
> Sudhir
>
> Do this:
>
> require 'watir'
> begin
>  test_site = '.'
>  b = Watir::Browser.new
>  b.goto(test_site)
>  b.text_field(:name, "userID").set("sudhikumar")
>  b.text_field(:name, "password").set("jpm")
>  b.form(:action, "/PM/PMlogin.do").submit
>  b.show_frames()  ##TO GET THE NAME OF THE FRAMES##
>
>  b.frame(:name, "menuMiddle").link(:text, "Performance").click
>  #b.select_list(:name, 'level0').select ("00990")
>  rescue Exception => ex
>  puts ex.message
>  end
>
> Is it possible that the select list you are trying to access is also in a
> frame??
>
> Regards
> Pallavi
>
> 2010/8/16 Pallavi Sharma 
>
> > Sudhir
>
> > Do this:
>
> > require 'watir'
> > begin
> >  test_site = '.'
> >  b = Watir::Browser.new
>
> >  b.goto(test_site)
> >  b.text_field(:name, "userID").set("sudhikumar")
> >  b.text_field(:name, "password").set("jpm")
> >  b.form(:action, "/PM/PMlogin.do").submit
> >  b.show_frames()
>
> >  b.frame(:name, "menuMiddle").link(:text, "Performance").click
> >  #b.select_list(:name, 'level0').select ("00990")
> >  rescue Exception => ex
>
> >  end
>
> > 2010/8/16 sudhir 
>
> >> require 'watir'
>
> >>  test_site = '.'
>
> >> b = Watir::Browser.new
>
> >>  b.goto(test_site)
> >>  b.text_field(:name, "userID").set("sudhikumar")
> >>  b.text_field(:name, "password").set("jpm")
> >>  b.form(:action, "/PM/PMlogin.do").submit
> >>  b.frame(:name, "menuMiddle").link(:text, "Performance").click
>
> >> Instead of exception I am able to login with above userid and pwd and
> >> upto "Performance" click
>
> >> On Aug 16, 2:40 pm, Pallavi Sharma  wrote:
> >> > No Sudhir
>
> >> > You are getting this exception for all objects in your application.
> >> remove
> >> > all code and just try the setting user id,
>
> >> > Does your application has frames...?
>
> >> > Regards
> >> > Pallavi.
>
> >> > On Mon, Aug 16, 2010 at 2:42 PM, sudhir  wrote:
> >> > > require 'watir'
> >> > >  test_site = '.'
>
> >> > > b = Watir::Browser.new
>
> >> > >  b.goto(test_site)
> >> > >  b.text_field(:name, "userID").set("sudhikumar")
> >> > >  b.text_field(:name, "password").set("jpm")
> >> > >  b.form(:action, "/PM/PMlogin.do").submit
> >> > >  b.frame(:name, "menuMiddle").link(:text, "Performance").click
> >> > >  b.select_list(:name, 'level0').select ("00990")
>
> >> b.select_list(:name,'selectedReportDetailsString').select("SecurityPerformance##4##
> >> > > ## || ##RPTTYP##PERF|| ||")
> >> > > => false
> >> > > => "http://newpmr2prod.jpmorgan.com/PM/PMlogin.do";
> >> > > => #
> >> > > => 5.391
> >> > > Watir::Exception::UnknownObjectException: Unable to locate element,
> >> > > using :name, "userID"
> >> > >        from
> >> > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> >> > > 56:in `assert_exists'
> >> > >        from
> >> > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> >> > > 288:in `enabled?'
> >> > >        from
> >> > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> >> > > 60:in `assert_enabled'
> >> > >        from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
> >> > > input_elements.rb:327:in `set'
> >> > >        from (irb):27
> >> > >        from :0
> >> > > Watir::Exception::UnknownObjectException: Unable to locate element,
> >> > > using :name, "password"
> >> > >        from
> >> > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> >> > > 56:in `assert_exists'
> >> > >        from
> >> > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> >> > > 288:in `enabled?'
> >> > >        from
> >> > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> >> > > 60:in `assert_enabled'
> >> > >        from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
> >> > > input_elements.rb:327:in `set'
> >> > >        from (irb):28
> >> > >        from :0
> >> > > Watir::Excepti

Re: [wtr-general] Re: How to select a item from the dropbox

2010-08-16 Thread Pallavi Sharma
Sudhir

Do this:

require 'watir'
begin
 test_site = '.'
 b = Watir::Browser.new
 b.goto(test_site)
 b.text_field(:name, "userID").set("sudhikumar")
 b.text_field(:name, "password").set("jpm")
 b.form(:action, "/PM/PMlogin.do").submit
 b.show_frames()  ##TO GET THE NAME OF THE FRAMES##

 b.frame(:name, "menuMiddle").link(:text, "Performance").click
 #b.select_list(:name, 'level0').select ("00990")
 rescue Exception => ex
 puts ex.message
 end


Is it possible that the select list you are trying to access is also in a
frame??

Regards
Pallavi


2010/8/16 Pallavi Sharma 

> Sudhir
>
> Do this:
>
> require 'watir'
> begin
>  test_site = '.'
>  b = Watir::Browser.new
>
>  b.goto(test_site)
>  b.text_field(:name, "userID").set("sudhikumar")
>  b.text_field(:name, "password").set("jpm")
>  b.form(:action, "/PM/PMlogin.do").submit
>  b.show_frames()
>
>  b.frame(:name, "menuMiddle").link(:text, "Performance").click
>  #b.select_list(:name, 'level0').select ("00990")
>  rescue Exception => ex
>
>  end
>
>
> 2010/8/16 sudhir 
>
>> require 'watir'
>>
>>  test_site = '.'
>>
>> b = Watir::Browser.new
>>
>>  b.goto(test_site)
>>  b.text_field(:name, "userID").set("sudhikumar")
>>  b.text_field(:name, "password").set("jpm")
>>  b.form(:action, "/PM/PMlogin.do").submit
>>  b.frame(:name, "menuMiddle").link(:text, "Performance").click
>>
>> Instead of exception I am able to login with above userid and pwd and
>> upto "Performance" click
>>
>> On Aug 16, 2:40 pm, Pallavi Sharma  wrote:
>> > No Sudhir
>> >
>> > You are getting this exception for all objects in your application.
>> remove
>> > all code and just try the setting user id,
>> >
>> > Does your application has frames...?
>> >
>> > Regards
>> > Pallavi.
>> >
>> > On Mon, Aug 16, 2010 at 2:42 PM, sudhir  wrote:
>> > > require 'watir'
>> > >  test_site = '.'
>> >
>> > > b = Watir::Browser.new
>> >
>> > >  b.goto(test_site)
>> > >  b.text_field(:name, "userID").set("sudhikumar")
>> > >  b.text_field(:name, "password").set("jpm")
>> > >  b.form(:action, "/PM/PMlogin.do").submit
>> > >  b.frame(:name, "menuMiddle").link(:text, "Performance").click
>> > >  b.select_list(:name, 'level0').select ("00990")
>> >
>> > >
>> b.select_list(:name,'selectedReportDetailsString').select("SecurityPerformance##4##
>> > > ## || ##RPTTYP##PERF|| ||")
>> > > => false
>> > > => "http://newpmr2prod.jpmorgan.com/PM/PMlogin.do";
>> > > => #
>> > > => 5.391
>> > > Watir::Exception::UnknownObjectException: Unable to locate element,
>> > > using :name, "userID"
>> > >from
>> > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
>> > > 56:in `assert_exists'
>> > >from
>> > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
>> > > 288:in `enabled?'
>> > >from
>> > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
>> > > 60:in `assert_enabled'
>> > >from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
>> > > input_elements.rb:327:in `set'
>> > >from (irb):27
>> > >from :0
>> > > Watir::Exception::UnknownObjectException: Unable to locate element,
>> > > using :name, "password"
>> > >from
>> > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
>> > > 56:in `assert_exists'
>> > >from
>> > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
>> > > 288:in `enabled?'
>> > >from
>> > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
>> > > 60:in `assert_enabled'
>> > >from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
>> > > input_elements.rb:327:in `set'
>> > >from (irb):28
>> > >from :0
>> > > Watir::Exception::UnknownFormException: Unable to locate a form using
>> > > action and /PM/PMlogin.do
>> > >from
>> C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/form.rb:
>> > > 79:in `assert_exists'
>> > >from
>> C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/form.rb:
>> > > 86:in `submit'
>> > >from (irb):29
>> > >from :0
>> > > => 1.734
>> > > Errno::EBADF: Bad file descriptor
>> > >from (irb):31:in `write'
>> > > Watir::Exception::UnknownObjectException: Unable to locate element,
>> > > using :name, "selectedReportDetailsString"
>> > >from
>> > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
>> > > 56:in `assert_exists'
>> > >from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
>> > > input_elements.rb:62:in `select_item_in_select_list'
>> > >from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
>> > > input_elements.rb:46:in `select'
>> > >from (irb):32
>> > >from :0
>> >
>> > > I am getting the above error while selecting from the
>> > > dropbox...
>> > > Let me know if you require more deatils.
>> > > The website I want to automate is not public...
>> >
>> > > On Aug 16, 11:18 am, Pallavi Sharma  wrote:
>> > > > Sudhir
>> >

Re: [wtr-general] Re: How to select a item from the dropbox

2010-08-16 Thread Pallavi Sharma
Sudhir

Do this:

require 'watir'
begin
 test_site = '.'
 b = Watir::Browser.new

 b.goto(test_site)
 b.text_field(:name, "userID").set("sudhikumar")
 b.text_field(:name, "password").set("jpm")
 b.form(:action, "/PM/PMlogin.do").submit
 b.show_frames()
 b.frame(:name, "menuMiddle").link(:text, "Performance").click
 #b.select_list(:name, 'level0').select ("00990")
 rescue Exception => ex

 end


2010/8/16 sudhir 

> require 'watir'
>  test_site = '.'
>
> b = Watir::Browser.new
>
>  b.goto(test_site)
>  b.text_field(:name, "userID").set("sudhikumar")
>  b.text_field(:name, "password").set("jpm")
>  b.form(:action, "/PM/PMlogin.do").submit
>  b.frame(:name, "menuMiddle").link(:text, "Performance").click
>
> Instead of exception I am able to login with above userid and pwd and
> upto "Performance" click
>
> On Aug 16, 2:40 pm, Pallavi Sharma  wrote:
> > No Sudhir
> >
> > You are getting this exception for all objects in your application.
> remove
> > all code and just try the setting user id,
> >
> > Does your application has frames...?
> >
> > Regards
> > Pallavi.
> >
> > On Mon, Aug 16, 2010 at 2:42 PM, sudhir  wrote:
> > > require 'watir'
> > >  test_site = '.'
> >
> > > b = Watir::Browser.new
> >
> > >  b.goto(test_site)
> > >  b.text_field(:name, "userID").set("sudhikumar")
> > >  b.text_field(:name, "password").set("jpm")
> > >  b.form(:action, "/PM/PMlogin.do").submit
> > >  b.frame(:name, "menuMiddle").link(:text, "Performance").click
> > >  b.select_list(:name, 'level0').select ("00990")
> >
> > >
> b.select_list(:name,'selectedReportDetailsString').select("SecurityPerformance##4##
> > > ## || ##RPTTYP##PERF|| ||")
> > > => false
> > > => "http://newpmr2prod.jpmorgan.com/PM/PMlogin.do";
> > > => #
> > > => 5.391
> > > Watir::Exception::UnknownObjectException: Unable to locate element,
> > > using :name, "userID"
> > >from
> > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> > > 56:in `assert_exists'
> > >from
> > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> > > 288:in `enabled?'
> > >from
> > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> > > 60:in `assert_enabled'
> > >from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
> > > input_elements.rb:327:in `set'
> > >from (irb):27
> > >from :0
> > > Watir::Exception::UnknownObjectException: Unable to locate element,
> > > using :name, "password"
> > >from
> > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> > > 56:in `assert_exists'
> > >from
> > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> > > 288:in `enabled?'
> > >from
> > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> > > 60:in `assert_enabled'
> > >from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
> > > input_elements.rb:327:in `set'
> > >from (irb):28
> > >from :0
> > > Watir::Exception::UnknownFormException: Unable to locate a form using
> > > action and /PM/PMlogin.do
> > >from
> C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/form.rb:
> > > 79:in `assert_exists'
> > >from
> C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/form.rb:
> > > 86:in `submit'
> > >from (irb):29
> > >from :0
> > > => 1.734
> > > Errno::EBADF: Bad file descriptor
> > >from (irb):31:in `write'
> > > Watir::Exception::UnknownObjectException: Unable to locate element,
> > > using :name, "selectedReportDetailsString"
> > >from
> > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> > > 56:in `assert_exists'
> > >from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
> > > input_elements.rb:62:in `select_item_in_select_list'
> > >from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
> > > input_elements.rb:46:in `select'
> > >from (irb):32
> > >from :0
> >
> > > I am getting the above error while selecting from the
> > > dropbox...
> > > Let me know if you require more deatils.
> > > The website I want to automate is not public...
> >
> > > On Aug 16, 11:18 am, Pallavi Sharma  wrote:
> > > > Sudhir
> >
> > > > ie.select_list(:name, 'level0').select ("ITEM you want to select")
> >
> > > > Regards
> >
> > > > Pallavi
> >
> > > > 2010/8/16 sudhir 
> >
> > > > > Pallavi,
> > > > > The select list for ABPorts is given below:
> > > > >  >
> > >
> onchange="javascript:selectcombo_Report('0','ReportTemplate_Buselect',this.form)"
> > > > > class="select-menut">-
> Select
> > > > > One -
> > > > > ABC Company
> > > > > ABPorts
> > > > > Washington State Investment Board
> > > > > Wellcome Trust
> >
> > > > > Thanks for your help
> >
> > > > > On Aug 14, 4:19 pm, Pallavi Sharma 
> wrote:
> > > > > > Sudhir
> >
> > > > > > For ABPorts, give the complete select list html code, for the
> other
> > > one:
> >
> > > > > >  > > > > > onchange="ja

Re: [wtr-general] unable to find element using xpath

2010-08-16 Thread goutham mandadi
Hai Angrez,

 I have seen the example and tried to acces the element but when it comes to
that step ruby interpreter is closing. How can i know whether xpath is
working for me or not i have ruby along with rexml and i could not see the
error message in ruby interpreter as it is closing. Please help me out
waiting for your suggestions

Thanks,
Goutham

On Mon, Aug 16, 2010 at 2:07 PM, Angrez Singh  wrote:

> Hi Goutham,
>
> Please check the unit test cases for Watir you'll find example on how to
> access map/area element using XPath. It should be there in [ruby
> installation directory]\gems\1.8\firewatir-1.6.5\unittests.
>
> Thanks,
> Angrez
>
> On Mon, Aug 16, 2010 at 9:09 AM, goutham mandadi <
> goutham.mand...@gmail.com> wrote:
>
>> hai basim,
>>
>> below is the code
>> >
>> http://www.snapfish.com/snapfish/selectalbumreprints/"; title=" 
>> Order prints " coords="9,53,113,72">
>>
>>
>>
>> 
>>
>> 
>> how can we identify these elements by using xpath
>>
>>
>> On Mon, Aug 16, 2010 at 12:20 AM, Basim Baassiri wrote:
>>
>>> Hi Goutham
>>> You'll need to post some code and some html to illustrate better your
>>> problem
>>>
>>>
>>> On Sun, Aug 15, 2010 at 11:22 AM, goutham wrote:
>>>
 hai all,

 i am using element_by_xpath to find an element in watir but browser is
 closing when i come to xpath step. does we need to install anything to
 find element using xpath . waiting for ur suggestions

 Thankyou,
 Goutham

 --
 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

>>>
>>>  --
>>> 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
>>>
>>
>>  --
>> 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
>>
>
>  --
> 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
>

-- 
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: How to select a item from the dropbox

2010-08-16 Thread sudhir
require 'watir'
 test_site = '.'

b = Watir::Browser.new

 b.goto(test_site)
 b.text_field(:name, "userID").set("sudhikumar")
 b.text_field(:name, "password").set("jpm")
 b.form(:action, "/PM/PMlogin.do").submit
 b.frame(:name, "menuMiddle").link(:text, "Performance").click

Instead of exception I am able to login with above userid and pwd and
upto "Performance" click

On Aug 16, 2:40 pm, Pallavi Sharma  wrote:
> No Sudhir
>
> You are getting this exception for all objects in your application. remove
> all code and just try the setting user id,
>
> Does your application has frames...?
>
> Regards
> Pallavi.
>
> On Mon, Aug 16, 2010 at 2:42 PM, sudhir  wrote:
> > require 'watir'
> >  test_site = '.'
>
> > b = Watir::Browser.new
>
> >  b.goto(test_site)
> >  b.text_field(:name, "userID").set("sudhikumar")
> >  b.text_field(:name, "password").set("jpm")
> >  b.form(:action, "/PM/PMlogin.do").submit
> >  b.frame(:name, "menuMiddle").link(:text, "Performance").click
> >  b.select_list(:name, 'level0').select ("00990")
>
> > b.select_list(:name,'selectedReportDetailsString').select("SecurityPerformance##4##
> > ## || ##RPTTYP##PERF|| ||")
> > => false
> > => "http://newpmr2prod.jpmorgan.com/PM/PMlogin.do";
> > => #
> > => 5.391
> > Watir::Exception::UnknownObjectException: Unable to locate element,
> > using :name, "userID"
> >from
> > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> > 56:in `assert_exists'
> >from
> > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> > 288:in `enabled?'
> >from
> > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> > 60:in `assert_enabled'
> >from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
> > input_elements.rb:327:in `set'
> >from (irb):27
> >from :0
> > Watir::Exception::UnknownObjectException: Unable to locate element,
> > using :name, "password"
> >from
> > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> > 56:in `assert_exists'
> >from
> > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> > 288:in `enabled?'
> >from
> > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> > 60:in `assert_enabled'
> >from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
> > input_elements.rb:327:in `set'
> >from (irb):28
> >from :0
> > Watir::Exception::UnknownFormException: Unable to locate a form using
> > action and /PM/PMlogin.do
> >from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/form.rb:
> > 79:in `assert_exists'
> >from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/form.rb:
> > 86:in `submit'
> >from (irb):29
> >from :0
> > => 1.734
> > Errno::EBADF: Bad file descriptor
> >from (irb):31:in `write'
> > Watir::Exception::UnknownObjectException: Unable to locate element,
> > using :name, "selectedReportDetailsString"
> >from
> > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> > 56:in `assert_exists'
> >from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
> > input_elements.rb:62:in `select_item_in_select_list'
> >from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
> > input_elements.rb:46:in `select'
> >from (irb):32
> >from :0
>
> > I am getting the above error while selecting from the
> > dropbox...
> > Let me know if you require more deatils.
> > The website I want to automate is not public...
>
> > On Aug 16, 11:18 am, Pallavi Sharma  wrote:
> > > Sudhir
>
> > > ie.select_list(:name, 'level0').select ("ITEM you want to select")
>
> > > Regards
>
> > > Pallavi
>
> > > 2010/8/16 sudhir 
>
> > > > Pallavi,
> > > > The select list for ABPorts is given below:
> > > > 
> > onchange="javascript:selectcombo_Report('0','ReportTemplate_Buselect',this.form)"
> > > > class="select-menut">- Select
> > > > One -
> > > > ABC Company
> > > > ABPorts
> > > > Washington State Investment Board
> > > > Wellcome Trust
>
> > > > Thanks for your help
>
> > > > On Aug 14, 4:19 pm, Pallavi Sharma  wrote:
> > > > > Sudhir
>
> > > > > For ABPorts, give the complete select list html code, for the other
> > one:
>
> > > > >  > > > > onchange="javascript:submitReportTypes('<
> > > > > %=WebOperation.REPORTTEMPLATE_REPORT_SELECT%>');" class="select-
> > > > > menu180"> > > > > selected="selected">- Select One -
> > > > > Performance by Dimension
> > > > > Historical Summary
> > > > > Index Performance
> > > > > Security Performance
>
> > browser.select_list(:name,'selectedReportDetailsString').select("Security
> > > > > Performance##4## ## || ##RPTTYP##PERF|| ||") to select this element
> > in
> > > > the
> > > > > list.
>
> > > > > I hope this helps, if it doesn't let us know, whether the page on
> > which
> > > > you
> > > > > are working is available publicly or no...
>
> > > > > Regards
> > > > > Pallavi.
>
> > > > > 2010/8/14 sudhir 
>
> >

[wtr-general] Re: How to select a item from the dropbox

2010-08-16 Thread sudhir
yes pallavi. My application has different frame

On Aug 16, 2:40 pm, Pallavi Sharma  wrote:
> No Sudhir
>
> You are getting this exception for all objects in your application. remove
> all code and just try the setting user id,
>
> Does your application has frames...?
>
> Regards
> Pallavi.
>
> On Mon, Aug 16, 2010 at 2:42 PM, sudhir  wrote:
> > require 'watir'
> >  test_site = '.'
>
> > b = Watir::Browser.new
>
> >  b.goto(test_site)
> >  b.text_field(:name, "userID").set("sudhikumar")
> >  b.text_field(:name, "password").set("jpm")
> >  b.form(:action, "/PM/PMlogin.do").submit
> >  b.frame(:name, "menuMiddle").link(:text, "Performance").click
> >  b.select_list(:name, 'level0').select ("00990")
>
> > b.select_list(:name,'selectedReportDetailsString').select("SecurityPerformance##4##
> > ## || ##RPTTYP##PERF|| ||")
> > => false
> > => "http://newpmr2prod.jpmorgan.com/PM/PMlogin.do";
> > => #
> > => 5.391
> > Watir::Exception::UnknownObjectException: Unable to locate element,
> > using :name, "userID"
> >from
> > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> > 56:in `assert_exists'
> >from
> > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> > 288:in `enabled?'
> >from
> > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> > 60:in `assert_enabled'
> >from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
> > input_elements.rb:327:in `set'
> >from (irb):27
> >from :0
> > Watir::Exception::UnknownObjectException: Unable to locate element,
> > using :name, "password"
> >from
> > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> > 56:in `assert_exists'
> >from
> > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> > 288:in `enabled?'
> >from
> > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> > 60:in `assert_enabled'
> >from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
> > input_elements.rb:327:in `set'
> >from (irb):28
> >from :0
> > Watir::Exception::UnknownFormException: Unable to locate a form using
> > action and /PM/PMlogin.do
> >from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/form.rb:
> > 79:in `assert_exists'
> >from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/form.rb:
> > 86:in `submit'
> >from (irb):29
> >from :0
> > => 1.734
> > Errno::EBADF: Bad file descriptor
> >from (irb):31:in `write'
> > Watir::Exception::UnknownObjectException: Unable to locate element,
> > using :name, "selectedReportDetailsString"
> >from
> > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> > 56:in `assert_exists'
> >from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
> > input_elements.rb:62:in `select_item_in_select_list'
> >from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
> > input_elements.rb:46:in `select'
> >from (irb):32
> >from :0
>
> > I am getting the above error while selecting from the
> > dropbox...
> > Let me know if you require more deatils.
> > The website I want to automate is not public...
>
> > On Aug 16, 11:18 am, Pallavi Sharma  wrote:
> > > Sudhir
>
> > > ie.select_list(:name, 'level0').select ("ITEM you want to select")
>
> > > Regards
>
> > > Pallavi
>
> > > 2010/8/16 sudhir 
>
> > > > Pallavi,
> > > > The select list for ABPorts is given below:
> > > > 
> > onchange="javascript:selectcombo_Report('0','ReportTemplate_Buselect',this.form)"
> > > > class="select-menut">- Select
> > > > One -
> > > > ABC Company
> > > > ABPorts
> > > > Washington State Investment Board
> > > > Wellcome Trust
>
> > > > Thanks for your help
>
> > > > On Aug 14, 4:19 pm, Pallavi Sharma  wrote:
> > > > > Sudhir
>
> > > > > For ABPorts, give the complete select list html code, for the other
> > one:
>
> > > > >  > > > > onchange="javascript:submitReportTypes('<
> > > > > %=WebOperation.REPORTTEMPLATE_REPORT_SELECT%>');" class="select-
> > > > > menu180"> > > > > selected="selected">- Select One -
> > > > > Performance by Dimension
> > > > > Historical Summary
> > > > > Index Performance
> > > > > Security Performance
>
> > browser.select_list(:name,'selectedReportDetailsString').select("Security
> > > > > Performance##4## ## || ##RPTTYP##PERF|| ||") to select this element
> > in
> > > > the
> > > > > list.
>
> > > > > I hope this helps, if it doesn't let us know, whether the page on
> > which
> > > > you
> > > > > are working is available publicly or no...
>
> > > > > Regards
> > > > > Pallavi.
>
> > > > > 2010/8/14 sudhir 
>
> > > > > > Hi All,
> > > > > > Here is another select list from which I have to select
> > "Performance
> > > > > > by Dimension" Can you Guide about it.
>
> > > > > >  > > > > > onchange="javascript:submitReportTypes('<
> > > > > > %=WebOperation.REPORTTEMPLATE_REPORT_SELECT%>');" class="select-
> > > > > > menu180"> > > > > > sel

Re: [wtr-general] Re: How to select a item from the dropbox

2010-08-16 Thread Pallavi Sharma
No Sudhir

You are getting this exception for all objects in your application. remove
all code and just try the setting user id,

Does your application has frames...?


Regards
Pallavi.

On Mon, Aug 16, 2010 at 2:42 PM, sudhir  wrote:

> require 'watir'
>  test_site = '.'
>
> b = Watir::Browser.new
>
>  b.goto(test_site)
>  b.text_field(:name, "userID").set("sudhikumar")
>  b.text_field(:name, "password").set("jpm")
>  b.form(:action, "/PM/PMlogin.do").submit
>  b.frame(:name, "menuMiddle").link(:text, "Performance").click
>  b.select_list(:name, 'level0').select ("00990")
>
>
> b.select_list(:name,'selectedReportDetailsString').select("SecurityPerformance##4##
> ## || ##RPTTYP##PERF|| ||")
> => false
> => "http://newpmr2prod.jpmorgan.com/PM/PMlogin.do";
> => #
> => 5.391
> Watir::Exception::UnknownObjectException: Unable to locate element,
> using :name, "userID"
>from
> C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> 56:in `assert_exists'
>from
> C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> 288:in `enabled?'
>from
> C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> 60:in `assert_enabled'
>from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
> input_elements.rb:327:in `set'
>from (irb):27
>from :0
> Watir::Exception::UnknownObjectException: Unable to locate element,
> using :name, "password"
>from
> C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> 56:in `assert_exists'
>from
> C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> 288:in `enabled?'
>from
> C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> 60:in `assert_enabled'
>from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
> input_elements.rb:327:in `set'
>from (irb):28
>from :0
> Watir::Exception::UnknownFormException: Unable to locate a form using
> action and /PM/PMlogin.do
>from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/form.rb:
> 79:in `assert_exists'
>from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/form.rb:
> 86:in `submit'
>from (irb):29
>from :0
> => 1.734
> Errno::EBADF: Bad file descriptor
>from (irb):31:in `write'
> Watir::Exception::UnknownObjectException: Unable to locate element,
> using :name, "selectedReportDetailsString"
>from
> C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> 56:in `assert_exists'
>from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
> input_elements.rb:62:in `select_item_in_select_list'
>from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
> input_elements.rb:46:in `select'
>from (irb):32
>from :0
>
>
> I am getting the above error while selecting from the
> dropbox...
> Let me know if you require more deatils.
> The website I want to automate is not public...
>
> On Aug 16, 11:18 am, Pallavi Sharma  wrote:
> > Sudhir
> >
> > ie.select_list(:name, 'level0').select ("ITEM you want to select")
> >
> > Regards
> >
> > Pallavi
> >
> > 2010/8/16 sudhir 
> >
> > > Pallavi,
> > > The select list for ABPorts is given below:
> > >  >
> > >
> onchange="javascript:selectcombo_Report('0','ReportTemplate_Buselect',this.form)"
> > > class="select-menut">- Select
> > > One -
> > > ABC Company
> > > ABPorts
> > > Washington State Investment Board
> > > Wellcome Trust
> >
> > > Thanks for your help
> >
> > > On Aug 14, 4:19 pm, Pallavi Sharma  wrote:
> > > > Sudhir
> >
> > > > For ABPorts, give the complete select list html code, for the other
> one:
> >
> > > >  > > > onchange="javascript:submitReportTypes('<
> > > > %=WebOperation.REPORTTEMPLATE_REPORT_SELECT%>');" class="select-
> > > > menu180"> > > > selected="selected">- Select One -
> > > > Performance by Dimension
> > > > Historical Summary
> > > > Index Performance
> > > > Security Performance
> >
> > > >
> browser.select_list(:name,'selectedReportDetailsString').select("Security
> > > > Performance##4## ## || ##RPTTYP##PERF|| ||") to select this element
> in
> > > the
> > > > list.
> >
> > > > I hope this helps, if it doesn't let us know, whether the page on
> which
> > > you
> > > > are working is available publicly or no...
> >
> > > > Regards
> > > > Pallavi.
> >
> > > > 2010/8/14 sudhir 
> >
> > > > > Hi All,
> > > > > Here is another select list from which I have to select
> "Performance
> > > > > by Dimension" Can you Guide about it.
> >
> > > > >  > > > > onchange="javascript:submitReportTypes('<
> > > > > %=WebOperation.REPORTTEMPLATE_REPORT_SELECT%>');" class="select-
> > > > > menu180"> > > > > selected="selected">- Select One -
> > > > > Performance by Dimension
> > > > > Historical Summary
> > > > > Index Performance
> > > > > Security Performance
> >
> > > > > Thanks A Lot for your help
> >
> > > > > On Aug 14, 9:38 am, sudhir  wrote:
> >
> > >
> onchange="javascript:selectcombo_Repo

[wtr-general] Re: How to select a item from the dropbox

2010-08-16 Thread sudhir
require 'watir'
 test_site = '.'

b = Watir::Browser.new

 b.goto(test_site)
 b.text_field(:name, "userID").set("sudhikumar")
 b.text_field(:name, "password").set("jpm")
 b.form(:action, "/PM/PMlogin.do").submit
 b.frame(:name, "menuMiddle").link(:text, "Performance").click
 b.select_list(:name, 'level0').select ("00990")
 
b.select_list(:name,'selectedReportDetailsString').select("SecurityPerformance##4##
## || ##RPTTYP##PERF|| ||")
=> false
=> "http://newpmr2prod.jpmorgan.com/PM/PMlogin.do";
=> #
=> 5.391
Watir::Exception::UnknownObjectException: Unable to locate element,
using :name, "userID"
from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
56:in `assert_exists'
from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
288:in `enabled?'
from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
60:in `assert_enabled'
from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
input_elements.rb:327:in `set'
from (irb):27
from :0
Watir::Exception::UnknownObjectException: Unable to locate element,
using :name, "password"
from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
56:in `assert_exists'
from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
288:in `enabled?'
from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
60:in `assert_enabled'
from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
input_elements.rb:327:in `set'
from (irb):28
from :0
Watir::Exception::UnknownFormException: Unable to locate a form using
action and /PM/PMlogin.do
from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/form.rb:
79:in `assert_exists'
from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/form.rb:
86:in `submit'
from (irb):29
from :0
=> 1.734
Errno::EBADF: Bad file descriptor
from (irb):31:in `write'
Watir::Exception::UnknownObjectException: Unable to locate element,
using :name, "selectedReportDetailsString"
from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
56:in `assert_exists'
from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
input_elements.rb:62:in `select_item_in_select_list'
from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
input_elements.rb:46:in `select'
from (irb):32
from :0


I am getting the above error while selecting from the
dropbox...
Let me know if you require more deatils.
The website I want to automate is not public...

On Aug 16, 11:18 am, Pallavi Sharma  wrote:
> Sudhir
>
> ie.select_list(:name, 'level0').select ("ITEM you want to select")
>
> Regards
>
> Pallavi
>
> 2010/8/16 sudhir 
>
> > Pallavi,
> > The select list for ABPorts is given below:
> > 
> > onchange="javascript:selectcombo_Report('0','ReportTemplate_Buselect',this.form)"
> > class="select-menut">- Select
> > One -
> > ABC Company
> > ABPorts
> > Washington State Investment Board
> > Wellcome Trust
>
> > Thanks for your help
>
> > On Aug 14, 4:19 pm, Pallavi Sharma  wrote:
> > > Sudhir
>
> > > For ABPorts, give the complete select list html code, for the other one:
>
> > >  > > onchange="javascript:submitReportTypes('<
> > > %=WebOperation.REPORTTEMPLATE_REPORT_SELECT%>');" class="select-
> > > menu180"> > > selected="selected">- Select One -
> > > Performance by Dimension
> > > Historical Summary
> > > Index Performance
> > > Security Performance
>
> > > browser.select_list(:name,'selectedReportDetailsString').select("Security
> > > Performance##4## ## || ##RPTTYP##PERF|| ||") to select this element in
> > the
> > > list.
>
> > > I hope this helps, if it doesn't let us know, whether the page on which
> > you
> > > are working is available publicly or no...
>
> > > Regards
> > > Pallavi.
>
> > > 2010/8/14 sudhir 
>
> > > > Hi All,
> > > > Here is another select list from which I have to select "Performance
> > > > by Dimension" Can you Guide about it.
>
> > > >  > > > onchange="javascript:submitReportTypes('<
> > > > %=WebOperation.REPORTTEMPLATE_REPORT_SELECT%>');" class="select-
> > > > menu180"> > > > selected="selected">- Select One -
> > > > Performance by Dimension
> > > > Historical Summary
> > > > Index Performance
> > > > Security Performance
>
> > > > Thanks A Lot for your help
>
> > > > On Aug 14, 9:38 am, sudhir  wrote:
>
> > onchange="javascript:selectcombo_Report('0','ReportTemplate_Buselect',this.form)"
> > > > > class="select-menut">- Select
> > > > > One -
> > > > > ABC Company
> > > > > ABC-GBP
> > > > > ABPorts
> > > > > ABS Combined
>
> > > > > I want to select from the drop box like ABPorts. can you please Guide
> > > > > Thanks Lot for your help
>
> > > > > On Aug 9, 10:06 pm, Chuck van der Linden  wrote:
>
> > > > > > If the below does not work, then use the IE Developer Toolbar, or
> > > > > > Firebug, to have a look at the element to see if it is really an
> > HT

Re: [wtr-general] Extracting String from a node / (String Function)

2010-08-16 Thread Pallavi Sharma
Hi Cyril

The return you are getting is right, as the div, contains all the text.

Try this:

require 'watir'
ie=Watir::IE.attach(:title,//)
a=ie.div(:id,'answer_text').text
b=a.split("Text - How useful was my answer?")
puts b[0].strip


Regards
Pallavi.


On Mon, Aug 16, 2010 at 1:43 PM, cyril.gonsal...@mastek.com <
cyril.gonsal...@mastek.com> wrote:

> Hi,
>
> I want the text "Condition with main rank 1 and subrank upto 20 is
> working" from the div tag.
>
> Source HTML :
>
> 
> Text - Condition with main rank 1 and subrank upto 20 is working
> 
> 
> 
> Text - How useful was my answer?
> 
> 
>
> I have written below code to extract text from above Page :
>
> ans_txt = ie.div(:id,"answer_text").text
>
> But this returns to me :
>
> "Condition with main rank 1 and subrank upto 20 is working
>
>
> How useful was my answer?"
>
>
> Is there any way thru which i can retrive only the required test
>
> I took another approach also.
>
> I took exntire answer text and wrote code below
>
> extra_txt_pos = ans_txt.rindex('How useful was my answer?')
>
> here i get the startup position on the text "How useful was my
> answer?". But then i am not finding any string function which would
> then eliminate the above string from the whole text.
>
> please reply
>
>
> --
> 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
>

-- 
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] unable to find element using xpath

2010-08-16 Thread Angrez Singh
Hi Goutham,

Please check the unit test cases for Watir you'll find example on how to
access map/area element using XPath. It should be there in [ruby
installation directory]\gems\1.8\firewatir-1.6.5\unittests.

Thanks,
Angrez

On Mon, Aug 16, 2010 at 9:09 AM, goutham mandadi
wrote:

> hai basim,
>
> below is the code
> 
> http://www.snapfish.com/snapfish/selectalbumreprints/"; title=" 
> Order prints " coords="9,53,113,72">
>
>
> 
>
> 
> how can we identify these elements by using xpath
>
>
> On Mon, Aug 16, 2010 at 12:20 AM, Basim Baassiri wrote:
>
>> Hi Goutham
>> You'll need to post some code and some html to illustrate better your
>> problem
>>
>>
>> On Sun, Aug 15, 2010 at 11:22 AM, goutham wrote:
>>
>>> hai all,
>>>
>>> i am using element_by_xpath to find an element in watir but browser is
>>> closing when i come to xpath step. does we need to install anything to
>>> find element using xpath . waiting for ur suggestions
>>>
>>> Thankyou,
>>> Goutham
>>>
>>> --
>>> 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
>>>
>>
>>  --
>> 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
>>
>
>  --
> 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
>

-- 
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] Extracting String from a node / (String Function)

2010-08-16 Thread cyril.gonsal...@mastek.com
Hi,

I want the text "Condition with main rank 1 and subrank upto 20 is
working" from the div tag.

Source HTML :


Text - Condition with main rank 1 and subrank upto 20 is working



Text - How useful was my answer?



I have written below code to extract text from above Page :

ans_txt = ie.div(:id,"answer_text").text

But this returns to me :

"Condition with main rank 1 and subrank upto 20 is working


How useful was my answer?"


Is there any way thru which i can retrive only the required test

I took another approach also.

I took exntire answer text and wrote code below

extra_txt_pos = ans_txt.rindex('How useful was my answer?')

here i get the startup position on the text "How useful was my
answer?". But then i am not finding any string function which would
then eliminate the above string from the whole text.

please reply


-- 
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