[wtr-general] watir-webdriver href javascript

2013-02-06 Thread Sohail Mirza
Hi,

how would you automate following Javascript link in watir-webdriver?

a
href='javascript:selectDevice(122334455,12121212,#divAddCustomerLine);'Select/a


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: watir-webdriver href javascript

2013-02-06 Thread Alex Shtayer
What do you mean by automate? How to click on the element?

You can use usual method like:
browser.link(:text, Select).click
or if due any reason click method does not work:
browser.link(:text, Select).fire_event(onclick)
or
browser.link(:text, Select).fire_event(onmousedown)

On Wednesday, February 6, 2013 11:11:52 AM UTC+2, mc060200778 wrote:

 Hi,

 how would you automate following Javascript link in watir-webdriver?

 a 
 href='javascript:selectDevice(122334455,12121212,#divAddCustomerLine);'Select/a


 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: help please

2013-02-06 Thread Alex Shtayer

Maybe, you can try
browser.div(:*id, idDiv_PWD_UsernameExample*).send_keys blah-blah
or 
browser.div(:*id, idDiv_PWD_UsernameExample*).click
browser.send_keys blah-blah

That solution works for me perfectly (for text in divs)

On Saturday, February 2, 2013 8:19:11 PM UTC+2, mc060200778 wrote:

 Hi,

 my question is how to set value in the textbox with following html code 

 *div id=idDiv_PWD_UsernameExample class=placeholder ltr_override 
 aria-hidden=true style=cursor: text;som...@example.com javascript:
 /div*



 *1st:*
 @browser = Watir::Browser.new :chrome 
 @browser.div(:id = idDiv_PWD_UsernameExample).set 
 'te...@test.comjavascript:
 '

 *2nd:*
 @browser = Watir::Browser.new :chrome 
 @browser.text_field(:id = idDiv_PWD_UsernameExample).set (
 te...@test.com javascript:)


 *3rd:*
 @browser = Watir::Browser.new :chrome 
 @browser.div(:class = *placeholder ltr_override*).set 
 (te...@test.comjavascript:
 )




-- 
-- 
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: Getting constant net/protocol.rb:140:in `rescue in rbuf_fill': Timeout::Error exception for Watir-webdriver after couple hours of use

2013-02-06 Thread Alex Shtayer
The same exception we get when IEDriver is not installed at all, so does 
anybody has situation when driver stopped to respond or hanged up?

It should be reproducible whether you have more or less complex test suite

On Tuesday, February 5, 2013 1:27:16 PM UTC+2, Alex Shtayer wrote:

 Env:
 1. ruby 1.9.2p180
 2. watir-webdriver (0.6.2)
 3. InternetExplorerDriver server (32-bit) 2.29.0.0

 I am running usual functional tests (that worked perfectly on usual 
 watir), so it is almost 100% no dependencies on what I test, but more what 
 I use for testing.
 Issue can be reproduced on FF too, not only on IE, but on IE more 
 frequently

 That exception usually occurs in random places and usually after couple of 
 hours running the script.
 If I close the browser frequently, so issue reproduced more rarely, but 
 still reproduce

 I really need your help in that and maybe someone already faced it and 
 know the solution.

 Big,big thanks in advance
  


-- 
-- 
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] input type=image

2013-02-06 Thread Alex Shtayer

Input is a parent class for all inputs (like buttons, checkboxes, 
text_fields and etc), so if you can't use any sub-class of elements due you 
input is a special one (like *input type=image*), you can use just 
browser.input and watir will look for all inputs (buttons, checkboxes, 
unusual and etc) through whole DOM till it match provided attribute 
(:value=Add New Customer)

On Monday, February 4, 2013 3:30:24 PM UTC+2, mc060200778 wrote:

 Perfect Joe, its amazingly working now.
 Now my question is: *how do you know to user @browser.input?*

 The following page does not tells anything to use image as an input
 http://wiki.openqa.org/display/WTR/HTML+Elements+Supported+by+Watir


 Thanks,



 On Mon, Feb 4, 2013 at 5:24 PM, Joe Fleck joefl...@gmail.comjavascript:
  wrote:

 Hi Sohail,

 I would treat it as a input.

 @browser.input(:value=Add New Customer).click

 Or any of the above.

 Joe

 On Mon, Feb 4, 2013 at 8:20 AM, Sohail Mirza mrz...@gmail.comjavascript: 
 wrote:
  Oscar,
 
  if i am not wrong, the following URL tells to record it as a button.
 
  http://wiki.openqa.org/display/WTR/HTML+Elements+Supported+by+Watir
 
  Am i missing some important point here?
  Thanks
 
 
  On Mon, Feb 4, 2013 at 5:18 PM, Oscar Rieken 
  bis...@gmail.comjavascript: 
 wrote:
 
  well its an image and you are telling watir to look for a button
 
  http://rdoc.info/github/jarib/watir-webdriver/master/Watir/Element
 
 
  On Mon, Feb 4, 2013 at 8:15 AM, Sohail Mirza 
  mrz...@gmail.comjavascript: 
 wrote:
 
  Hi,
 
  i have following html code for input type image
 
  input type=image src=/MyTestDemo/Images/add.png value=Add New
  Customer data-bind=visible: IsAddAllowed,click: 
 $root.AddNewCustomer
  class=ui-button
 
  How can i perform click event on above?
  i am trying the following but failing
 
  @browser.button(:src,/MyTestDemo/Images/add/).click
  @browser.button(:class = ui-button).click
 
  Please
 
  Thanks
 
  --
  --
  Before posting, please read http://watir.com/support. In short: 
 search
  before you ask, be nice.
 
  watir-...@googlegroups.com javascript:
  http://groups.google.com/group/watir-general
  watir-genera...@googlegroups.com javascript:
 
  ---
  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-genera...@googlegroups.com javascript:.
  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-...@googlegroups.com javascript:
  http://groups.google.com/group/watir-general
  watir-genera...@googlegroups.com javascript:
 
  ---
  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-genera...@googlegroups.com javascript:.
  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-...@googlegroups.com javascript:
  http://groups.google.com/group/watir-general
  watir-genera...@googlegroups.com javascript:
 
  ---
  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-genera...@googlegroups.com javascript:.
  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-...@googlegroups.com javascript:
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.comhttp://groups.google.com/group/watir-generalwatir-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-genera...@googlegroups.com javascript:.
 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] Re: .attach method

2013-02-06 Thread Alex Shtayer
Actually you can. And without any problem through usual
browser.window(:title=Browser title).use do
  code
end

or even to sub-window
browser.window(:title=Browser title).use do
  code
  browser.window(:title=Browser title).use do
code
browser.window(:title=Browser title).use do
  code
end
  end
end

If we speak about alerts and etc, so it is separate API:
browser.alert.ok
or
browser.alert.close
etc

On Saturday, February 2, 2013 6:45:56 PM UTC+2, Jim Evans wrote:

 You don't. The WebDriver API doesn't support attaching to an existing 
 browser yet, so watir-webdriver can't provide this functionality either. 
 Additionally, a large use case for attaching to an existing browser window 
 is in manipulating popup browser windows[1], and WebDriver does provide a 
 Window API for that purpose. How watir-webdriver exploits that API, I 
 couldn't say.

 --Jim

 [1] Disclaimer: I don't mean to suggest that there aren't other use cases 
 for the .attach method, or that popup windows are the most important use 
 case for that API, or even that it's the use case you're trying to solve. 
 I'm just presenting the state of things as they are in WebDriver. Patches, 
 as always, gratefully received.



-- 
-- 
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 run watir script onan already opened Chrome Browser

2013-02-06 Thread Alex Shtayer

On watir through .attach method
on watir-webdriver through browser.window(title).use

On Friday, February 1, 2013 6:19:27 PM UTC+2, mc060200778 wrote:

 Hi,

 I wanted to know How to run watir script on an already opened Chrome 
 Browser.
 I dont want to open new Chrome Instance. THe web application is already 
 openened in Chrome and i just want to run the script.

 Thanks for comments

 Sohail


-- 
-- 
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: watir-webdriver href javascript

2013-02-06 Thread Sohail Mirza
Thanks Alex, its working with me.


On Wed, Feb 6, 2013 at 1:18 PM, Alex Shtayer ashta...@gmail.com wrote:

 What do you mean by automate? How to click on the element?

 You can use usual method like:
 browser.link(:text, Select).click
 or if due any reason click method does not work:
 browser.link(:text, Select).fire_event(onclick)
 or
 browser.link(:text, Select).fire_event(onmousedown)


 On Wednesday, February 6, 2013 11:11:52 AM UTC+2, mc060200778 wrote:

 Hi,

 how would you automate following Javascript link in watir-webdriver?

 a href='javascript:selectDevice(**122334455,12121212,#**
 divAddCustomerLine);'Select**/a


 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.




-- 
-- 
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] How to run Watir with Firefox 18?

2013-02-06 Thread Željko Filipin
On Mon, Feb 4, 2013 at 11:13 PM, Phuoc Can Hua h...@huaonline.com wrote:

 I've got scripts which are running with IE6. Now I want to run them with
 Firefox 18.
 I haven't managed to get the browser launched.


Please read this:

https://github.com/watir/watirbook/blob/master/installation/windows.md

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




[wtr-general] Re: Unable to acces text_field inside a frame coz of some #document tag in the HTML.

2013-02-06 Thread Alex Shtayer

Okay, so provide HTML that you see in IE developer tool

$ie.frame(:name,centent).present?
= true
but
$ie.frame(:name,centent).text_field(:name,validateDealer).present?
flase

so, maybe you have one more sub frame?

but it is really not good (it seems that frame is empty or what)
irb(main):015:0 
$ie.frame(:name,centent).text_field(:name,dealerCode).set(22r25)
NoMethodError: unknown property or method: `body'

In any case, we need more details

On Monday, January 28, 2013 1:59:41 PM UTC+2, Deepak Kumar wrote:

 Hi,
 I am using IE developer and also tried developer tool of chrome also :(



 On Wednesday, January 23, 2013 8:08:33 PM UTC+5:30, Deepak Kumar wrote:

 Hi everyone,
 I am trying to access a text_field of page.HTML format is as follows

 html
   head-/head
 body
  iframe name=centent src=homepage.jsp 
*  #document*
   html slick-uniqueid = 1 
 head-head
 body
 script --/script
 div id = headerHome
  div class=utilityNavHome id=utilityNavHome
 form name = 'validateDealer'

 i tried through IRB and tried to us flash() function but can only use the 
 function on Iframe tag after that i am not able to acess any element.
 Is #document creating a problem.

 Thanks  regards
 Deepak Kumar
  



-- 
-- 
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] How to run watir script onan already opened Chrome Browser

2013-02-06 Thread Željko Filipin
On Fri, Feb 1, 2013 at 5:19 PM, Sohail Mirza mrz...@gmail.com wrote:

 I wanted to know How to run watir script on an already opened Chrome
 Browser.


If you opened the Chrome manually, then you can not automate it with Watir.

If your script opened another Chrome window, see this:

http://watirwebdriver.com/browser-popups/

Ž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] .attach method

2013-02-06 Thread Željko Filipin
On Sat, Feb 2, 2013 at 5:45 PM, Jim Evans james.h.evans...@gmail.comwrote:

 Additionally, a large use case for attaching to an existing browser window
 is in manipulating popup browser windows[1], and WebDriver does provide a
 Window API for that purpose. How watir-webdriver exploits that API, I
 couldn't say.


http://watirwebdriver.com/browser-popups/

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




[wtr-general] Re: How to handle download bar in IE 9

2013-02-06 Thread Alex Shtayer
I automate such kind of things through AutoIT due pop-ups are not usual 
window and cannot be attached or something

On Tuesday, July 17, 2012 8:32:27 AM UTC+3, Agung Surya wrote:

 Hi,

 I'm having a problem regarding access the new pop up in IE 9 using Watir
 This pop up regarding the save or open pop up that like a tab in the 
 bottom of the page.
 Could some one please share the steps to access those button?(Open, save 
 as, and cancel button)



-- 
-- 
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 handle download bar in IE 9

2013-02-06 Thread Joe Fleck
I use Sikuli to handle such pop up windows.  AutoIT is also a good alternative.

Joe

On Wed, Feb 6, 2013 at 6:53 AM, Alex Shtayer ashta...@gmail.com wrote:
 I automate such kind of things through AutoIT due pop-ups are not usual
 window and cannot be attached or something


 On Tuesday, July 17, 2012 8:32:27 AM UTC+3, Agung Surya wrote:

 Hi,

 I'm having a problem regarding access the new pop up in IE 9 using Watir
 This pop up regarding the save or open pop up that like a tab in the
 bottom of the page.
 Could some one please share the steps to access those button?(Open, save
 as, and cancel button)

 --
 --
 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] Re: watir, watir-webdriver, watir-classic: history and current state?

2013-02-06 Thread Alex Shtayer
General impression:
I created hundreds of cases for different functionality (in some cases 
really complex one) on watir classic and firewatir. After that I spent last 
six months to migrate everything on one platform (watir-webdriver) as it 
helps me keep code for all browsers much more maintainable and in the same 
way. (we don't need all this firefox plug-ins and etc). Also I love new way 
of handling pop-ups in watir-webdriver, so I finally get rid all AutoIT 
code and have pure watir code.
As for me, watir-webdriver works MUCH more reliable than watir for small 
cases (I do not see any random things), but for long runs I see some 
crashes that I cannot debug in any way due the driver itself (.exe, so 
black box for me). So if you do not see any issues with driver, I will 
recommend to use watir-webdriver

Is it true that watir-webdriver has improved significantly in the past 12 
months?
I know only for last 6 months, but yes. As for me - as Željko said 'Not 
sure if I would say significantly, but I would say it has improved'

The true motivation for watir-classic:
If you have all your code on watir and you don't want to migrate it. As 
watir-webdrvier completely differently interacts with elements in 
comparison with watir, you will need to work a lot for such migration. Even 
the syntax is similar, it doesn't mean that your code will work. For 
example, my watir code can click on elements that are not visible (like 
directly through DOM), but watir-webdriver will definitely crash and etc.





-- 
-- 
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 find the chromedriver executable

2013-02-06 Thread Alex Shtayer
Once more
http://code.google.com/p/selenium/wiki/ChromeDriver

Download and copy mentioned file for example in:
C:\Ruby193\bin

-- 
-- 
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: watir-classic issue with execute_script and JSON

2013-02-06 Thread Jarmo Pertman
Hi!

I just noticed that you had Ruby 1.9.3 vs 1.9.2 and Watir-Classic 3.3.0 vs 
3.4.0 in your error messages.
Which one was it actually and why do they differ?

Can you try to copy the watir-classic gem's json2.js file over with the 
contents of https://raw.github.com/douglascrockford/JSON-js/master/json2.js and 
see if that makes any difference?

Jarmo Pertman
-
IT does really matter - http://itreallymatters.net


On Monday, February 4, 2013 4:53:52 PM UTC+2, captin wrote:

 Jarmo,
  
 There is no error when I copy the local json2.js file (located at 
 file:///C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/ext/json2.js)
  
 contents to the IE developer tools window. When I run the stringify command 
 you gave me, the out put is {a:foo}. And I get the exact same 
 results when I use the other json2.js you linked and then run the command 
 again.
 I also tried the original commands you gave previously (typeof JSON and 
 typeof JSON.stringify) after I loaded the json2.js script manually, and the 
 outputs were object and function respectively.
  
 In your opinion, is there some sort of automatic loading or accessing 
 issue between JSON and IE?
  
 Thanks.
  
 On Saturday, February 2, 2013 9:47:53 AM UTC-6, Jarmo Pertman wrote:

 Can you try by copying all the contents of the json2.js file from 
 file:///C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.3.0/lib/watir-classic/ext/json2.js
  to 
 your IE developer tools window? Do you get any errors when doing that too? 
 What does this code return after doing that: JSON.stringify({a: foo})

 What about using the code at 
 https://raw.github.com/douglascrockford/JSON-js/master/json2.js ?

 Jarmo Pertman
 -
 IT does really matter - http://itreallymatters.net


 On Thursday, January 31, 2013 1:01:11 AM UTC+2, captin wrote:

 I have encountered an issue with execute_script using IE9 with ruby 
 1.9.3p327 and watir-classic 3.4.0. I was doing some research and found my 
 exact 
 same issue detailed at Stack 
 Overflowhttp://stackoverflow.com/questions/14142905/issue-with-execute-script,
  
 but the thread is stale (and I'm too new to be able to comment on the issue 
 there). Jarmo was assisting but the OP hasn't responded in over three weeks.
  
 I hate redundancy but I also hate waiting indefinitely so I figured I'd 
 pose the question here. Using the following code:
  
 browser.execute_script window.confirm = function() { return true; }
  
 I get the following error:
  
 WIN32OLERuntimeError: (in OLE method `execScript': )
 OLE error code:80020101 in Unknown
   Could not complete the operation due to error 80020101.
 HRESULT error code:0x80020009
   Exception occurred.
 from 
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/page-container.rb:29:in
  
 `method_missing'
 from 
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/page-container.rb:29:in
  
 `rescue in execute_script'
 from 
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/page-container.rb:22:in
  
 `execute_script'
 from (irb):14
 from C:/Ruby193/bin/irb:12:in `main'
  
 The following JavaScript errors are also present in the browser:
  
 SCRIPT1014: Invalid character
 *json2.js, line 1 character 1*
  
 SCRIPT5009: 'JSON' is undefined 
 *edit-location?pageTitle=Edit 
 LocationcontactId=8590307238folderId=0folderName=%5BGlobal%5DcardId=8590242330,
  
 line 1 character 1*
  
 Jarmo, I performed the actions you suggested at Stack Overflow and got 
 the following results:
  
  typeof JSON
 undefined 
  
  typeof JSON.stringify 
 'JSON' is undefined 
  
  if (!window.JSON || !window.JSON.stringify) {
 var json2=document.createElement('script');
 json2.type='text/javascript';
 json2.src='file:///C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.3.0/lib/watir-classic/ext/json2.js';
  

 document.getElementsByTagName('head')[0].appendChild(json2)
 } 
 SCRIPT1014: Invalid character 
 *json2.js, line 1 character 1* https://groups.google.com/forum/0 
 [object] {
 nextSibling : ,
 onresizeend : null,
 onrowenter : null,
 aria-haspopup : ,
 childNodes : [object],
 ondragleave : null,
 oncut : null,
 clientHeight : 0,
 onbeforepaste : null,
 ondragover : null
 ...
 } 
 Do you or anyone else have any further troubleshooting steps I can 
 attempt?
  
 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: Problems with Select Lists in my application

2013-02-06 Thread Alex Shtayer


Refer to:
http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups

I am using solution #9 for more than 3 years and it works just fine

-- 
-- 
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: watir-classic issue with execute_script and JSON

2013-02-06 Thread captin
Jarmo,
 
My apologies for the versioning miscommunication. My initial post and 
initial error messages are correct with Ruby 1.9.3 and Watir-Classic 3.4.0, 
but the line 
json2.src='file:///C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.3.0/lib/watir-classic/ext/json2.js';
 
is probably what threw you off. That was a copy/paste mistake. The line 
that I truly used for troubleshooting was 
json2.src='file:///C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/ext/json2.js';
 
I hope this clears things up.
 
I also tried copying the json2.js file you linked into my watir-classic 
gem, and then I ran the same troubleshooting commands along with the 
original watir command I am trying to use. Same results, even though the 
two json2.js files are slightly different.
 
 

On Wednesday, February 6, 2013 11:11:19 AM UTC-6, Jarmo Pertman wrote:

 Hi!

 I just noticed that you had Ruby 1.9.3 vs 1.9.2 and Watir-Classic 3.3.0 vs 
 3.4.0 in your error messages.
 Which one was it actually and why do they differ?

 Can you try to copy the watir-classic gem's json2.js file over with the 
 contents of 
 https://raw.github.com/douglascrockford/JSON-js/master/json2.js and see 
 if that makes any difference?

 Jarmo Pertman
 -
 IT does really matter - http://itreallymatters.net


 On Monday, February 4, 2013 4:53:52 PM UTC+2, captin wrote:

 Jarmo,
  
 There is no error when I copy the local json2.js file (located at 
 file:///C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/ext/json2.js)
  
 contents to the IE developer tools window. When I run the stringify command 
 you gave me, the out put is {a:foo}. And I get the exact same 
 results when I use the other json2.js you linked and then run the command 
 again.
 I also tried the original commands you gave previously (typeof JSON and 
 typeof JSON.stringify) after I loaded the json2.js script manually, and the 
 outputs were object and function respectively.
  
 In your opinion, is there some sort of automatic loading or accessing 
 issue between JSON and IE?
  
 Thanks.
  
 On Saturday, February 2, 2013 9:47:53 AM UTC-6, Jarmo Pertman wrote:

 Can you try by copying all the contents of the json2.js file from 
 file:///C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.3.0/lib/watir-classic/ext/json2.js
  to 
 your IE developer tools window? Do you get any errors when doing that too? 
 What does this code return after doing that: JSON.stringify({a: foo})

 What about using the code at 
 https://raw.github.com/douglascrockford/JSON-js/master/json2.js ?

 Jarmo Pertman
 -
 IT does really matter - http://itreallymatters.net


 On Thursday, January 31, 2013 1:01:11 AM UTC+2, captin wrote:

 I have encountered an issue with execute_script using IE9 with ruby 
 1.9.3p327 and watir-classic 3.4.0. I was doing some research and found my 
 exact 
 same issue detailed at Stack 
 Overflowhttp://stackoverflow.com/questions/14142905/issue-with-execute-script,
  
 but the thread is stale (and I'm too new to be able to comment on the 
 issue 
 there). Jarmo was assisting but the OP hasn't responded in over three 
 weeks.
  
 I hate redundancy but I also hate waiting indefinitely so I figured I'd 
 pose the question here. Using the following code:
  
 browser.execute_script window.confirm = function() { return true; }
  
 I get the following error:
  
 WIN32OLERuntimeError: (in OLE method `execScript': )
 OLE error code:80020101 in Unknown
   Could not complete the operation due to error 80020101.
 HRESULT error code:0x80020009
   Exception occurred.
 from 
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/page-container.rb:29:in
  
 `method_missing'
 from 
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/page-container.rb:29:in
  
 `rescue in execute_script'
 from 
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/page-container.rb:22:in
  
 `execute_script'
 from (irb):14
 from C:/Ruby193/bin/irb:12:in `main'
  
 The following JavaScript errors are also present in the browser:
  
 SCRIPT1014: Invalid character
 *json2.js, line 1 character 1*
  
 SCRIPT5009: 'JSON' is undefined 
 *edit-location?pageTitle=Edit 
 LocationcontactId=8590307238folderId=0folderName=%5BGlobal%5DcardId=8590242330,
  
 line 1 character 1*
  
 Jarmo, I performed the actions you suggested at Stack Overflow and got 
 the following results:
  
  typeof JSON
 undefined 
  
  typeof JSON.stringify 
 'JSON' is undefined 
  
  if (!window.JSON || !window.JSON.stringify) {
 var json2=document.createElement('script');
 json2.type='text/javascript';
 json2.src='file:///C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.3.0/lib/watir-classic/ext/json2.js';
  

 document.getElementsByTagName('head')[0].appendChild(json2)
 } 
 SCRIPT1014: Invalid character 
 *json2.js, line 1 character 1* https://groups.google.com/forum/0 
 [object] {
 

Re: [wtr-general] How to run Watir with Firefox 18?

2013-02-06 Thread Phuoc Can Hua
After installing firewatire and commented out following lines I managed to 
get rid of all errors. Now my firefox is launched (with 
Watir::Browser.new)  :-)
require 'watir-webdriver'
require 'watir/contrib/enabled_popup'

Since I've launched IE with Watir::IE.new everything is no longer working 
in my script. Now I need to use Watir::Browser to launch IE. Time to go 
back for some reading.
Thank you for your help and time.

Phuoc

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