Re: [wtr-general] Re: How to get html meta details

2013-03-19 Thread Soori

Hi Marlon,

I tried the above code and I am getting the following error,

Ruby193/lib/ruby/gems/1.9.1/gems/watir-4.0.2-x86-mingw32/lib/watir/loader.rb:48:
 
stack level too deep (SystemStackError)

Watir version: Watir4.

Please advise what am I doing wrong here.

Thanks,
S
On Wednesday, 4 November 2009 12:40:40 UTC+5:30, Marlon wrote:

 yes for now this is the best solution I have. 

 On 11/4/09, Wesley Chen cjq...@gmail.com javascript: wrote: 
  Thank you very much. 
  Only this way to get the meta data? I think it is not convenient enough. 
  
  Thanks. 
  Wesley Chen. 
  For life, the easier, the better. 
  
  
  On Tue, Nov 3, 2009 at 10:41 PM, chandu.tennety 
  chandu@gmail.com javascript:wrote: 
  
  
  Marlon, 
  Your original code works for me: 
  
  {Content-Type=text/html; charset=iso-8859-1, keywords=title} 
  
  Chandu 
  
  On Nov 2, 10:51 pm, Marlon marlonmoja...@gmail.com wrote: 
   I found the part of the solution herehttp:// 
  groups.google.com/group/watir-general/browse_thread/thread/566... 
   it still did not solve my problem. 
   
   *sample html* 
   
   html 
   head 
   titletitle/title 
   meta content=title name=keywords/ 
   meta content=text/html; charset=iso-8859-1 
   http-equiv=Content-Type/ 
   
   *ruby file* 
   
   require 'watir' 
   require 'test/unit' 
   
   class TC_MyTest  Test::Unit::TestCase 
   
 def test_meta_get 
   $ie = Watir::IE.start('url to check') 
   d=meta($ie) 
   puts d 
 end 
   
def meta( browser ) 
   meta = {} 
   bmeta = 
   browser.document.body.parentElement.getElementsByTagName( META ) 
   bmeta.each do |i| 
   k = i.name 
   if k ==  
   k = i.httpEquiv 
   end 
   meta[ k ] = i.content 
   end 
   return meta 
   end 
   end 
   
   this produces: 
   
   Content-Typetext/html; charset=iso-8859-1title   keywords 
   
   I what to be able to get first meta tag name attribute which is 
  *keywords 
   * 
   
   many thanks again! 
   Marlon 
  
   
  
  
   
  


 -- 
 Thanks! 

 Marlon M. Mojares 
 +639291625097 


-- 
-- 
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/groups/opt_out.




[wtr-general] how to click button from nested divs

2013-03-19 Thread Sohail Mirza
Hi,

i would like to know how to perform button click from nested div's when it
is nested upto seventh div or more
*input id=btnAddNewCustomer type=submit class=ui-button Action
value=Create New Customer onclick=createNewCustomer()*
*
*

Currently, the script execution neither gives an error nor click the
button. it just moves on the next statement execution.
kindly advise.

Thanks
*
*

-- 
-- 
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/groups/opt_out.




[wtr-general] Unable to click OK confirm popup

2013-03-19 Thread sk . fayaz
Hi,
In my application I've to click on deactivate button which returns a popup (
*Are you sure you want to deactivate this A/B Test? After deactivation, 
this test can\'t be activated again.)* with OK and Cancel buttons.I've to 
click on 'OK'.
I tried many ways but no luck..Your help is much appreciated.

Here is the code:

div id=content
h3A/B Testing/h3
form id=abform method=POST
input type=hidden value=3822 name=config.id
label class=formLeft for=start
input id=start class=calendar type=text size=10 value=18/03/2013 
name=config.start disabled=
div class=spacersmall/div
label class=formLeft for=end
input id=end class=calendar type=text size=10 value= 
name=config.stop disabled=
div class=spacersmall/div
label id=mode class=formLeft for=modeMode/label
select name=config.mode
div class=spacersmall/div
label class=formLeftChannel/label
select name=config.channel
div class=spacersmall/div
label class=formLeft
label class=formLeft
label class=formLeft
label class=formLeft
label class=formLeft
div class=spacer/div
div class=box widgets_A
div class=spacer/div
div class=box widgets_B
div class=spacer/div
div class=box widgets_C style=display: none;
div class=spacer style=display: none;/div
div class=box widgets_D style=display: none;
div class=spacer style=display: none;/div
div class=box widgets_E style=display: none;
div class=spacer style=display: none;/div
div class=spacer/div
label class=formLeftComments/label
textarea name=comment.comment/textarea
div class=spacer/div
div class=spacer/div
input class=submit120 type=submit onclick=return confirm('Are you 
sure you want to update this A/B Test?'); value=Update name=_update
*input class=submit120 type=submit onclick=return confirm('Are you 
sure you want to deactivate this A/B Test? After deactivation, this test 
can\'t be activated again.'); value=Deactivate name=_deactivate*
input class=submit120 type=submit onclick=return confirm('Are you 
sure you want to delete this A/B Test? After deletion, all track info for 
this a/b test is lost.'); value=Delete name=_delete
/form
/div
/div

I've tried as below :
1--  browser.execute_script(window.confirm = function() {return true})
2-- browser.alert.ok
3 --browser.button_submit(:class = submit120).click

Error message :
no block given (yield) (LocalJumpError)
 

-- 
-- 
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/groups/opt_out.




[wtr-general] Re: uninitialized constant Watir NameError

2013-03-19 Thread caoxu2000
Thank you Ethan and Adam so so so so much!  You guys solved my problem.  We 
had similar problem that we stupidly named our ruby test file watirgrid 
which is the same file in the watirgrid gem.
It literally took me a week trying to poke around even inside the source 
code of the watirgrid to find out why.  it was killing me as it doesn't 
make sense at all the sample code from watirgrid not working.
What an interesting human error this is :)

On Friday, June 18, 2010 9:48:48 AM UTC-7, Adam wrote:

 i have a question about a REALLY weird error I'm getting 
 using notepad++ windows 7, ruby 1.8.6, latest installation of Watir 
 using gem install watir command 
 so i changed the filename of my ruby script yesterday and now whenever 
 I add the line require 'watir' i get the following error message: 

 code 
 ./watir.rb:5: uninitialized constant Watir NameError 
 from isitfixed.rb:1:in 'require' 
 from isitfixed.rb:1 
 /code 

 i don't see why changing the filename would break watir 

 anybody know what might be happening?

-- 
-- 
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/groups/opt_out.




[wtr-general] Watir::IE.attach issue

2013-03-19 Thread alexandre vansteene
Hello all,

I am currently doing my first script using Watir and I am experiencing an 
issue. I tried to get an answer by reading many posts but I was not able to 
find by myself.

At some point during the scenario that I am automating, a pop-up appears 
and I just want to click on a OK button. I am doing it with this piece of 
code:
   
ie2 = Watir::IE.attach(:title,  Confirm)
print checkpoint 2\n
ie2.button(:name = OK).click_no_wait

These instructions work fine on 2 computers but it fails for 2 other 
computers. I am using same version of ruby, IE, watir libraries and same 
OS. I am sure that this is due to this instruction and I don't know why I 
get this error:

irb(main):003:0 ie2=Watir::IE.attach(:title, Google)
WIN32OLERuntimeError: (in OLE method `Windows': )
OLE error code:80070002 in Unknown
  No Description
HRESULT error code:0x80020009
  Une exception s?est produite.
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.6.0/lib/watir-c
lassic/ie-class.rb:116:in `method_missing'
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.6.0/lib/watir-c
lassic/ie-class.rb:116:in `each'
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.6.0/lib/watir-c
lassic/ie-class.rb:173:in `_find_all'
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.6.0/lib/watir-c
lassic/ie-class.rb:166:in `_find'
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.6.0/lib/watir-c
lassic/ie-class.rb:653:in `block in attach_browser_window'
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.6.0/lib/watir-c
lassic/wait.rb:24:in `until'
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.6.0/lib/watir-c
lassic/ie-class.rb:652:in `attach_browser_window'
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.6.0/lib/watir-c
lassic/ie-class.rb:557:in `_attach_init'
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.6.0/lib/watir-c
lassic/ie-class.rb:105:in `attach'
from (irb):3
from C:/Ruby193/bin/irb:12:in `main'
irb(main):004:0 ie2=Watir::IE.attach(:title, Google)

I have found on the attach function man that it could be due to the fact 
that Ruby has not to be executed as a service. I didn't find it in the 
service list so could you please give me a clue about my problem ?

Thank you very much in advance.
Kind regards,


-- 
-- 
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/groups/opt_out.




[wtr-general] watirgrid not working: uninitialized constant Watir::Grid (NameError)

2013-03-19 Thread caoxu2000
I installed watirgrid on my Mac: OS X 10.7.5, Mac default Ruby 1.8.7 with 
all the needed gems, watir, webdriver, rubygems, etc

require 'rubygems'
require 'watir-webdriver' 
require 'watir'
require 'watirgrid'
require 'controller'
require 'provider'


# Here's some basic examples in plain Ruby with Watirgrid and WebDriver

# Start a Controller using defaults
  controller = Controller.new
  controller.start

# Start 2 Providers with WebDriver

  provider = Provider.new(:browser_type = 'firefox')
  provider.start


# Control the Providers via the Grid

  $browser = Watir::Browser.new(:firefox)
 
  grid = Watir::Grid.new
  grid.start(:take_all = true)

when run it, it gave me uninitialized constant Watir::Grid (NameError)
the controller and the provide didn't work if I didn't add require 
'controller' and require 'provider' there
I was trying to get this sample work 
from http://wiki.openqa.org/display/WTR/WatirGrid

any help would be appreciated.

-- 
-- 
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/groups/opt_out.




Re: [wtr-general] watirgrid not working: uninitialized constant Watir::Grid (NameError)

2013-03-19 Thread Željko Filipin
On Mon, Mar 18, 2013 at 10:45 PM, caoxu2...@gmail.com wrote:

 I installed watirgrid


I am not sure if watirgrid is maintained any more. (It is
not officially part of Watir project.)

You can create an issue here: https://github.com/90kts/watirgrid/issues

Željko
--
https://leanpub.com/watirbook

-- 
-- 
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/groups/opt_out.




Re: [wtr-general] Re: How to get html meta details

2013-03-19 Thread Dan
This is a really old post!  I'm guessing at the time there wasn't an easier 
way of doing this, but now you can do something like the below.

b.metas.each do |m|
puts m.name
puts m.title
end

On Tuesday, March 19, 2013 3:22:30 AM UTC-4, Soori wrote:


 Hi Marlon,

 I tried the above code and I am getting the following error,

 Ruby193/lib/ruby/gems/1.9.1/gems/watir-4.0.2-x86-mingw32/lib/watir/loader.rb:48:
  
 stack level too deep (SystemStackError)

 Watir version: Watir4.

 Please advise what am I doing wrong here.

 Thanks,
 S
 On Wednesday, 4 November 2009 12:40:40 UTC+5:30, Marlon wrote:

 yes for now this is the best solution I have. 

 On 11/4/09, Wesley Chen cjq...@gmail.com wrote: 
  Thank you very much. 
  Only this way to get the meta data? I think it is not convenient 
 enough. 
  
  Thanks. 
  Wesley Chen. 
  For life, the easier, the better. 
  
  
  On Tue, Nov 3, 2009 at 10:41 PM, chandu.tennety 
  chandu@gmail.comwrote: 
  
  
  Marlon, 
  Your original code works for me: 
  
  {Content-Type=text/html; charset=iso-8859-1, keywords=title} 
  
  Chandu 
  
  On Nov 2, 10:51 pm, Marlon marlonmoja...@gmail.com wrote: 
   I found the part of the solution herehttp:// 
  groups.google.com/group/watir-general/browse_thread/thread/566... 
   it still did not solve my problem. 
   
   *sample html* 
   
   html 
   head 
   titletitle/title 
   meta content=title name=keywords/ 
   meta content=text/html; charset=iso-8859-1 
   http-equiv=Content-Type/ 
   
   *ruby file* 
   
   require 'watir' 
   require 'test/unit' 
   
   class TC_MyTest  Test::Unit::TestCase 
   
 def test_meta_get 
   $ie = Watir::IE.start('url to check') 
   d=meta($ie) 
   puts d 
 end 
   
def meta( browser ) 
   meta = {} 
   bmeta = 
   browser.document.body.parentElement.getElementsByTagName( META ) 
   bmeta.each do |i| 
   k = i.name 
   if k ==  
   k = i.httpEquiv 
   end 
   meta[ k ] = i.content 
   end 
   return meta 
   end 
   end 
   
   this produces: 
   
   Content-Typetext/html; charset=iso-8859-1title   keywords 
   
   I what to be able to get first meta tag name attribute which is 
  *keywords 
   * 
   
   many thanks again! 
   Marlon 
  
   
  
  
   
  


 -- 
 Thanks! 

 Marlon M. Mojares 
 +639291625097 



-- 
-- 
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/groups/opt_out.




[wtr-general] Re: newbie question cucumber-watir

2013-03-19 Thread Alex Shtayer
Have you tried to use waiters or delays?

Something like:
 @browser.text_field(:name = 'j_username').wait_until_present

-- 
-- 
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/groups/opt_out.




[wtr-general] Re: how to click button from nested divs

2013-03-19 Thread Alex Shtayer
I don't think that problem in fact that div is nested, but more that click 
event is not working as it should

Try

browser.button(:id, *btnAddNewCustomer*).fire_event(onclick)
or
browser.button(:id, *btnAddNewCustomer*).fire_event(onmousedown)
or
browser.button(:id, *btnAddNewCustomer*).send_keys :enter
or
browser.button(:id, *btnAddNewCustomer*).click
browser.button(:id, *btnAddNewCustomer*).click
to see whether problem in click action

-- 
-- 
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/groups/opt_out.




[wtr-general] Re: Unable to click OK confirm popup

2013-03-19 Thread Alex Shtayer
Provide more of your code like where you put mentioned statements

Have you tried the same things from irb?

-- 
-- 
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/groups/opt_out.




[wtr-general] Re: Unable to click OK confirm popup

2013-03-19 Thread sk . fayaz
Hi Alex,
I'm using cucumber with ruby.I'm using it in step def as below :

Then /^I click deactivate$/ do
  browser.button(:class = 'submit120').click
end

Then /^I click confirmation box$/ do
  browser.execute_script(window.confirm = function() {return true})
 # browser.confirm(window.confirm = function() {return true})
  browser.alert.ok
 #browser.button_submit_element(:class = submit120).wait_until_present
#browser.button_submit(:class = submit120).click
end


On Tuesday, March 19, 2013 11:24:18 AM UTC, sk.f...@gmail.com wrote:

 Hi,
 In my application I've to click on deactivate button which returns a popup 
 (*Are you sure you want to deactivate this A/B Test? After deactivation, 
 this test can\'t be activated again.)* with OK and Cancel buttons.I've to 
 click on 'OK'.
 I tried many ways but no luck..Your help is much appreciated.

 Here is the code:

 div id=content
 h3A/B Testing/h3
 form id=abform method=POST
 input type=hidden value=3822 name=config.id
 label class=formLeft for=start
 input id=start class=calendar type=text size=10 
 value=18/03/2013 name=config.start disabled=
 div class=spacersmall/div
 label class=formLeft for=end
 input id=end class=calendar type=text size=10 value= 
 name=config.stop disabled=
 div class=spacersmall/div
 label id=mode class=formLeft for=modeMode/label
 select name=config.mode
 div class=spacersmall/div
 label class=formLeftChannel/label
 select name=config.channel
 div class=spacersmall/div
 label class=formLeft
 label class=formLeft
 label class=formLeft
 label class=formLeft
 label class=formLeft
 div class=spacer/div
 div class=box widgets_A
 div class=spacer/div
 div class=box widgets_B
 div class=spacer/div
 div class=box widgets_C style=display: none;
 div class=spacer style=display: none;/div
 div class=box widgets_D style=display: none;
 div class=spacer style=display: none;/div
 div class=box widgets_E style=display: none;
 div class=spacer style=display: none;/div
 div class=spacer/div
 label class=formLeftComments/label
 textarea name=comment.comment/textarea
 div class=spacer/div
 div class=spacer/div
 input class=submit120 type=submit onclick=return confirm('Are you 
 sure you want to update this A/B Test?'); value=Update name=_update
 *input class=submit120 type=submit onclick=return confirm('Are you 
 sure you want to deactivate this A/B Test? After deactivation, this test 
 can\'t be activated again.'); value=Deactivate name=_deactivate*
 input class=submit120 type=submit onclick=return confirm('Are you 
 sure you want to delete this A/B Test? After deletion, all track info for 
 this a/b test is lost.'); value=Delete name=_delete
 /form
 /div
 /div

 I've tried as below :
 1--  browser.execute_script(window.confirm = function() {return true})
 2-- browser.alert.ok
 3 --browser.button_submit(:class = submit120).click

 Error message :
 no block given (yield) (LocalJumpError)
  



-- 
-- 
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/groups/opt_out.




Re: [wtr-general] Re: how to click button from nested divs

2013-03-19 Thread Sohail Mirza
No Success Alex. Sorry

On Tue, Mar 19, 2013 at 5:22 PM, Alex Shtayer ashta...@gmail.com wrote:

 I don't think that problem in fact that div is nested, but more that click
 event is not working as it should

 Try

 browser.button(:id, *btnAddNewCustomer*).fire_event(onclick)
 or
 browser.button(:id, *btnAddNewCustomer*).fire_event(onmousedown)
 or
 browser.button(:id, *btnAddNewCustomer*).send_keys :enter
 or
 browser.button(:id, *btnAddNewCustomer*).click
 browser.button(:id, *btnAddNewCustomer*).click
 to see whether problem in click action

 --
 --
 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/groups/opt_out.




-- 
-- 
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/groups/opt_out.




[wtr-general] how disable javascript alert

2013-03-19 Thread Sohail Mirza
Hi,

Can someone explain how to disable Java Script Alert message during watir
script execution?
Thanks

-- 
-- 
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/groups/opt_out.




[wtr-general] Re: how disable javascript alert

2013-03-19 Thread Sohail Mirza
This thread is closed. The information is available at following link
*http://watirwebdriver.com/javascript-dialogs/*


On Tue, Mar 19, 2013 at 6:42 PM, Sohail Mirza mrz...@gmail.com wrote:

 Hi,

 Can someone explain how to disable Java Script Alert message during watir
 script execution?
 Thanks



-- 
-- 
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/groups/opt_out.




[wtr-general] Re: Unable to click OK confirm popup

2013-03-19 Thread sk . fayaz
This is working now...Implemented as below :

message = @page.confirm(true) do
 @page.button_that_causes_the_confirm
 end
 message.should == Text from the confirm popup


On Tuesday, March 19, 2013 11:24:18 AM UTC, sk.f...@gmail.com wrote:

 Hi,
 In my application I've to click on deactivate button which returns a popup 
 (*Are you sure you want to deactivate this A/B Test? After deactivation, 
 this test can\'t be activated again.)* with OK and Cancel buttons.I've to 
 click on 'OK'.
 I tried many ways but no luck..Your help is much appreciated.

 Here is the code:

 div id=content
 h3A/B Testing/h3
 form id=abform method=POST
 input type=hidden value=3822 name=config.id
 label class=formLeft for=start
 input id=start class=calendar type=text size=10 
 value=18/03/2013 name=config.start disabled=
 div class=spacersmall/div
 label class=formLeft for=end
 input id=end class=calendar type=text size=10 value= 
 name=config.stop disabled=
 div class=spacersmall/div
 label id=mode class=formLeft for=modeMode/label
 select name=config.mode
 div class=spacersmall/div
 label class=formLeftChannel/label
 select name=config.channel
 div class=spacersmall/div
 label class=formLeft
 label class=formLeft
 label class=formLeft
 label class=formLeft
 label class=formLeft
 div class=spacer/div
 div class=box widgets_A
 div class=spacer/div
 div class=box widgets_B
 div class=spacer/div
 div class=box widgets_C style=display: none;
 div class=spacer style=display: none;/div
 div class=box widgets_D style=display: none;
 div class=spacer style=display: none;/div
 div class=box widgets_E style=display: none;
 div class=spacer style=display: none;/div
 div class=spacer/div
 label class=formLeftComments/label
 textarea name=comment.comment/textarea
 div class=spacer/div
 div class=spacer/div
 input class=submit120 type=submit onclick=return confirm('Are you 
 sure you want to update this A/B Test?'); value=Update name=_update
 *input class=submit120 type=submit onclick=return confirm('Are you 
 sure you want to deactivate this A/B Test? After deactivation, this test 
 can\'t be activated again.'); value=Deactivate name=_deactivate*
 input class=submit120 type=submit onclick=return confirm('Are you 
 sure you want to delete this A/B Test? After deletion, all track info for 
 this a/b test is lost.'); value=Delete name=_delete
 /form
 /div
 /div

 I've tried as below :
 1--  browser.execute_script(window.confirm = function() {return true})
 2-- browser.alert.ok
 3 --browser.button_submit(:class = submit120).click

 Error message :
 no block given (yield) (LocalJumpError)
  



-- 
-- 
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/groups/opt_out.




[wtr-general] Browser resize on watir-classic.

2013-03-19 Thread Sharanya Viswanath
Hi,

I am trying to resize my IE browser using watir classic. Is there a method 
to do that? Currently, the code that I have incorporated into my framework 
works for FF and Chrome. Does watir-classic support resizing of IE 
browsers? Here's a sample code: 
   
   def init_browser
  if (ENV[BROWSERWIDTH].nil? || ENV[BROWSERWIDTH].empty? || 
ENV[BROWSER] == IE || ENV[BROWSER] == ipad || ENV[BROWSER] == 
iphone)
if (ENV[BROWSER] == IE || ENV[BROWSER] == ipad || 
ENV[BROWSER] == iphone)  (!ENV[BROWSERWIDTH].nil? || 
!ENV[BROWSERWIDTH].empty?)
  @logger.info Resizing of browsers is not supported on iOS 
Simulator, IE 
end
@browser = get_browser.__start(@debug_mode)
add_page_checkers
  else
@browser = get_browser.__start(@debug_mode)
if ENV[BROWSERHEIGHT].nil? || ENV[BROWSERHEIGHT].empty?
  width = ENV[BROWSERWIDTH].to_i
  @browser.window.resize_to(width,1024)
  @logger.info Browser height has not been specified. Using 
default height:1024.\nYour browser has been resized to width:#{width} 
height:1024
else
  width = ENV[BROWSERWIDTH].to_i
  height = ENV[BROWSERHEIGHT].to_i
  @browser.window.resize_to(width,height)
  @logger.info Your browser has been resized to width:#{width} 
height:#{height}
end
add_page_checkers
  end
end

def activate_ie
  unless RUBY_PLATFORM =~ /win32|mingw/
raise This platform is not supported (#{PLATFORM})
  end
  @logger.step('Launching INTERNET EXPLORER...')
  require 'watir-classic'
  ie = Watir::IE
  require 'common/assertions'
  require 'core/browser_overrides/common_browser_overrides'
  require 'core/browser_overrides/ie.rb'
  return ie
end

 class IE
  def self.__start(debug_mode=false)
Watir::Browser.new(:ie)
  end
end

Any help is appreciated.

Thanks,
Sharanya V

-- 
-- 
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/groups/opt_out.




[wtr-general] Re: Unable to select the radiobutton and also unable to detect the iFrame

2013-03-19 Thread Pavan Turlapati
Any help on this?



On Tuesday, March 19, 2013 9:03:20 AM UTC-5, Pavan Turlapati wrote:


 Hello,
I got one more problem which I need some experts to help 
 me. I have a radiobutton which is present under the iFrame but when I try 
 any of the below lines I am getting the 
 *Watir::Exception::UnknownFrameException: 
 Unable to locate element, using {:tag_n error. *


 The HTML tag when I copied from IE developer tool looks like :
  input name=$PpyWorkPage$pMakeMeaningfulContact class=Radio 
 id=$PpyWorkPage$pMakeMeaningfulContactN/A style=vertical-align: middle; 
 type=radio value=N/A/

 I also tried to save the html but the saved Html does not contain the 
 field I was looking(May be I should even know how to get the HTML). So, an 
 alternative I have got three image files which is the only reference I have.

 Could somebody suggest me some solution.

 *What I tried.*

 1== $ie.iframe(:name = 'actionIFrame',:title='Take 
 Action').radio(:id='$PpyWorkPage$pMakeMeaningfulContactN/A').set 

 2== $ie.iframe(:name = 
 'actionIFrame').radio(:id=/\w*MakeMeaningfulContactYes\w*/).set

 3== $ie.iframe(:id = 'PWGadget5Ifr').frame(:name='actionForm').html

 Any help is highly appreciated. 

 Thanks,
 Pavan T




-- 
-- 
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/groups/opt_out.