[wtr-general] How to click on a button inside a modal dialog

2014-08-07 Thread sudhir ranjan swain
I want to access different elements in a dialog box which opens after 
clicking on a button in page.For example i want to check a radio 
button,entering text ,clicking on button and then close the dialog window.

Below is the code:

div class=ui-dialog-content ui-widget-content style=width: auto; 
min-height: 0px; height: 804.267px;iframe width=760px height=800 
frameborder=0 
src=/apex/PreInstall_Notes?ContractID=800f0006SVSLangCode=USEOrder=FalseAccountId=001f00dea7Z#document!DOCTYPE
 
html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN 
http://www.w3.org/TR/html4/loose.dtd;htmlhead … /headbodyform 
id=j_id0:j_id31 enctype=application/x-www-form-urlencoded 
action=https://c.cs16.visual.force.com/apex/PreInstall_Notes; 
method=post name=j_id0:j_id31input type=hidden value=j_id0:j_id31 
name=j_id0:j_id31/inputscript … /scriptdiv class=apexpdiv 
class=individualPalettediv class=accountBlockdiv 
id=j_id0:j_id31:thePageBlock class=bPageBlock brandSecondaryBrd 
apexDefaultPageBlock secondaryPalettediv class=pbHeader … /divdiv 
class=pbBodyspan id=j_id0:j_id31:thePageBlock:j_id33/spandiv 
class=tableHead … /divbr/brspan 
id=j_id0:j_id31:thePageBlock:j_id60table 
class=tableCommontbodytr … /trtrtd class=lblQuestions … 
/tdtd … /td/trtr … /trtr … /trtr … /trtr … /trtr 
… /trtr … /trtr … /trtr … /trtr id=groupDetailSection 
style=display: none; … /trtr … /trtr … /trtr … /trtr … 
/trtr … /trtr … /trtr … /trtr id=AEProvidedFloorPlan_ERB 
style=display: none; … /trtr … 
/tr/tbody/table/span/divdiv class=pbBottomButtons … 
/divdiv class=pbFooter secondaryPalette … 
/div/div/div/div/divdiv 
id=j_id0:j_id31:j_id327/div/formspan 
id=ajax-view-state-page-container style=display: none … /spanscript 
type=text/javascript … /scriptdiv id=datePicker class=datePicker 
… /div/body/html/iframe/div/divdiv class=ui-widget-overlay 
style=width: 1349px; height: 4172px; z-index: 1001;/div/body/html

Below is the html code for a button which i want to click inside that 
dialog window.Just want to know how to switch to the dialog window and 
perform on it.

td id=j_id0:j_id31:thePageBlock:j_id32 class=pbButton input 
id=j_id0:j_id31:thePageBlock:j_id32:btnSave class=btn type=submit 
value=Save name=j_id0:j_id31:thePageBlock:j_id32:btnSave/inputinput 
id=j_id0:j_id31:thePageBlock:j_id32:btnCancel class=btn type=submit 
onclick=closePopupWindow(); value=Cancel 
name=j_id0:j_id31:thePageBlock:j_id32:btnCancel/input

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2010-08-24 Thread sudhir
Hi Chuck,

I tired with ur options and found that is sometimes able to select the
level0 and its value but sometime not.
have you faced this weird behavior . Can you please guide.
the code I am using is below.
require 'watir'
 test_site = 'http://newpmr2prod.jpmorgan.com/PM/PMlogin.do'
 b = Watir::Browser.new
 username='sudhikumar'
 pwd='jpm'
 b.goto(test_site)
 b.text_field(:name, 'userID').set(username)
 b.text_field(:name, 'password').set(pwd)
 b.form(:action, '/PM/PMlogin.do').submit
 b.frame(:name, 'menuMiddle').link(:text, 'Performance').click
 bu='ABPorts'
 level='level0'
 b.frame(:name, 'rightFrame2').select_list(:name,level).select(bu)


Thanks for ur help

On Aug 23, 10:36 pm, Chuck van der Linden sqa...@gmail.com wrote:
 b.frame(:name, 'rightFrame2').select_list(:name,level).set(bu)

 1)  You might want to try using .select  instead of .set    You might
 also want to first clear any selected items using .clearSelection

 2)  The value for the method is invalid, none of the option value
 tags for that list have '00907' as a label (nor a value to be
 returned).  And note that select lists are normally selected by the
 visible label that the user would see, not the value that selection
 returns on form submission.   So use bu=ABPorts or something similar
 to that.

 3) it's not finding the element, and based on your code identifying it
 via :name, level0 ought to work, so that means there's some other
 problem, are you sure you have the right frame?  that it's not say
 rightFrame1 perhaps?

 4) I notice there's an onchange event bound to that selection list
 element, so you might need to fire that event against the selection
 list after you've changed which item in the list is selected

 b.frame(:name,
 'rightFrame1').select_list(:name,level).fire_event('onchange')

 5)  From a code readability standpoint, it's a lot more direct to just
 use something like

 b.frame(:name, 'rightFrame1').select_list(:name,
 'level0').select('ABPorts')

 rather than using variables which has the effect of forcing someone
 trying to read the code to go look and see where the variable was
 assigned, or else memorize those assignments.   Otherwise if you want
 to use variables like that, assign them at the last possible instant
 so it's clearer to someone reading your code what the values are.

 On Aug 22, 11:17 pm, sudhir prem...@gmail.com wrote:

   require 'watir'
   test_site = 'http://newpmr2prod.jpmorgan.com/PM/PMlogin.do'
   b = Watir::Browser.new
   username='sudhikumar'
   pwd='jpm'
  level='level0'
   bu='00907'
   b.goto(test_site)
   b.text_field(:name, 'userID').set(username)
   b.text_field(:name, 'password').set(pwd)
   b.form(:action, '/PM/PMlogin.do').submit
   b.frame(:name, 'menuMiddle').link(:text, 'Performance').click
   b.frame(:name, 'rightFrame2').select_list(:name,level).set(bu)
  = false
  = http://newpmr2prod.jpmorgan.com/PM/PMlogin.do;
  = #Watir::IE:0xc752478 url=about:blank title=
  = sudhikumar
  = jpm
  = level0
  = 00907
  = 6.37
  = 
  = 
  = 5.137
  = 1.468
  Watir::Exception::UnknownObjectException: Unable to locate element,
  using :name, level0
          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 `set'
          from (irb):136
          from :0

  !

  html
          head
                  titleJPM PM system/title

  base href=http://newpmr2prod.jpmorgan.com:80/PM/;

  script language='javascript'
          history.go(1);
  /script

  script language=javascript src=./includes/common/TimerDiv.js/
  script
  link rel=stylesheet href=./stylesheet.css type=text/css

                  script language=javascript 
  src=./includes/common/lib_func.js/
  script
                  script language=javascript 
  src=./includes/common/common.js/
  script
                  script language=javascript src=./includes/common/
  lib_submitfrm.js/script
                  script language=javascript 
  src=./includes/reporttemplate/perf/
  perftemplateview.js/script
                  script language=javascript
                          var isTemplateAvbl = false;
                          function submitReportTypes(mode){
                                  var selectIndex =
  document.forms[0].selectedReportDetailsString.selectedIndex;
  parent.rightFrame2.document.forms[0].reportDetailsString.value=parent.right 
  Frame2.document.forms[0].selectedReportDetailsString.options[selectIndex].v 
  alue;

  parent.rightFrame2.document.forms[0].operation.value=ReportTemplate_Report 
  select;
                                  
  parent.rightFrame2.document.forms[0].submit();
                          }

                  function changetext(whichcontent,i){
                          if (document.all||document.getElementById

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

2010-08-23 Thread sudhir
/head

body class=FormBackground leftmargin=0 topmargin=0
marginwidth=0 marginheight=0
form name=ReportTemplateListBean method=POST action=/PM/
perfreporttemplate.do
input type=hidden name=selectedLevel value=0
input type=hidden name=dimensionVOString value=
input type=hidden name=reportDetailsString 
value=
input type=hidden name=reportType value=
input type=hidden name=currentUser 
value=sudhikumar
input type=hidden name=PERF_BY_DIM 
value=Performance by
Dimension
input type=hidden name=buMigStatus value=
input type=hidden name=reportMode value=

input type=hidden name=roleId value=PS

script language=javascript

parent.rightFrame1.location.href=./perfreporttemplateButton.do;
/script
center


/center

center




/center

br
table class=innertablewidth border =0 
cellspacing=0
cellpadding=0 width=100%

   input type=hidden name=operation value=


tr align=left
td class=label colspan=2
Business Unitfont 
face=verdana,arial,helvetica size=1
color=#FF/font
/td
/tr

tr align=left
 td class=label width=18.5% 
 Level Onefont 
face=verdana,arial,helvetica size=1
color=#FF*/font
 /td


 td align=left width=81.5%
 font 
face=verdana,arial,helvetica size=2 color=#FF
 select name=level0 
width=300
onchange=javascript:selectcombo_Report('0','ReportTemplate_Buselect',this.form)
class=select-menutoption value=-1 selected=selected- Select
One -/option
option value=DEMO-00908ABC Company/option
option value=DEMO-UK016ABC-GBP/option
option value=00901ABPorts/option
option value=ABSCOMBINEDABS Combined/option
option value=BU5514ADP DC and DB Plans/option
option value=03354Advance Publications/option
option value=04252Alcon Laboratories/option
option value=04253Alcon-Puerto Rico Active Balanced Fund/option
option value=03031Allen and Company/option


I have given the details and still I am unable to select from
selectlist

Thanks for your help

On Aug 17, 6:43 am, Pallavi Sharma write2pall...@gmail.com wrote:
 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 sqa...@gmail.comwrote:

  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 prem...@gmail.com wrote:
   require 'watir

[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;
= #Watir::IE:0xdc87230 url=about:blank title=
= 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 write2pall...@gmail.com wrote:
 Sudhir

 ie.select_list(:name, 'level0').select (ITEM you want to select)

 Regards

 Pallavi

 2010/8/16 sudhir prem...@gmail.com

  Pallavi,
  The select list for ABPorts is given below:
  select name=level0 width=300

  onchange=javascript:selectcombo_Report('0','ReportTemplate_Buselect',this.form)
  class=select-menutoption value=-1 selected=selected- Select
  One -/option
  option value=DEMO-00908ABC Company/option
  option value=00901ABPorts/option
  option value=05245Washington State Investment Board/option
  option value=00990Wellcome Trust/option

  Thanks for your help

  On Aug 14, 4:19 pm, Pallavi Sharma write2pall...@gmail.com wrote:
   Sudhir

   For ABPorts, give the complete select list html code, for the other one:

   select name=selectedReportDetailsString size=1
   onchange=javascript:submitReportTypes('
   %=WebOperation.REPORTTEMPLATE_REPORT_SELECT%'); class=select-
   menu180option value=- Select One -##-1## ## || || || 
   selected=selected- Select One -/option
   option value=Performance by Dimension##1## ## || ##RPTTYP##PERF|| ||
   Performance by Dimension/option
   option value=Historical Summary##2## ## || ##RPTTYP##PERF|| ||
   Historical Summary/option
   option value=Index Performance##3## ## || ##RPTTYP##PERF|| ||
   Index Performance/option
   option value=Security Performance##4## ## || ##RPTTYP##PERF|| ||
   Security Performance/option/select

   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 prem...@gmail.com

Hi All,
Here is another select list from which I have to select Performance
by Dimension Can you Guide about it.

select name=selectedReportDetailsString size=1
onchange=javascript:submitReportTypes('
%=WebOperation.REPORTTEMPLATE_REPORT_SELECT%'); class=select-
menu180option value=- Select One -##-1## ## || || || 
selected=selected- Select One -/option
option value=Performance by Dimension##1## ## || ##RPTTYP##PERF|| ||
Performance by Dimension/option
option value=Historical Summary##2

[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 write2pall...@gmail.com 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 prem...@gmail.com 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;
  = #Watir::IE:0xdc87230 url=about:blank title=
  = 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 write2pall...@gmail.com wrote:
   Sudhir

   ie.select_list(:name, 'level0').select (ITEM you want to select)

   Regards

   Pallavi

   2010/8/16 sudhir prem...@gmail.com

Pallavi,
The select list for ABPorts is given below:
select name=level0 width=300

  onchange=javascript:selectcombo_Report('0','ReportTemplate_Buselect',this.form)
class=select-menutoption value=-1 selected=selected- Select
One -/option
option value=DEMO-00908ABC Company/option
option value=00901ABPorts/option
option value=05245Washington State Investment Board/option
option value=00990Wellcome Trust/option

Thanks for your help

On Aug 14, 4:19 pm, Pallavi Sharma write2pall...@gmail.com wrote:
 Sudhir

 For ABPorts, give the complete select list html code, for the other
  one:

 select name=selectedReportDetailsString size=1
 onchange=javascript:submitReportTypes('
 %=WebOperation.REPORTTEMPLATE_REPORT_SELECT%'); class=select-
 menu180option value=- Select One -##-1## ## || || || 
 selected=selected- Select One -/option
 option value=Performance by Dimension##1## ## || ##RPTTYP##PERF||
  ||
 Performance by Dimension/option
 option value=Historical Summary##2## ## || ##RPTTYP##PERF|| ||
 Historical Summary/option
 option value=Index Performance##3## ## || ##RPTTYP##PERF|| ||
 Index Performance/option
 option value=Security Performance##4## ## || ##RPTTYP##PERF|| ||
 Security Performance/option/select

  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

[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 write2pall...@gmail.com 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 prem...@gmail.com 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;
  = #Watir::IE:0xdc87230 url=about:blank title=
  = 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 write2pall...@gmail.com wrote:
   Sudhir

   ie.select_list(:name, 'level0').select (ITEM you want to select)

   Regards

   Pallavi

   2010/8/16 sudhir prem...@gmail.com

Pallavi,
The select list for ABPorts is given below:
select name=level0 width=300

  onchange=javascript:selectcombo_Report('0','ReportTemplate_Buselect',this.form)
class=select-menutoption value=-1 selected=selected- Select
One -/option
option value=DEMO-00908ABC Company/option
option value=00901ABPorts/option
option value=05245Washington State Investment Board/option
option value=00990Wellcome Trust/option

Thanks for your help

On Aug 14, 4:19 pm, Pallavi Sharma write2pall...@gmail.com wrote:
 Sudhir

 For ABPorts, give the complete select list html code, for the other
  one:

 select name=selectedReportDetailsString size=1
 onchange=javascript:submitReportTypes('
 %=WebOperation.REPORTTEMPLATE_REPORT_SELECT%'); class=select-
 menu180option value=- Select One -##-1## ## || || || 
 selected=selected- Select One -/option
 option value=Performance by Dimension##1## ## || ##RPTTYP##PERF||
  ||
 Performance by Dimension/option
 option value=Historical Summary##2## ## || ##RPTTYP##PERF|| ||
 Historical Summary/option
 option value=Index Performance##3## ## || ##RPTTYP##PERF|| ||
 Index Performance/option
 option value=Security Performance##4## ## || ##RPTTYP##PERF|| ||
 Security Performance/option/select

  browser.select_list(:name

[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 write2pall...@gmail.com 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 write2pall...@gmail.com

  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 prem...@gmail.com

  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 write2pall...@gmail.com 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 prem...@gmail.com 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;
= #Watir::IE:0xdc87230 url=about:blank title=
= 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

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

2010-08-15 Thread sudhir
Pallavi,
The select list for ABPorts is given below:
select name=level0 width=300
onchange=javascript:selectcombo_Report('0','ReportTemplate_Buselect',this.form)
class=select-menutoption value=-1 selected=selected- Select
One -/option
option value=DEMO-00908ABC Company/option
option value=00901ABPorts/option
option value=05245Washington State Investment Board/option
option value=00990Wellcome Trust/option

Thanks for your help

On Aug 14, 4:19 pm, Pallavi Sharma write2pall...@gmail.com wrote:
 Sudhir

 For ABPorts, give the complete select list html code, for the other one:

 select name=selectedReportDetailsString size=1
 onchange=javascript:submitReportTypes('
 %=WebOperation.REPORTTEMPLATE_REPORT_SELECT%'); class=select-
 menu180option value=- Select One -##-1## ## || || || 
 selected=selected- Select One -/option
 option value=Performance by Dimension##1## ## || ##RPTTYP##PERF|| ||
 Performance by Dimension/option
 option value=Historical Summary##2## ## || ##RPTTYP##PERF|| ||
 Historical Summary/option
 option value=Index Performance##3## ## || ##RPTTYP##PERF|| ||
 Index Performance/option
 option value=Security Performance##4## ## || ##RPTTYP##PERF|| ||
 Security Performance/option/select

 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 prem...@gmail.com

  Hi All,
  Here is another select list from which I have to select Performance
  by Dimension Can you Guide about it.

  select name=selectedReportDetailsString size=1
  onchange=javascript:submitReportTypes('
  %=WebOperation.REPORTTEMPLATE_REPORT_SELECT%'); class=select-
  menu180option value=- Select One -##-1## ## || || || 
  selected=selected- Select One -/option
  option value=Performance by Dimension##1## ## || ##RPTTYP##PERF|| ||
  Performance by Dimension/option
  option value=Historical Summary##2## ## || ##RPTTYP##PERF|| ||
  Historical Summary/option
  option value=Index Performance##3## ## || ##RPTTYP##PERF|| ||
  Index Performance/option
  option value=Security Performance##4## ## || ##RPTTYP##PERF|| ||
  Security Performance/option/select

  Thanks A Lot for your help

  On Aug 14, 9:38 am, sudhir prem...@gmail.com wrote:

  onchange=javascript:selectcombo_Report('0','ReportTemplate_Buselect',this.form)
   class=select-menutoption value=-1 selected=selected- Select
   One -/option
   option value=DEMO-00908ABC Company/option
   option value=DEMO-UK016ABC-GBP/option
   option value=00901ABPorts/option
   option value=ABSCOMBINEDABS Combined/option

   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 sqa...@gmail.com 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 HTML
select list, or if it is some other kind of control.

There are often Javascript powered 'section lists' which are enabled
using other types of objects (often an ordered list) and a lot of
javascript eventing.   In that case you typically have to use click
methods on the elements the control is created from, or sometimes fire
specfic events like 'onmouseover' followed by clicks, in order to
activate the control.

There are several existing threads on dealing with those kind of
controls, which would bear searching for and reading if you find
yourself in that situation

On Aug 9, 1:45 am, Željko Filipin zeljko.fili...@wa-research.ch
wrote:

 On Sun, Aug 8, 2010 at 5:15 PM, sudhir prem...@gmail.com wrote:
  I am trying to select an item from dropbox but could not.

 Take a look:

http://wiki.openqa.org/display/WTR/Selection+Boxes

 Ž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 readhttp://watir.com/support. In short: search
  before you ask, be nice.

  You received this message because you are subscribed to
 http://groups.google.com/group/watir-general
  To post: watir-general@googlegroups.com
  To unsubscribe: 
  watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com

-- 
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-13 Thread sudhir
onchange=javascript:selectcombo_Report('0','ReportTemplate_Buselect',this.form)
class=select-menutoption value=-1 selected=selected- Select
One -/option
option value=DEMO-00908ABC Company/option
option value=DEMO-UK016ABC-GBP/option
option value=00901ABPorts/option
option value=ABSCOMBINEDABS Combined/option

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 sqa...@gmail.com 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 HTML
 select list, or if it is some other kind of control.

 There are often Javascript powered 'section lists' which are enabled
 using other types of objects (often an ordered list) and a lot of
 javascript eventing.   In that case you typically have to use click
 methods on the elements the control is created from, or sometimes fire
 specfic events like 'onmouseover' followed by clicks, in order to
 activate the control.

 There are several existing threads on dealing with those kind of
 controls, which would bear searching for and reading if you find
 yourself in that situation

 On Aug 9, 1:45 am, Željko Filipin zeljko.fili...@wa-research.ch
 wrote:

  On Sun, Aug 8, 2010 at 5:15 PM, sudhir prem...@gmail.com wrote:
   I am trying to select an item from dropbox but could not.

  Take a look:

 http://wiki.openqa.org/display/WTR/Selection+Boxes

  Ž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


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

2010-08-13 Thread sudhir
Hi All,
Here is another select list from which I have to select Performance
by Dimension Can you Guide about it.

select name=selectedReportDetailsString size=1
onchange=javascript:submitReportTypes('
%=WebOperation.REPORTTEMPLATE_REPORT_SELECT%'); class=select-
menu180option value=- Select One -##-1## ## || || || 
selected=selected- Select One -/option
option value=Performance by Dimension##1## ## || ##RPTTYP##PERF|| ||
Performance by Dimension/option
option value=Historical Summary##2## ## || ##RPTTYP##PERF|| ||
Historical Summary/option
option value=Index Performance##3## ## || ##RPTTYP##PERF|| ||
Index Performance/option
option value=Security Performance##4## ## || ##RPTTYP##PERF|| ||
Security Performance/option/select


Thanks A Lot for your help

On Aug 14, 9:38 am, sudhir prem...@gmail.com wrote:
 onchange=javascript:selectcombo_Report('0','ReportTemplate_Buselect',this.form)
 class=select-menutoption value=-1 selected=selected- Select
 One -/option
 option value=DEMO-00908ABC Company/option
 option value=DEMO-UK016ABC-GBP/option
 option value=00901ABPorts/option
 option value=ABSCOMBINEDABS Combined/option

 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 sqa...@gmail.com 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 HTML
  select list, or if it is some other kind of control.

  There are often Javascript powered 'section lists' which are enabled
  using other types of objects (often an ordered list) and a lot of
  javascript eventing.   In that case you typically have to use click
  methods on the elements the control is created from, or sometimes fire
  specfic events like 'onmouseover' followed by clicks, in order to
  activate the control.

  There are several existing threads on dealing with those kind of
  controls, which would bear searching for and reading if you find
  yourself in that situation

  On Aug 9, 1:45 am, Željko Filipin zeljko.fili...@wa-research.ch
  wrote:

   On Sun, Aug 8, 2010 at 5:15 PM, sudhir prem...@gmail.com wrote:
I am trying to select an item from dropbox but could not.

   Take a look:

  http://wiki.openqa.org/display/WTR/Selection+Boxes

   Ž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


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

2010-08-09 Thread sudhir
Hi All,
I am trying to select an item from dropbox but could not.
Can you provide details regarding that

Thanks

-- 
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] Regarding watir framework

2010-07-22 Thread sudhir
Hi All,
I am new to the watir. can you provide details how to create watir
framework.

Even I am facing some issue with installation .
I am following the below step:
1  Download and install Ruby
   rubyinstaller-1.8.6-p398-rc2.exe
2  From the command prompt, C:\Users\107522gem
3  From the same command prompt C:\Users\107522gem update --
system -p http://155.180.8.96:8080

Can you guide what should be there for http://155.180.8.96:8080

4  From the same command prompt , C:\Users\107522gem install watir  -
p http://155.180.8.96:8080

It got install but dont have idea how to use.

Let me know if you require more deatils.

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