Re: [wtr-general] Clicking links that use non-english characters

2012-11-09 Thread Cliff Cyphers
Note, I haven't tested this under watir and speaking with regard to general
string handling under ruby 1.9.

Try to update the encoding to something that supports DBCS, such as UTF-8.
 This can be done either at the global level by:

Encoding.default_internal='UTF-8'
Encoding.default_external='UTF-8'

Or you can perform the operation on the string itself:

browser.link(:id, 'Tovább'.encode('UTF-8')).click


On Fri, Nov 9, 2012 at 4:49 AM, Adrian Killens ack...@googlemail.comwrote:

 Hi There,
 Does anyone know how I can click things in non-english languages that have
 non-english characters identifying them?

 E.g.
 browser.link(:id, 'Tovább').click

 I get the following trying to click these links:

 invalid multibyte char (US-ASCII) (SyntaxError)
 invalid multibyte char (US-ASCII)

 Cheers
 Aidy

 --
 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] Set a text in div with js text field

2012-11-09 Thread Cliff Cyphers
Are you sure you have the terminology right?  There's no such thing as a
div text field.  Whether the text field is created by updating the DOM in
JavaScript shouldn't impact your ability to treat it like a regular:

input type='text'

On Fri, Nov 9, 2012 at 1:20 AM, Nicolas nicolas.gar...@ebuzzing.com wrote:

 Hi, thanks for your answer,

 but unfortunately, it doesn't work.

 Le jeudi 8 novembre 2012 17:01:43 UTC+1, Željko Filipin a écrit :

 On Thu, Nov 8, 2012 at 4:44 PM, Nicolas nicolas...@ebuzzing.com wrote:
  As you can't see, the deeper div is a js text field with autocompletion
 etc
  But I don't manage to set anything in it with Watir.

 Well, you can not actually enter text into div, right?

 Try this:

 browser.div(:id = yui_3_3_0_1_1352386979117_**185365).send_keys some
 text

 Željko
 --
 filipin.eu

  --
 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] Clicking links that use non-english characters

2012-11-09 Thread Cliff Cyphers
how about you post the code block in question and a site that is reachable
by all.  without doing so one can't expect troubleshooting past what's
already been suggested.  Also, you can look at setting your LANG at the OS
level so that all ruby objects use that as default.

On Fri, Nov 9, 2012 at 7:25 AM, Adrian Killens ack...@googlemail.comwrote:

 Hi There, I added the following lines to top of my rb file that's got the
 non-english characters in it:

 require encoding
 Encoding.default_internal='UTF-8'
 Encoding.default_external='UTF-8'

 Still having problems though. I noticed that the encoding.rb file has most
 of its contents commented out. Is this normal?
 Cheers
 Aidy

 On Friday, 9 November 2012 15:23:59 UTC, Adrian Killens wrote:

 That didn't work, in this instance I need to grab via the non-english
 tags as I'm doing some testing around translations.

 On Friday, 9 November 2012 14:17:19 UTC, Joe Fl wrote:

 Hi Aidy,

 Are there any other elements you can use for this link?

 Have you tried this?
 browser.link(:id,/Tovabb/).**click

 Regards,
 Joe

 On Fri, Nov 9, 2012 at 7:49 AM, Adrian Killens ack...@googlemail.com
 wrote:
  Hi There,
  Does anyone know how I can click things in non-english languages that
 have
  non-english characters identifying them?
 
  E.g.
  browser.link(:id, 'Tovább').click
 
  I get the following trying to click these links:
 
  invalid multibyte char (US-ASCII) (SyntaxError)
  invalid multibyte char (US-ASCII)
 
  Cheers
  Aidy
 
  --
  Before posting, please read http://watir.com/support. In short:
 search
  before you ask, be nice.
 
  watir-...@googlegroups.com
  http://groups.google.com/**group/watir-generalhttp://groups.google.com/group/watir-general
  watir-genera...@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


-- 
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 links that use non-english characters

2012-11-09 Thread Cliff Cyphers
One other things you could try is get the escape sequence for UTF-8 which
represents the characters in question and use that in your script.  For
example:


require 'watir-webdriver'
b = Watir::Browser.new
b.goto('http://www.sociology.emory.edu/globalization/nonenglishlinks.html#1
')

puts b.blockquotes.first.text
= NGO (Erkl\u00E4rung von Bern) focusing on fair economic relations and
cultural exchange between Switzerland and developing countries; has
information on trade and culture

In this example if you wanted to verify the german text for the first
blockquote on the page you would use:

Erkl\u00E4rung

instead of:

Erklärung

where \u00E4 == ä

I'm sure there must be tools out there to help translate displayed fonts to
the unicode representation, you might want to google for such.

On Fri, Nov 9, 2012 at 7:52 AM, Cliff Cyphers cliff.cyph...@gmail.comwrote:

 how about you post the code block in question and a site that is reachable
 by all.  without doing so one can't expect troubleshooting past what's
 already been suggested.  Also, you can look at setting your LANG at the OS
 level so that all ruby objects use that as default.


 On Fri, Nov 9, 2012 at 7:25 AM, Adrian Killens ack...@googlemail.comwrote:

 Hi There, I added the following lines to top of my rb file that's got the
 non-english characters in it:

 require encoding
 Encoding.default_internal='UTF-8'
 Encoding.default_external='UTF-8'

 Still having problems though. I noticed that the encoding.rb file has
 most of its contents commented out. Is this normal?
 Cheers
 Aidy

 On Friday, 9 November 2012 15:23:59 UTC, Adrian Killens wrote:

 That didn't work, in this instance I need to grab via the non-english
 tags as I'm doing some testing around translations.

 On Friday, 9 November 2012 14:17:19 UTC, Joe Fl wrote:

 Hi Aidy,

 Are there any other elements you can use for this link?

 Have you tried this?
 browser.link(:id,/Tovabb/).**click

 Regards,
 Joe

 On Fri, Nov 9, 2012 at 7:49 AM, Adrian Killens ack...@googlemail.com
 wrote:
  Hi There,
  Does anyone know how I can click things in non-english languages that
 have
  non-english characters identifying them?
 
  E.g.
  browser.link(:id, 'Tovább').click
 
  I get the following trying to click these links:
 
  invalid multibyte char (US-ASCII) (SyntaxError)
  invalid multibyte char (US-ASCII)
 
  Cheers
  Aidy
 
  --
  Before posting, please read http://watir.com/support. In short:
 search
  before you ask, be nice.
 
  watir-...@googlegroups.com
  http://groups.google.com/**group/watir-generalhttp://groups.google.com/group/watir-general
  watir-genera...@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




-- 
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] webdriver javascript pop-up

2011-10-25 Thread Cliff Cyphers
I've found that the fire_event can be very problematic which
extensions/alerts is using.  watir-webdriver will be updated to use
selenium-webdriver's switch_to in the near future.  But in the mean time you
can take a look at handling this buy  adding an alert box helper to Watir:

https://github.com/ccyphers/whirlwind/blob/master/lib/watir.rb

Then you can do stuff like:
@browser.alert_box.text
@browser.alert_box.dismiss


On Tue, Oct 25, 2011 at 11:41 AM, Dan dfra...@gmail.com wrote:

 Hello,

 I've tried to implement the dialog handling as described here on
 http://watirwebdriver.com/javascript-dialogs/ using the example at
 http://www.w3schools.com/js/js_popup.asp, but it doesn't seem to work.  I
 believe the application I'm working on is using the same approach that this
 example is to the alerts, but for some reason I can't get it to dismiss this
 pop-up.  I'm successful in disabling it altogether
 using browser.execute_script(window.alert = function() {}), but I'd really
 prefer to be able to capture what the actual alert was and to dismiss it
 like a user would, which seems like watir-webdriver/extensions/alerts
 would allow me to do.

 Here's what I tried:

 require 'rubygems'
 require 'watir-webdriver'
 require watir-webdriver/extensions/alerts

 browser = Watir::Browser.new :firefox
 browser.goto http://www.w3schools.com/js/tryit.asp?filename=tryjs_alert;
 browser.frame(:class = result_output).button(:value = Show alert
 box).wait_until_present
 browser.frame(:class = result_output).button(:value = Show alert
 box).click

 browser.alert do
   browser.button(:value = 'OK').click
 end #= 'the alert message'

 This is the exception I get :

 C:/ruby/lib/ruby/gems/1.8/gems/watir-webdriver-0.3.3/lib/watir-webdriver/elements/element.rb:248:in
 `assert_exists': unable to locate element, using {:value=OK,
 :tag_name=button} (Watir::Exception::UnknownObjectException)

 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


-- 
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] - whirlwind crash coarse for implementing a google test site

2011-10-25 Thread Cliff Cyphers
Chuck, I was thinking that some might look at the demo test site example,
but you do have a valid point and have writing a ground up howto for
searching on google.com:

https://github.com/ccyphers/whirlwind/wiki/Implementing-A-Site---Google-Search-Walkthrough

Thank you for the suggestion.

On Tue, Oct 25, 2011 at 3:01 PM, Chuck van der Linden sqa...@gmail.comwrote:


 I think I sense another watir podcast opportunity.

 Cliff, what you have provided is good info, but might be a little bit
 towards the deep end of the pool for testers who are just learning to
 script with Watir and get a bit out of their depth once you start
 talking about classes, and close to complete confusion once you start
 talking about 'modules'

 I think it might be handy to have an outline at a fairly high level of
 things like 'what goes where' and how the pieces fit together.
 That's all second nature to you since you designed the framework, and
 it might not be that hard for someone who has worked with one or two
 other frameworks to grasp, but for the beginner it's just sort of
 overwhelming and hard to know how and where to start.

 I'd like to see a lot more people make use of some of the great work
 that's being done on frameworks to allow effective testing with watir,
 and integration with other tools like rspec, cucumber, minitest, etc.
 Most experienced folks know that these things are the path to
 effective automation that can scale and grow and not become UN-
 manageable.  Being able to leverage things like existing reporting
 tools etc also prevents you from having to reinvent a lot of wheels
 that are already out there.  However one of the very strengths of
 watir (that you can dive in with almost zero prior programming/
 scripting experience) also tends to create a steep learning curve and
 barrier to entry when it comes to choosing or adopting a framework.

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


[wtr-general] ANNOUNCING WHIRWIND: cucumber + watir-webdriver + best practices

2011-10-24 Thread Cliff Cyphers
What is whirlwind https://github.com/ccyphers/whirlwind?  It adds a few
aspects to cucumber, rspec and watir, resulting in sensible best practices
where one can write more automated test cases in a reliable way without the
framework getting in the user's way.  This is accomplished by having flow
objects automatically created for you so there's no manual steps such as:

@demo_homepage = Demo::HomePage.new.

From rspec definitions and flows you can call screen_shot('some image
description') and the image will be included in the html report residing
under sites/site_name/results.  See an example report
https://cyberconnect.biz/opensource/whirlwind_ex.html.

With best practice of organizing the fixture data by site and test
environment you are not limited to accessing one site from any given feature
that's executing.  For example, say you have two automated test sites,
'SITE1' and 'GMAIL'.  Within both sites you would have defined flows and
elements along with associated fixtures.  Lets say you have a flows defined
under SITE1::HomePage and GMAIL::HomePage.  Anytime you run a feature set
you will automatically have access to instance variables @site1_homepage and
@gmail_homepage. You would also have defined fixture data under
sites/SITE1/conf/base_urls.yml and sites/GMAIL/conf/base_urls.yml.  Now if
you need to navigate between the two sites you could do something like:

@browser.go(@test_data['SITE1'][:base_urls][$environment][:home_page])

Do some actions which results in an email being sent where you now need to
navigate to gmail and check for the confirmation:

@browser.go(@test_data['GMAIL'][:base_urls][$environment][:home_page])

where your base_urls.yml would have something like
:dev:
 :home_page: 'http://someurl.for.dev'
:test:
 :home_page: 'http://someurl.for.test'
:prod:
 :home_page: 'http://someurl.for.prod'

Element Conventions:
Organize your elements into meaningful namespaces such as:

module Demo
  module Elements
class Tabs
  include RSpec::Core::DSL # always include this line in all element
classes
end
class Header
  include RSpec::Core::DSL
end
class Footer
  include RSpec::Core::DSL
end
class Dialogs
  include RSpec::Core::DSL
end
  end
end

Create as many element files as needed for your site under
sites/site_name/elements.  Given the above example name the file something
like sites/demo/elements/demo_common_elements.rb.  Now you have all your
common elements than can be accessed from multiple pages.  Lets take a look
at defining elements:
module Demo
  module Elements
class Menu
  include RSpec::Core::DSL
  def initialize
define_me(:full_menu_div) {@browser.div(:id, 'main_menu')}
define_me(:actions) { full_menu_div.link(:text, 'Actions') }
define_me(:test_alert) {
  actions.mouseover
  full_menu_div.link(:text, 'Test Alert')
}
define_me(:test_dialog) {
  actions.mouseover
  full_menu_div.link(:text, 'Test Dialog')
}
  end
end
  end
end

Flows:
Since flow objects are dynamically created for you it's urgent that you must
have only one module and class per file.  Like elements you can have as many
files under sites/site_name/flows as required.  Notice in the example
below that you instantiate a reference to an element definition.  Always use
the convention as setting the instance variable to @elements.  This is
needed as when the flow instances are automatically created for you it will
expect this format.  Remember all the common elements?  Within your
Demo::Elements::HomePage we instantiated instances
to Demo::Elements::Tabs, Demo::Elements::Menu and Demo::Elements::Dialogs so
that we can access them via items such as
@elements.tabs.registration.element_name.

module Demo
  class HomePage
include RSpec::Core::DSL
attr_reader :elements
def initialize
  @elements = Demo::Elements::HomePage.new
end

def home

@browser.goto(@test_data['demo'][:base_urls][$environment][:demo_home])
  @elements.tabs.registration.wait_until_present
  screen_shot('Landed on Home Page')
end

def registration
  home
  @elements.tabs.registration.wait_until_present
  @elements.tabs.registration.click
  @demo_registrationpage.elements.step_1_next.wait_until_present
  screen_shot('Landed on Registration Page')
end

  end
end

What other magic is done for you?  All the instance variables referencing
the flows are available from each other.  For example, if you are a method
in the Demo::HomePage#method but need to call a method in the
Demo::RegistrationPage flow you can  access @demo_registrationpage from
within the instance of @demo_homepage.  You will notice this above in
Demo::HomePage#registration
@demo_registrationpage.elements.step_1_next.wait_until_present.
 The user doesn't have to wire this up, instance variables have been created
for you at runtime.

Happy Testing
Cliff.

-- 
Before posting, please read 

Re: [wtr-general] Not able to open a chrome browser

2011-10-14 Thread Cliff Cyphers
Error message explains it all.  Unlike IE and FF you need to download
a separate driver for chromedriver_win and ensure it's in your PATH.

On Fri, Oct 14, 2011 at 1:57 PM, Babu suvodasgu...@gmail.com wrote:
 hi my code is :
 require 'rubygems'
 require 'watir-webdriver
 browser1 = Watir::Browser.new :firefox
 browser2 = Watir::Browser.new :ie
 browser2 = Watir::Browser.new :chrome


 firefix and ie is opening but not chrome.
 i have installed chrome in
 C:\Documents and Settings\sdasgupta\Local Settings\Application Data
 \Google\Chrome\Application\chrome.exe


 not under C:\programfiles\...

 i m getting error:
 C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-webdriver-2.7.0/lib/
 selenium/webdrive
 r/chrome/service.rb:18:in `executable_path': Unable to find the
 chromedriver exe
 cutable. Please download the server from 
 http://code.google.com/p/chromium/downl
 oads/list and place it somewhere on your PATH. More info at 
 http://code.google.c
 om/p/selenium/wiki/ChromeDriver.
 (Selenium::WebDriver::Error::WebDriverError)
        from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
 webdriver-2.7.0/lib/sele
 nium/webdriver/chrome/service.rb:28:in `default_service'
        from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
 webdriver-2.7.0/lib/sele
 nium/webdriver/chrome/bridge.rb:12:in `initialize'
        from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
 webdriver-2.7.0/lib/sele
 nium/webdriver/common/driver.rb:35:in `new'
        from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
 webdriver-2.7.0/lib/sele
 nium/webdriver/common/driver.rb:35:in `for'
        from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
 webdriver-2.7.0/lib/sele
 nium/webdriver.rb:81:in `for'
        from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-webdriver-0.3.5/
 lib/watir-w
 ebdriver/browser.rb:35:in `initialize'
        from chrome.rb:3:in `new'
        from chrome.rb:3

 --
 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: Not able to open a chrome browser

2011-10-14 Thread Cliff Cyphers
Update your path.  If you can't run the exe from a command line,
without being in the directory the exe is in, it's defiantly a PATH
issue.

On Fri, Oct 14, 2011 at 2:15 PM, Babu suvodasgu...@gmail.com wrote:
 i addedd all the file under
 C:\Documents and Settings\sdasgupta\Local Settings\Application Data
 \Google\Chrome\Application
 but getting same error?
 is only WebDriver*.* file need to load?

 On Oct 14, 3:03 pm, bis bis...@gmail.com wrote:
 http://code.google.com/p/selenium/wiki/ChromeDriver



 On Fri, Oct 14, 2011 at 3:57 PM, Babu suvodasgu...@gmail.com wrote:
  hi my code is :
  require 'rubygems'
  require 'watir-webdriver
  browser1 = Watir::Browser.new :firefox
  browser2 = Watir::Browser.new :ie
  browser2 = Watir::Browser.new :chrome

  firefix and ie is opening but not chrome.
  i have installed chrome in
  C:\Documents and Settings\sdasgupta\Local Settings\Application Data
  \Google\Chrome\Application\chrome.exe

  not under C:\programfiles\...

  i m getting error:
  C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-webdriver-2.7.0/lib/
  selenium/webdrive
  r/chrome/service.rb:18:in `executable_path': Unable to find the
  chromedriver exe
  cutable. Please download the server from
 http://code.google.com/p/chromium/downl
  oads/list and place it somewhere on your PATH. More info at
 http://code.google.c
  om/p/selenium/wiki/ChromeDriver.
  (Selenium::WebDriver::Error::WebDriverError)
         from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
  webdriver-2.7.0/lib/sele
  nium/webdriver/chrome/service.rb:28:in `default_service'
         from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
  webdriver-2.7.0/lib/sele
  nium/webdriver/chrome/bridge.rb:12:in `initialize'
         from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
  webdriver-2.7.0/lib/sele
  nium/webdriver/common/driver.rb:35:in `new'
         from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
  webdriver-2.7.0/lib/sele
  nium/webdriver/common/driver.rb:35:in `for'
         from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
  webdriver-2.7.0/lib/sele
  nium/webdriver.rb:81:in `for'
         from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-webdriver-0.3.5/
  lib/watir-w
  ebdriver/browser.rb:35:in `initialize'
         from chrome.rb:3:in `new'
         from chrome.rb:3

  --
  Before posting, please readhttp://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...-
   Hide quoted text -

 - Show quoted text -

 --
 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: How to click on a div tag

2011-10-13 Thread Cliff Cyphers
And if you are using the yahoo and gmail accounts for test purposes,
pop them instead and much easier to automate with ruby('net/pop').

On Thu, Oct 13, 2011 at 8:34 PM, orde ohil...@gmail.com wrote:
 I've seen this topic come up a few times in this forum (i.e.
 automating yahoo email or gmail), and I'd advise finding another
 option if possible.  They have tons of dynamic content and change
 frequently, so it's a serious challenge to maintain.

 Sorry it's not the answer that you're looking for, but that's my 2
 cents.

 HTH

 orde

 On Oct 13, 3:53 pm, iamqa srko...@gmail.com wrote:
 I am trying to automate some testing on yahoo email. I need to click
 on the subject or from, so that the email content opens up. I am able
 to select the first email by firing onmousedown but unable to go
 forward from there.
 This is my code:

 @browser.div(:id,shellcontent).div(:id,inboxcontainer).div(:id,msg-
 list).div(:class,list-view ).div(:class,list-view-items
 ).div(:class=list-view-item  btn-msglist resize-
 columns, :index=1).div(:class,subj).fire_event('onmousedown')

 I tried firing onkeyup, onkeydown, onmouseup, onmousedown, onclick but
 nothing is working. I also tried send_keys({ENTER}) but was getting
 an error as:

 C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.8.1/lib/watir/element.rb:
 378:in `method_missing': undefined method `send_keys' for #Watir::Div:
 0x2b58d78 located=false how=:class what=subj (NoMethodError)
         from email_Agent_MonthlyNonMemberContent_Yahoo.rb:84

 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


-- 
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] watir-webdriver survey for adding items such as: alert_box, scroll_to, and in_viewable_area?

2011-10-11 Thread Cliff Cyphers
Hello Watir users

I wanted to write the watir-general community and inquire about how
much pain you feel around what appears to be some common items that
might need to be added to watir-webdriver.

1.  The underlying selenium-webdriver can not perform an action on an
element if it isn't in the viewable area on the browser.  Actions such
as click, text, html, etc on such elements will fail under this
condition.
2.  The code for handling alert boxes seams to be very flaky on
certain OS/browser combinations.
3.  fire_event('mouseover') doesn't work on all OS/browser combinations

All of these aspects can easily be updated to make your life easier.
Updates to handle each of these aspects are included in qa_robusta,
which has previously been mentioned on the list.  If you feel that
these features are valuable, there's a better chance they will get
incorporated into the main release of watir-webdriver if you voice
your opinion.

See https://github.com/ccyphers/qa_robusta/blob/master/qa_observer/lib/watir.rb
for a current implementation to handle these points.  Note, personally
I think it might be best to make a slight update to this
implementation, for the element not in the viewable area.  All method
calls to Watir::Element which require the element to be in view, could
first:

Watir::Element#scroll_to unless unless Watir::Element#in_viewable_area?

Dealing with alert boxes you would now be able to do something like:
some_element.alert_box.text
some_element.alert_box.dismiss

For mouseovering an element, you no longer would need to call
fire_event, which is unreliable.  You could simply:
some_element.mouseover

Thank you for your comments
Cliff.

-- 
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: Strangeness with watir and IE or I may be missing something.

2011-10-10 Thread Cliff Cyphers
Chuck

Good point, more people need to respect said terms of use.  Although
one's intentions isn't to inter-fear, perform harm, or use their data
for other purposes, it doesn't speak good for the OOS community to not
abide.

For demo purposes, why not just create a simple site as a rack app or
with camping, sinatra, etc.  Also, if there are specific test element
that would be good to cover for demo purposes I'll put them in the
demo site of QA Robusta.  So far the demo site supports a JS/CSS drop
down menu, tabed pages and an accordion style registration.

On Mon, Oct 10, 2011 at 5:59 PM, Chuck van der Linden sqa...@gmail.com wrote:
 Sorry for the initial hardline response.. I think I've run into one to
 many 'content rippers' lately who are asking questions about how they
 can use watir to access sites with the pretty clear intent of content
 theft and I had a bit of a knee-jerk response.

 I think the tutorial stuff that Bis and Alister are doing is valuable
 stuff and for a noble purpose that would all in all benefit the watir
 community.  However I think it would be a good idea to get official
 permission since while it might be in the spirit of what Etsy is all
 about, it is (at least by my reading) against their terms of use, and
 their api terms of use.  Specifically I think this work would violate
 these portions of their agreements:

 1)  From their main terms of use:
 You agree that you will not use any robot,
 spider, scraper or other automated means to access Etsy for any
 purpose whatsoever, except to the extent expressly permitted by and in
 compliance with Etsy's API Terms of Use or otherwise without Etsy's
 prior express written permission.

 any Watir scripts would qualify under 'other automated means'

 2) When we get into their API terms (http://www.etsy.com/developers/
 terms-of-use) it gets thornier because those terms basically restrict
 developers to using the API, and Watir isn't doing that.

  9. Website Human Use Restriction And Use of API
  The API is the only supported method for users to access data
 programmatically from Etsy. The Etsy Website, including Content and
 applications is published solely for direct access by human users.
 'Spiders', 'crawlers', 'bots' and all other automated software or
 hardware devices designed to access and 'read' or otherwise analyze
 the Website independently are prohibited unless they are expressly so
 authorized by Etsy.

 Again Watir would fall into the general wording of 'all other
 automated software ... designed to access..'

 Not sure who you wrote to, but the proper address for anything
 pertaining to this appears to be develo...@etsy.com

 I hope they will say yes, their site makes an interesting target and
 anyone using it to practice their automation skills is going to get
 exposed to some interesting stuff for sale and might even buy
 something.

 If they say no then an alternative will need to be found.  Or we might
 even have to create out own (which might be an interesting project)..
 I know Bret had something he was using for training when he was trying
 to make a go of 'watircraft' so if this is a non starter that might be
 one place to start.  (I'd love to eventually have our own training
 site, perhaps even persuade some of the third party tools venders to
 allow us to put samples of their stuff up on it so we could end up
 creating demonstrations of how to code against all these various wacky
 javascript controls for things like treeviews, multi-select lists,
 etc.

 On Oct 10, 10:57 am, Jari Bakken jari.bak...@gmail.com wrote:
 You may be interested in Alister's Etsy code 
 athttps://github.com/alisterscott/EtsyWatirWebDriver/







 On Mon, Oct 10, 2011 at 6:56 PM, bis bis...@gmail.com wrote:
  No I do not work for Etsy in any way, Also the automated tests using watir,
  taza, rspec, and cucumber do not violate the terms of use for the site or
  api as far as i understand them.

  But in your concern I have fired off a letter to Etsy about this and the
  ToS. Also if this is in fact the case then I will also send an email to
  everyone else that has written a tutorial or testing examples using the 
  Etsy
  site as well

  this is my blog post about the tests I wrote against etsy
 http://thechort.com/blog/?p=105
  and the code
 https://github.com/hammernight/etsy_cucumber_taza_tutorial/

  On Mon, Oct 10, 2011 at 1:10 PM, Chuck van der Linden 
  sqa...@gmail.comwrote:

  Before we go any further assisting you with this, can you offer some
  assurance that you are either working for Etsy or have specific
  written permission to interface with their site in this way?

  Otherwise what you are doing violates their terms of service (see
  below) and while I cannot speak for others, I for one refuse to be a
  party to any such activity.

  From Etsy's terms of service:

  11. Access and Interference

  Etsy may contain robot exclusion headers which contain internal rules
  for software usage. Much of the information on Etsy 

Re: [wtr-general] Re: Introducing QA Robusta - A System Test Automation Framework

2011-10-06 Thread Cliff Cyphers
It has similar aspects as taza, with regard to elements and flows.
Actually, a lot of what's in taza is something I discussed with some
of the developers who released this when I was contracting for GID.

Currently, it's only configured to take screen shots automatically
when links are clicked but the user can take a screen shot anytime
they wish:

TestExtention.screen_shot($current_test_method, 'pre')

I plan on adding an option to disable automatic screen shots.

Also, watir has been extended to that Watir::Element includes methods
to see if an element is in the view able area and to scroll to the
element:

https://github.com/ccyphers/qa_robusta/blob/master/qa_observer/sites/demo/test_cases/test_element_scroll_to.rb

It's not intended to work with per se, cucumber, rspec or other
frameworks.  For now I want to stick with minitest but might add some
of minitest spec features in.  Personally, I feel that having a good
separation and flow to the test framework where test case writers can
make simple calls to perform their testing is more important than test
case syntax.

Zeljko, I look forward to discussing this in more details in an up
coming screencast.  I most likely won't be able to get to this until
next week.

On Thu, Oct 6, 2011 at 2:52 PM, Chuck van der Linden sqa...@gmail.com wrote:
 Cliff,

 How does this framework compare with watirspash, taza, or watircraft?

 What things are you doing that they are not, and vise versa?

 Why might somone want to use this framwork as opposed to one of the
 others?

 How well does your framework work and play with Specification by
 Example tools such as RSpec and Cucumber?

 Is it possible to configure things so that screenshots are taken only
 when an assert or .should  is failing, instead of on every link or
 button click?

 On Oct 3, 10:09 am, Cliff cliff.cyph...@gmail.com wrote:
 Hello Watir Community

 I've been a fan of Watir for web based automation for many years now
 and would like to introduce a framework intended to provide the means
 for creating system level test cases.  What is meant by system level
 test cases?  As a tester when you manually test an application often
 times you find yourself not only testing a web interface but having to
 login to a remote unix machine and verify some results.  With QA
 Robusta writing test cases interfacing with multiple interface types
 is a breeze.  Right now, only remote unix support is provided but I'll
 be adding remote windows as well using psexec.  
 Seehttps://cyberconnect.biz/opensource/qa_robusta.htmlfor complete
 details.  Be sure to check out a demo report as 
 wellhttps://cyberconnect.biz/opensource/demo_results.html.

 * Elements, such as links, buttons, and other html objects are defined
 in one location. This ensures over
   time the user won't have definitions spread out throughout different
 layers of code requiring time
   consuming updates if the application under test is modified.
 * Well defined flows allows the user to have a common means for
 navigating and controlling interactions
   with the application under test. This takes all logic out of test
 classes and yields in higher more modular
   code re-use.
 * When an application requiring testing has the elements and flows
 implemented less code savy resources
   can easily add new test cases once trained on how to access the
 flows and elements.
 * When ever a link or button is clicked a screen shot is taken
 * Results are available under site/results directory in html format.
 Report includes the rdoc on a per test class
   method along with any screen shots taken.
 * Transparent remote Unix command execution leading to well defined
 interfaces for common task. For example,
   one may have a class defined specifically for RemoteUnixNetwork.
 This class would have methods such as,
   assign_ip, ifup, ifdown, etc. This class then would be able to
 perform these task on any remote Unix machine.
 * Executes the same on Windows or Linux/Unix environments. Developers
 have the freedom to develop on the
   platform of choice.
 * Mechanize extension: Allows the user to define a web application's
 page elements in a YAML format and provide
   navigation paths accessing the YAML structure to interact with the
 web application. Users can also perform direct
   http.post or any other mechanize functionality when defining state-
 full interfaces to hit a web application without
   going through a browser.

 Happy Testing
 Cliff.

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


[wtr-general] Re: Very slow typing speed for firefox 2 : watir 1.6.2

2009-03-12 Thread Cliff Cyphers

I've seen similar resuls with putting a little delay in the  
read_socket()..  I thinks it's a resourse issue in where the OS is  
polling till it's free.  It just happens to be with a litle delay  
there's less polling for the file descriptor IO.

The read_socket is waiting on data hence the delay.  We all know it's  
easier to point out the issue to find the  fix.

FYI, for me this is happening on ubuntu with FFv3.0.7 and jssh0.9

Sent from my iPhone

On Mar 12, 2009, at 4:53 PM, Aedorn Varanis aed...@gmail.com wrote:


 Something amusing about this issue. I noticed, by pure chance, that if
 I move another window around while the test is running, the typing
 goes faster. So if I rapidly move a window left to right, over and
 over, the tests I do complete really quickly. Once I stop moving the
 window, it goes back to the really slow 1 character per second typing.

 I'm not even sure how that is related, in fact, I can't even begin to
 think of a reasonable explanation as to why. This kind of puts it in
 the realm of a whole other issue all together.

 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Very slow typing speed for firefox 2 : watir 1.6.2

2009-03-02 Thread Cliff Cyphers

Late to the thread but wanted to add something recently observed while
running firefox through strace.  It appears there are some flow
control issues which may explain the slow typing speed.  It's also
been noted with some puts in the read_socket method the problem isn't
as severe.

While it may be in the JSSH code it may require updates on both sides
and there's always a chance it's 100% on the ruby side.  I'll be
digging into both as well over the next week or so.  From the ruby
side maybe we can set some fcntl flags (looks unlikely through).

system call failure from strace:
read(3, 0x8d165d4, 4096)= -1 EAGAIN (Resource
temporarily unavailable)


On Mon, Mar 2, 2009 at 9:38 AM, Cliff cliff.cyph...@gmail.com wrote:



 -- Forwarded message --
 From: Charley Baker charley.ba...@gmail.com
 Date: Nov 12 2008, 10:24 am
 Subject: Very slow typing speed for firefox 2 : watir 1.6.2
 To: Watir General


 I'm seeing this happen with one of the people I'm working with, slow
 meaning
 almost 1sec/character in this case. He's running firefox on linux. My
 guess
 is that it's due to jssh, but it's hard to tell, I'll poke around and
 see if
 I can find out more.
 What OS/FireFox version and jssh addon are you using?

 Thanks,

 Charley

 On Wed, Nov 12, 2008 at 8:43 AM, Bret Pettichord
 b...@pettichord.comwrote:



 Natasha wrote:
  I was able to install and run my test against IE using latest Watir.
  But I found that the typing speed is very slow for firefox.

  For e.g. following command executed very slowly:

  $ie.text_field(:id,txtLine2).set(this is text field 2)

  Is this a known issue? Is there anyway we can speep this up somehow?

 Many of us have seen this problem, but it seems to show up
 intermittently and we don't really know the cause.

 Bret

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---