[wtr-general] Data Driven testing

2010-12-06 Thread Kay
Hi all,

I have a project requirement to test an application by logging in with
different user types. The test data is provided by a seperate data
team to us in the form of excel spreadsheet as we do not have control
of the test environment databases.

These are data can be used only once(due to state change) and we need
to mark them as burned somehow in the excel sheet. The question is how
do we do this...any suggestions please?

Many thanks,
Kay

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

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


[wtr-general] Re: How to select a value from a drop down list

2010-12-06 Thread Karthik
browser.select_list(:id, gender).set(Male)

or to be specfic

browser.select_list(:id=gender, :name=gender).set(Male)

Hope this helps.

Kay


On Dec 4, 11:00 am, Sudeep sudeeppattn...@gmail.com wrote:
 Hi,

 Please can you let me know how to select a value from the drop down
 list through WATIR script?

 The HTML is as follows.

 div class=row  id=genderFld
           label class=label for=gendercollectionGender/label
           div class=collection id=gendercollection

                select title=Gender class= id=gender
 name=gender
                     option value= SELECTED - Select One -/option
                     option title=m value=m  Male/option
                     option title=f value=f  Female/option
                /select
           /div
            div class=msgContainer

                div class=icon/div
                p id=genderFldMsg/p
            /div

 Regards,
 Sudeep

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

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


[wtr-general] Re: How to select a value from a drop down list

2010-12-06 Thread Karthik
browser.select_list(:id, gender).set(Male)

or to be specfic

browser.select_list(:id=gender, :name=gender).set(Male)

Hope this helps.

Kay


On Dec 4, 11:00 am, Sudeep sudeeppattn...@gmail.com wrote:
 Hi,

 Please can you let me know how to select a value from the drop down
 list through WATIR script?

 The HTML is as follows.

 div class=row  id=genderFld
           label class=label for=gendercollectionGender/label
           div class=collection id=gendercollection

                select title=Gender class= id=gender
 name=gender
                     option value= SELECTED - Select One -/option
                     option title=m value=m  Male/option
                     option title=f value=f  Female/option
                /select
           /div
            div class=msgContainer

                div class=icon/div
                p id=genderFldMsg/p
            /div

 Regards,
 Sudeep

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

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


Re: [wtr-general] Data Driven testing

2010-12-06 Thread Željko Filipin
On Sun, Dec 5, 2010 at 10:58 PM, Kay karthigaya...@gmail.com wrote:
 The test data is provided by a seperate data
 team to us in the form of excel spreadsheet

Watir just drives browser(s). It does not know anything about Excel. There
are other tools that know about it, for example roo[1].

Watir is just a Ruby library (Ruby is programming language). Google for
excel ruby (without quotes) and you will probably find something.

[1] http://roo.rubyforge.org/

Željko
--
watir.com - community manager
watirpodcast.com - host
testingpodcast.com - audio podcasts on software testing. all of them

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

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


Re: [wtr-general] Re: Recent Stack Overflow Questions Tagged Watir

2010-12-06 Thread Željko Filipin
http://stackoverflow.com/questions/4356281/how-do-i-use-watirwaiterwait-until-to-force-chrome-to-wait

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

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


[wtr-general] Unable to identify the object error

2010-12-06 Thread Sudeep
Hi,

I am getting the following error while setting a value to the drop
down list.

Watir Script :
browser.select_list(:name,ModuleID).set(Audits)


HTML Code:

select style=display:inline; sourcetype:module; targetid:divModule;
font-size: 8pt; COLOR: #33; font-family: Verdana; width:280px
onchange=populateDIV(this); ModuleID_onChange();

onmouseout=hidePathOnPop();this.style.textDecoration='none';this.style.color
='#00';

onmouseover=this.style.textDecoration='underline';this.style.color
='#0033CC';
 id=ModuleID name=ModuleID  class=sysNavbarActiveSearch size=1


option value=cap
lt; Module gt;/option

option value=13nbsp;nbsp;nbsp;Audits
option value=19nbsp;nbsp;nbsp;Document Control
option value=83nbsp;nbsp;nbsp;Master Incident
option value=917nbsp;nbsp;nbsp;mdole
option value=915nbsp;nbsp;nbsp;Module12
option value=916nbsp;nbsp;nbsp;Module123
option value=9nbsp;nbsp;nbsp;Operational Control
option value=909nbsp;nbsp;nbsp;play8
option value=80nbsp;nbsp;nbsp;Quality Nonconformance
option value=70nbsp;nbsp;nbsp;Standard Nonconformance
/select


Error in the console :

C:/Ruby186/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/element.rb:
58:in `assert_exists': Unable to locate element, using :name,
ModuleID Watir::Exception::UnknownObjectException)
from C:/Ruby186/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/
input_eleme
nts.rb:64:in `select_item_in_select_list'
from C:/Ruby186/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/
input_eleme
nts.rb:48:in `set'
from Intelex_Audit_1.txt:11


I am not able to find the reason why is it not able to find the Object
with name ModuleId whereas in the HTML it is clearly mentioned as
the name.

Please can you help me out?

Regards,
Sudeep

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

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


Re: [wtr-general] Unable to identify the object error

2010-12-06 Thread Prajakta Jadhav
Try using value of the option instead of label.
E.g: browser.select_list(:name,ModuleID).set(13)

-Prajakta

On Mon, Dec 6, 2010 at 7:12 PM, Sudeep sudeeppattn...@gmail.com wrote:

 Hi,

 I am getting the following error while setting a value to the drop
 down list.

 Watir Script :
 browser.select_list(:name,ModuleID).set(Audits)


 HTML Code:

 select style=display:inline; sourcetype:module; targetid:divModule;
 font-size: 8pt; COLOR: #33; font-family: Verdana; width:280px
 onchange=populateDIV(this); ModuleID_onChange();


 onmouseout=hidePathOnPop();this.style.textDecoration='none';this.style.color
 ='#00';

 onmouseover=this.style.textDecoration='underline';this.style.color
 ='#0033CC';
  id=ModuleID name=ModuleID  class=sysNavbarActiveSearch size=1
 

 option value=cap
 lt; Module gt;/option

 option value=13nbsp;nbsp;nbsp;Audits
 option value=19nbsp;nbsp;nbsp;Document Control
 option value=83nbsp;nbsp;nbsp;Master Incident
 option value=917nbsp;nbsp;nbsp;mdole
 option value=915nbsp;nbsp;nbsp;Module12
 option value=916nbsp;nbsp;nbsp;Module123
 option value=9nbsp;nbsp;nbsp;Operational Control
 option value=909nbsp;nbsp;nbsp;play8
 option value=80nbsp;nbsp;nbsp;Quality Nonconformance
 option value=70nbsp;nbsp;nbsp;Standard Nonconformance
 /select


 Error in the console :

 C:/Ruby186/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/element.rb:
 58:in `assert_exists': Unable to locate element, using :name,
 ModuleID Watir::Exception::UnknownObjectException)
from C:/Ruby186/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/
 input_eleme
 nts.rb:64:in `select_item_in_select_list'
from C:/Ruby186/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/
 input_eleme
 nts.rb:48:in `set'
from Intelex_Audit_1.txt:11


 I am not able to find the reason why is it not able to find the Object
 with name ModuleId whereas in the HTML it is clearly mentioned as
 the name.

 Please can you help me out?

 Regards,
 Sudeep

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


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

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


Re: [wtr-general] Unable to identify the object error

2010-12-06 Thread sudeep pattnaik
Hi Prajakta,

It did not work out :( :( .

Sudeep

On Mon, Dec 6, 2010 at 7:16 PM, Prajakta Jadhav
jadhav.praja...@gmail.comwrote:

 Try using value of the option instead of label.
 E.g: browser.select_list(:name,ModuleID).set(13)

 -Prajakta


 On Mon, Dec 6, 2010 at 7:12 PM, Sudeep sudeeppattn...@gmail.com wrote:

 Hi,

 I am getting the following error while setting a value to the drop
 down list.

 Watir Script :
 browser.select_list(:name,ModuleID).set(Audits)


 HTML Code:

 select style=display:inline; sourcetype:module; targetid:divModule;
 font-size: 8pt; COLOR: #33; font-family: Verdana; width:280px
 onchange=populateDIV(this); ModuleID_onChange();


 onmouseout=hidePathOnPop();this.style.textDecoration='none';this.style.color
 ='#00';

 onmouseover=this.style.textDecoration='underline';this.style.color
 ='#0033CC';
  id=ModuleID name=ModuleID  class=sysNavbarActiveSearch size=1
 

 option value=cap
 lt; Module gt;/option

 option value=13nbsp;nbsp;nbsp;Audits
 option value=19nbsp;nbsp;nbsp;Document Control
 option value=83nbsp;nbsp;nbsp;Master Incident
 option value=917nbsp;nbsp;nbsp;mdole
 option value=915nbsp;nbsp;nbsp;Module12
 option value=916nbsp;nbsp;nbsp;Module123
 option value=9nbsp;nbsp;nbsp;Operational Control
 option value=909nbsp;nbsp;nbsp;play8
 option value=80nbsp;nbsp;nbsp;Quality Nonconformance
 option value=70nbsp;nbsp;nbsp;Standard Nonconformance
 /select


 Error in the console :

 C:/Ruby186/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/element.rb:
 58:in `assert_exists': Unable to locate element, using :name,
 ModuleID Watir::Exception::UnknownObjectException)
from C:/Ruby186/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/
 input_eleme
 nts.rb:64:in `select_item_in_select_list'
from C:/Ruby186/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/
 input_eleme
 nts.rb:48:in `set'
from Intelex_Audit_1.txt:11


 I am not able to find the reason why is it not able to find the Object
 with name ModuleId whereas in the HTML it is clearly mentioned as
 the name.

 Please can you help me out?

 Regards,
 Sudeep

 --
 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.comhttp://groups.google.com/group/watir-generalwatir-general+unsubscr...@googlegroups.com


  --
 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.comwatir-general%2bunsubscr...@googlegroups.com


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

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


Re: [wtr-general] Unable to identify the object error

2010-12-06 Thread Željko Filipin
On Mon, Dec 6, 2010 at 2:42 PM, Sudeep sudeeppattn...@gmail.com wrote:
 browser.select_list(:name,ModuleID).set(Audits)
 option value=13nbsp;nbsp;nbsp;Audits

Maybe one of these would work:

browser.select_list(:name,ModuleID).set(   Audits)
browser.select_list(:name,ModuleID).set(/Audits/)

Does this flash the select list?

browser.select_list(:name,ModuleID).flash

Is the select list on the page? Maybe it appears later, or it is hidden.

Željko

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

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


Re: [wtr-general] Unable to identify the object error

2010-12-06 Thread sudeep pattnaik
Hi Željko,

You are right. when the page is loaded, the select is there and the value in
it is none and by default it gets set to Operational Control in a span
of 2 secs.

So I think I have to make the control wait for the time till the value gets
changed to Operational Control and then set it to Audits.

Sudeep.

On Mon, Dec 6, 2010 at 7:22 PM, Željko Filipin 
zeljko.fili...@wa-research.ch wrote:

 On Mon, Dec 6, 2010 at 2:42 PM, Sudeep sudeeppattn...@gmail.com wrote:
  browser.select_list(:name,ModuleID).set(Audits)
  option value=13nbsp;nbsp;nbsp;Audits

 Maybe one of these would work:


 browser.select_list(:name,ModuleID).set(   Audits)
 browser.select_list(:name,ModuleID).set(/Audits/)

 Does this flash the select list?

 browser.select_list(:name,ModuleID).flash

 Is the select list on the page? Maybe it appears later, or it is hidden.

 Željko

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

 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com


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

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


[wtr-general] Re: Data Driven testing

2010-12-06 Thread Kay
Thanks Zelijko, will look at it.

Cheers,
Kay

On Dec 6, 9:34 am, Željko Filipin zeljko.fili...@wa-research.ch
wrote:
 On Sun, Dec 5, 2010 at 10:58 PM, Kay karthigaya...@gmail.com wrote:
  The test data is provided by a seperate data
  team to us in the form of excel spreadsheet

 Watir just drives browser(s). It does not know anything about Excel. There
 are other tools that know about it, for example roo[1].

 Watir is just a Ruby library (Ruby is programming language). Google for
 excel ruby (without quotes) and you will probably find something.

 [1]http://roo.rubyforge.org/

 Željko
 --
 watir.com - community manager
 watirpodcast.com - host
 testingpodcast.com - audio podcasts on software testing. all of them

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

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


[wtr-general] Re: Data Driven testing

2010-12-06 Thread Dave McNulla
Kay,

I would recommend against validating data unless it's absolutely
necessary. You should be able to submit the data that will support the
test you are running then you run the test, then you clean up the
data. The first and last steps may be done through sql commands, API
calls, or web services calls. What does this give you? Knowledge that
failures are in the software and not in the a change to the sample
data. You also don't have to worry about burned data, which could
be quite the problem if you are working in getting your tests right to
begin with.

Of course that depends on cooperation and trust in the test teams.

Good luck,

Dave

On Dec 6, 6:19 am, Kay karthigaya...@gmail.com wrote:
 Thanks Zelijko, will look at it.

 Cheers,
 Kay

 On Dec 6, 9:34 am, Željko Filipin zeljko.fili...@wa-research.ch
 wrote:







  On Sun, Dec 5, 2010 at 10:58 PM, Kay karthigaya...@gmail.com wrote:
   The test data is provided by a seperate data
   team to us in the form of excel spreadsheet

  Watir just drives browser(s). It does not know anything about Excel. There
  are other tools that know about it, for example roo[1].

  Watir is just a Ruby library (Ruby is programming language). Google for
  excel ruby (without quotes) and you will probably find something.

  [1]http://roo.rubyforge.org/

  Željko
  --
  watir.com - community manager
  watirpodcast.com - host
  testingpodcast.com - audio podcasts on software testing. all of them

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

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


[wtr-general] Re: Data Driven testing

2010-12-06 Thread Kay
Cheers Dave.

@Zelijko: cannot use Roo as I am using Jruby.

Cheers,
Kay

On Dec 6, 2:32 pm, Dave McNulla mcnu...@gmail.com wrote:
 Kay,

 I would recommend against validating data unless it's absolutely
 necessary. You should be able to submit the data that will support the
 test you are running then you run the test, then you clean up the
 data. The first and last steps may be done through sql commands, API
 calls, or web services calls. What does this give you? Knowledge that
 failures are in the software and not in the a change to the sample
 data. You also don't have to worry about burned data, which could
 be quite the problem if you are working in getting your tests right to
 begin with.

 Of course that depends on cooperation and trust in the test teams.

 Good luck,

 Dave

 On Dec 6, 6:19 am, Kay karthigaya...@gmail.com wrote:

  Thanks Zelijko, will look at it.

  Cheers,
  Kay

  On Dec 6, 9:34 am, Željko Filipin zeljko.fili...@wa-research.ch
  wrote:

   On Sun, Dec 5, 2010 at 10:58 PM, Kay karthigaya...@gmail.com wrote:
The test data is provided by a seperate data
team to us in the form of excel spreadsheet

   Watir just drives browser(s). It does not know anything about Excel. 
   There
   are other tools that know about it, for example roo[1].

   Watir is just a Ruby library (Ruby is programming language). Google for
   excel ruby (without quotes) and you will probably find something.

   [1]http://roo.rubyforge.org/

   Željko
   --
   watir.com - community manager
   watirpodcast.com - host
   testingpodcast.com - audio podcasts on software testing. all of them

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

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


[wtr-general] Re: Data Driven testing

2010-12-06 Thread Kay
Cheers Dave.

@Zelijko: cannot use Roo as I am using Jruby.

Cheers,
Kay

On Dec 6, 2:32 pm, Dave McNulla mcnu...@gmail.com wrote:
 Kay,

 I would recommend against validating data unless it's absolutely
 necessary. You should be able to submit the data that will support the
 test you are running then you run the test, then you clean up the
 data. The first and last steps may be done through sql commands, API
 calls, or web services calls. What does this give you? Knowledge that
 failures are in the software and not in the a change to the sample
 data. You also don't have to worry about burned data, which could
 be quite the problem if you are working in getting your tests right to
 begin with.

 Of course that depends on cooperation and trust in the test teams.

 Good luck,

 Dave

 On Dec 6, 6:19 am, Kay karthigaya...@gmail.com wrote:

  Thanks Zelijko, will look at it.

  Cheers,
  Kay

  On Dec 6, 9:34 am, Željko Filipin zeljko.fili...@wa-research.ch
  wrote:

   On Sun, Dec 5, 2010 at 10:58 PM, Kay karthigaya...@gmail.com wrote:
The test data is provided by a seperate data
team to us in the form of excel spreadsheet

   Watir just drives browser(s). It does not know anything about Excel. 
   There
   are other tools that know about it, for example roo[1].

   Watir is just a Ruby library (Ruby is programming language). Google for
   excel ruby (without quotes) and you will probably find something.

   [1]http://roo.rubyforge.org/

   Željko
   --
   watir.com - community manager
   watirpodcast.com - host
   testingpodcast.com - audio podcasts on software testing. all of them

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

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


[wtr-general] Re: Data Driven testing

2010-12-06 Thread Kay
Cheers Dave.

@Zelijko: cannot use Roo as I am using Jruby.

Cheers,
Kay

On Dec 6, 2:32 pm, Dave McNulla mcnu...@gmail.com wrote:
 Kay,

 I would recommend against validating data unless it's absolutely
 necessary. You should be able to submit the data that will support the
 test you are running then you run the test, then you clean up the
 data. The first and last steps may be done through sql commands, API
 calls, or web services calls. What does this give you? Knowledge that
 failures are in the software and not in the a change to the sample
 data. You also don't have to worry about burned data, which could
 be quite the problem if you are working in getting your tests right to
 begin with.

 Of course that depends on cooperation and trust in the test teams.

 Good luck,

 Dave

 On Dec 6, 6:19 am, Kay karthigaya...@gmail.com wrote:

  Thanks Zelijko, will look at it.

  Cheers,
  Kay

  On Dec 6, 9:34 am, Željko Filipin zeljko.fili...@wa-research.ch
  wrote:

   On Sun, Dec 5, 2010 at 10:58 PM, Kay karthigaya...@gmail.com wrote:
The test data is provided by a seperate data
team to us in the form of excel spreadsheet

   Watir just drives browser(s). It does not know anything about Excel. 
   There
   are other tools that know about it, for example roo[1].

   Watir is just a Ruby library (Ruby is programming language). Google for
   excel ruby (without quotes) and you will probably find something.

   [1]http://roo.rubyforge.org/

   Željko
   --
   watir.com - community manager
   watirpodcast.com - host
   testingpodcast.com - audio podcasts on software testing. all of them

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

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


[wtr-general] Re: Clicking OK javascript confirm popup?

2010-12-06 Thread slindsey3000
I can't believe this is so tough in Watir?  Clicking on confirm seems
impossible?

Anyone?

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

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


Re: [wtr-general] Re: Clicking OK javascript confirm popup?

2010-12-06 Thread Charley Baker
There are multiple ways to do it on the wiki and google the group for
them. You've severed the original thread if you had one, so I have no
idea as to what your script and html looks like. It is possible, but
not easy and in all honesty, js dialogs are prevalent but also dated,
it screams Welcome to the web in the early 90s.

Have your devs take a look at it and see if there's something more
palatable they can do. It's definitely possible and I've done it quite
a lot, mostly in Windows with AutoIT or winclicker. Both need to be
cleaned up. I'll tell you also that Webdriver and Selenium have the
same difficulties and don't deal with it well. This is a rich area of
development if you're so inclined to jump in.

Impossible - no, easy, also no - across OSes.

hth,

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



On Mon, Dec 6, 2010 at 1:08 PM, slindsey3000 slindsey3...@gmail.com wrote:
 I can't believe this is so tough in Watir?  Clicking on confirm seems
 impossible?

 Anyone?

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


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

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


Re: [wtr-general] Re: Clicking OK javascript confirm popup?

2010-12-06 Thread Eric Mathiesen
Hello,

Try this...  Substitutethe (Windows Internet Explorer, 'OK') with the
title (if given) and the name of the control you want to click...  I have
the same issue with OK's, Close's and Yes's.  This little script solved it
for my application woes.

require 'win32ole'

begin

  autoit = WIN32OLE.new('AutoItX3.Control')
  loop do
autoit.ControlClick(Windows Internet Explorer,'', 'OK')
autoit.ControlClick(Windows Internet Explorer,'', 'Close')
autoit.ControlClick(Security Information,'', 'Yes')
autoit.ControlClick(Security Alert,'', 'Yes')
autoit.ControlClick(Security Warning,'', 'Yes')
autoit.ControlClick(Message from webpage,'', 'OK')
# other options can be included here
sleep 3
  end

rescue Exception = e
  puts e

end

On Mon, Dec 6, 2010 at 12:08 PM, slindsey3000 slindsey3...@gmail.comwrote:

 I can't believe this is so tough in Watir?  Clicking on confirm seems
 impossible?

 Anyone?

 --
 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.comhttp://groups.google.com/group/watir-general%0awatir-general+unsubscr...@googlegroups.com


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

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


Re: [wtr-general] Clicking OK javascript confirm popup?

2010-12-06 Thread Eric Mathiesen
Have you tried using .fire_event?

Sry I'm on my cell

On Dec 2, 2010 11:42 PM, slindsey3000 slindsey3...@gmail.com wrote:

I have read quite a few things online over the last 2 days about
clicking OK in a javascript confirm pop-up.  I have been unable to
select ok using watir and IE.

Here is the div --

div class=actions_wrapper clearfix

   p id=delete_threads class=btn small white small_white
style= onmousedown=util.toggleClass(this, 'active')
onmouseup=util.toggleClass(this, 'active')
onmouseover=util.toggleClass(this, 'hover')
onmouseout=util.toggleClass(this, 'hover')a href=#delete id=
class= onclick=if(confirm('Deleting means no going back.'))
{Mailbox.deleteThreads();} return false; target=Delete selected
conversations/a/p p id=select_all_threads class=btn small
white small_white style= onmousedown=util.toggleClass(this,
'active') onmouseup=util.toggleClass(this, 'active')
onmouseover=util.toggleClass(this, 'hover')
onmouseout=util.toggleClass(this, 'hover') a href=#selectall
id= class= onclick=Mailbox.toggleThreadSelection(); return
false; target=Select all/a/p

/div

My code --

browser.link(:text, Delete selected conversations).click_no_wait
???


-- End of code

This (above) line  triggers the javascript confirm dialog.

What goes in the ??? ... I have tried about 50 different things.  My
inexperience has gotten the best of me here with watir.

Any help or direction appreciated.  It seems like it should be easy
and common to have to click on javascript OK buttons.

Thanks!

Shawn

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

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