[wtr-general] Re: thinking about automation frameworks/harnesses

2009-04-29 Thread JArkelen

It wasn't broad criticism, it was just my 2 cents about combining test
data and object data.
Any attempt to develop a framework/directory structure/harness/
whatever should be applauded, because it will make watir more mature
and usable in my opinion.

Cheers,
John

On Apr 29, 1:48 am, Chris McMahon christopher.mcma...@gmail.com
wrote:
 On Apr 28, 8:56 am, JArkelen johnvanarke...@gmail.com wrote:

  No, I have my own framework/directory structure for my tests and I'm
  perfectly happy with it.

 It seems hardly sporting to issue such a broad criticism and then
 leave without an example.  :-)

 I wrote this to illustrate some principles of UI-test design, such
 that I could explain it to an audience in less than 30 minutes, not
 knowing how sophisticated that audience might be.  It is intentionally
 simple, and it is pretty much an imperative programming style.  If you
 see a way to make it better while keeping it simple, I'd very much
 like to see what you have in mind.

 Also, I'm a pretty crappy OO programmer, so again, I would learn
 something to see what changes you have in mind.

 -Chris
--~--~-~--~~~---~--~~
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: Excel Data Driven Harness with Database Verifications

2009-04-29 Thread lokesh.agra...@gmail.com

Thanks Tiffany,

I will try to write stylesheet using this tutorial.


Regards,
Lokesh Agrawal


On Apr 27, 7:37 pm, Tiffany Fodor tcfo...@comcast.net wrote:
 Hi Lokesh!

 You can use any stylesheet you like to transform the xml to html, it
 just has to be referenced in the xml you're transforming.  I haven't
 done a lot of work with xsl, just enough to write the stylesheet
 included with the framework.  I learned what I know here:

 http://www.w3schools.com/xsl/

 Maybe you can find some tips on improving the report there.

 Hope this helps!

 -Tiffany

 On Apr 27, 5:47 am, lokesh.agra...@gmail.com

 lokesh.agra...@gmail.com wrote:
  Hi All,

  I am using Excel Data Driven Harness with Database Verifications as
  framework in my 
  project.http://wiki.openqa.org/display/WTR/Excel+Data+Driven+Harness+with+Dat...

  There is one xsl sheet (transform-results.xsl)to convert xml report to
  HTML report. I don't like that report.

  is there any other way to generate report in HTML file with this
  framework or there is any other stylesheet (more pretty) which I can
  use?

  Thanks in advance for your help.

  Thanks and Regards,
  Lokesh Agrawal
--~--~-~--~~~---~--~~
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: thinking about automation frameworks/harnesses

2009-04-29 Thread George

Maybe this speaks of my programming ignorance, but what exactly
constitutes a test harness?  I hear this phrase bandied about, but
I'm not sure I have a solid grasp of what this actually means.

I hope this isn't hijacking the thread, but I would really like a
better understanding.  I know with my scripts, I have modularized them
where I have html elements for each page of my app in a separate file,
then I have methods in another, test data in another (eventually I'll
use an Excel file).

Thanks in advance,

George


On Apr 28, 11:47 pm, JArkelen johnvanarke...@gmail.com wrote:
 It wasn't broad criticism, it was just my 2 cents about combining test
 data and object data.
 Any attempt to develop a framework/directory structure/harness/
 whatever should be applauded, because it will make watir more mature
 and usable in my opinion.

 Cheers,
 John

 On Apr 29, 1:48 am, Chris McMahon christopher.mcma...@gmail.com
 wrote:

  On Apr 28, 8:56 am, JArkelen johnvanarke...@gmail.com wrote:

   No, I have my own framework/directory structure for my tests and I'm
   perfectly happy with it.

  It seems hardly sporting to issue such a broad criticism and then
  leave without an example.  :-)

  I wrote this to illustrate some principles of UI-test design, such
  that I could explain it to an audience in less than 30 minutes, not
  knowing how sophisticated that audience might be.  It is intentionally
  simple, and it is pretty much an imperative programming style.  If you
  see a way to make it better while keeping it simple, I'd very much
  like to see what you have in mind.

  Also, I'm a pretty crappy OO programmer, so again, I would learn
  something to see what changes you have in mind.

  -Chris
--~--~-~--~~~---~--~~
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: thinking about automation frameworks/harnesses

2009-04-29 Thread Chris McMahon



On Apr 29, 12:47 am, JArkelen johnvanarke...@gmail.com wrote:
 It wasn't broad criticism, it was just my 2 cents about combining test
 data and object data.

I don't know what you mean by object data.  Probably a character
flaw on my part, but that's why I was hoping for an example of what
you meant.  And since the original example is so tiny (and so
imperative), refactoring it shouldn't take more than a minute or so.
--~--~-~--~~~---~--~~
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: send keystrokes to ie frame - text field

2009-04-29 Thread Charley Baker
You're calling send_keys on the string in .set. Try this instead:

$IE0.frame(:index, 11).frame(:index, 7).text_field(:id,
'dataEntryField_40870').set(testtext)

$IE0.frame(:index, 11).frame(:index, 7).text_field(:id,
'dataEntryField_40870').send_keys({ENTER})

Charley Baker
blog: http://blog.charleybaker.org/
Lead Developer, Watir, http://wtr.rubyforge.org
QA Architect, Gap Inc Direct


On Wed, Apr 29, 2009 at 9:38 AM, deralex alexander.fed...@googlemail.comwrote:


 Hi,

 i am actually getting into watir and i really like it.

 But i am missing sending keystrokes to IE text field in a frame.
 Case:
 We have quick search function e.g. adding a name to a field test
 then the db is search for all ppl. with test in the name. After this
 i go a list displayed with a ppl. with test in surname and i can
 select those via pressing down and after this pressing enter to
 confirm the user.

 So i need to add test to the search field then wait for the result.
 It will be displayed but i have to keep the focus in the search field,
 otherwise the search result will be lost and no selection possible.

 I found:

 http://wtr.rubyforge.org/rdoc/

  send_keys(key_string)

 Send key events to IE window. See
 www.autoitscript.com/autoit3/docs/appendix/SendKeys.htm
 for complete documentation on keys supported and syntax.


 I can put text into the serach field e.g.

 $IE0.frame(:index, 11).frame(:index, 7).text_field(:id,
 'dataEntryField_40870').set(testtext)

 =OK

 but i want adding this text and right after it pressing {DOWN} then
 {ENTER}

 i try:

 1.)
 $IE0.frame(:index, 11).frame(:index, 7).text_field(:id,
 'dataEntryField_40870').set(testtext).send_keys({ENTER})


 ERROR MESSAGE:
 tests_script_in_actual_ie_window.rb:31: undefined method `send_keys'
 for :String (NoMethodError)
 Exit code: 1

 = not working

 Can someone help me please?


 


--~--~-~--~~~---~--~~
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: FireWatir 1.6.2 unittests don't run

2009-04-29 Thread ash

I could also use some help with this so if the wiki could be updated
that would be great.
Went to see where the commonwatir directory should be and discovered
that there is already a 'commonwatir-1.6.2' directory here; C:\Ruby\lib
\ruby\gems\1.8\gems\commonwatir-1.6.2.
Any help would be gratefully appreciated.

Cheers...Ash

--~--~-~--~~~---~--~~
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: thinking about automation frameworks/harnesses

2009-04-29 Thread Lisa Crispin
Speaking as someone who is definitely OO-challenged and a barely competent
Ruby scripter, I like the simplicity of what Chris did, I can understand it
right away. If I were someone just starting out on Watir, it would make
sense to me.
-- Lisa

On Wed, Apr 29, 2009 at 9:08 AM, Chris McMahon 
christopher.mcma...@gmail.com wrote:




 On Apr 29, 12:47 am, JArkelen johnvanarke...@gmail.com wrote:
  It wasn't broad criticism, it was just my 2 cents about combining test
  data and object data.

 I don't know what you mean by object data.  Probably a character
 flaw on my part, but that's why I was hoping for an example of what
 you meant.  And since the original example is so tiny (and so
 imperative), refactoring it shouldn't take more than a minute or so.
 



-- 
Lisa Crispin
Co-author with Janet Gregory, _Agile Testing: A Practical Guide for Testers
and Agile Teams_ (Addison-Wesley 2009)
http://lisacrispin.com

--~--~-~--~~~---~--~~
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: setting browser through rake

2009-04-29 Thread Bret Pettichord

Try this:

  ENV['watir_browser'] = 'firefox'

Setting Watir::Browser.default in your rake file won't work, because 
Cucumber is running in a separate process.

Bret

aidy lewis wrote:
 Hi,

 Has anyone managed to set the browser through Rake?


 rake
 require 'cucumber/rake/task'
 require 'watir'


 Cucumber::Rake::Task.new(default, features) do |t|
   t.cucumber_opts = -f TeamCityFormatter -f html --out story-results.html
 end

 task :ff do
   ENV['ENVIRONMENT']='systest'
   Watir::Browser.default = 'firefox'
   Rake.application[default].execute
 end

 task :ie do
   ENV['ENVIRONMENT']='systest'
   Watir::Browser.default = 'ie'
   Rake.application[default].execute
 end
 /rake

 CI
 rake ie
 rake ff
 /CI

 As I get the default browser of Firefox, for both of the above commands.

 Thanks
   


-- 
Bret Pettichord
CTO, WatirCraft LLC, www.watircraft.com
Lead Developer, Watir, www.watir.com
Blog, www.io.com/~wazmo/blog
Twitter, www.twitter.com/bpettichord

Ask me about Watir training
www.watircraft.com/training


--~--~-~--~~~---~--~~
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: Does watir::IE.attach() :hwnd support embedded browsers ?

2009-04-29 Thread mwolfe

hey basu, did you ever figure out this issue?
I'm trying to do essentially the same thing (work with an embedded IE
control).
I found the function __IEControlGetObjFromHWND
from the IE.au3
Of course, this is not built into the binary for autoit so I can't use
that. It looks (kind of) like you tried to implement that in ruby.
Unfortunately its pretty complicated for a OLE/COM newbie like me.  It
seems like there should be an easier way though but I have yet to
come up with anything.
Let me know if you've figured it out.

On Mar 2, 1:13 am, basu bas.go...@gmail.com wrote:
 i tried getting the automation object of the embedded browser but no
 success, i not able to figure out the issue, could some give inputs on
 this please ?
 (There is an function defined in IE.au3 (autoitv3 UDF) to get the IE
 object from the IE handle, i tried re writting the same function in
 ruby)

 Code tried ..

 # Start winamp player
  ...

 require 'Win32API'
 SMTO_ABORTIFHUNG = 0x0002
 Win32API.new(ole32, CoInitialize, ['P'] , 'I').call(0)

 reg_msg = Win32API.new(user32, RegisterWindowMessage, ['P'] ,
 'I').call(WM_HTML_GETOBJECT)
 puts reg_msg

 # Main Window is title of winamp player
 # Internet Explorer_Server1 is a IE control embedded in the player
 hnd = @@autoit.ControlGetHandle(Main Window, , Internet
 Explorer_Server1)
 puts hnd

 result= *16

 aInt = [0xA7, 0x31, 0x0, 0xA0, 0xC9, 0x8, 0x26, 0x37].pack 'I*'
 a = [0x626FC520, 0xA41E, 0x11CF, aInt].pack 'IIIP'

 sendMessagetimeout = Win32API.new(user32, SendMessageTimeout,
 ['L','I','I','I','I','I','P'] , 'L')
 sendMessagetimeout.call(hnd.hex, reg_msg, 0, 0, SMTO_ABORTIFHUNG,
 1000, result)
 puts result.unpack(L)

 idisp=0
 oIE = Win32API.new(oleacc, ObjectFromLresult, ['P', 'P','I','P'] ,
 'L')
 oIE.call(result, a, 0, idisp)

 # returning zero
 puts idisp.unpack(L)

 Thanks in advance !

 On Feb 24, 10:40 am, basu bas.go...@gmail.com wrote:

  I want to know whether the attach() method supports access to the
  browser embedded in a windows applications (Ex: Internet
  Explorer_Server1 control embedded in the winamp player) , if not could
  some one provide me the inputs on how to achieve this
  Thanks,Basu

--~--~-~--~~~---~--~~
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] How to

2009-04-29 Thread Prince3105

Hi All,

I use below code for login.

  def login(user_id, password, module_table_id, module_name,
page_table_id, page_name)
@ie = Watir::IE.new
@ie.goto $url
@ie.maximize
@ie.bring_to_front

@ie.text_field(:id,txtUserName).set user_id
@ie.text_field(:id,txtPassword).set password
@ie.button(:id,btnSubmit).click

@ie.table(:id,module_table_id).cell(:text,module_name).fire_event
(onMouseOver)
@ie.table(:id,page_table_id).cell(:text,page_name).click
@ie.form(:id,form1).flash
  end

Above function works good. But each and every time i have to change
the module_table_id and page_table_id
as per user role rights. it really kills. I want to modify the
function more simple and reusable.

I expect a function like below.

  def login(user_id, password,  module_name,  page_name)

  end

I used regular expression in both table IDs, but it didnt work. So
please throw some light on this issue.


Thanks,

Prince3105
--~--~-~--~~~---~--~~
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] How to click a cell in a dynamically changing Table?

2009-04-29 Thread Prince3105

Hi All,

I am a newbie to Watir and Ruby. I  use below function for login
process. As per user's Role Rights the user can navigate to the
permitted pages.  Initially user has to click the main menu, like
admin, master, operation... clicking on the main menu will show
allotted pages names dynamically in OnMouseOver.  then he can click
the page name and navigate to the particular page.

Code

  def login(user_id, password, module_table_id, module_name,
page_table_id, page_name)
@ie = Watir::IE.new
@ie.goto $url
@ie.maximize
@ie.bring_to_front

@ie.text_field(:id,txtUserName).set user_id
@ie.text_field(:id,txtPassword).set password
@ie.button(:id,btnSubmit).click

@ie.table(:id,module_table_id).cell(:text,module_name).fire_event
(onMouseOver)
@ie.table(:id,page_table_id).cell(:text,page_name).click
   end

On the above code module_table_id and page_table_id will be
changed as per user. I want to modify the function as simple and
reusable. I need it like below.

def login(user_id, password,module_name, page_name)
  #code
end

I used Regular expression in table id but watir failed to identify the
table. so i want to iterate all available tables and check all
available cells finally click the page name cell. So Experts please
throw some light on my request.

Thanks,
Prince3105.


--~--~-~--~~~---~--~~
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: How to

2009-04-29 Thread Prince3105

Sorry mates please avoid this mail and refer another mail, in which i
have described my issue clearly.

@Moderator - please delete this mail. I pressed the send button
accidentally.

Thanks.

On Apr 30, 10:07 am, Prince3105 prince3...@gmail.com wrote:
 Hi All,

 I use below code for login.

   def login(user_id, password, module_table_id, module_name,
 page_table_id, page_name)
     @ie = Watir::IE.new
     @ie.goto $url
     @ie.maximize
     @ie.bring_to_front

     @ie.text_field(:id,txtUserName).set user_id
     @ie.text_field(:id,txtPassword).set password
     @ie.button(:id,btnSubmit).click

     @ie.table(:id,module_table_id).cell(:text,module_name).fire_event
 (onMouseOver)
     @ie.table(:id,page_table_id).cell(:text,page_name).click
     @ie.form(:id,form1).flash
   end

 Above function works good. But each and every time i have to change
 the module_table_id and page_table_id
 as per user role rights. it really kills. I want to modify the
 function more simple and reusable.

 I expect a function like below.

   def login(user_id, password,  module_name,  page_name)

   end

 I used regular expression in both table IDs, but it didnt work. So
 please throw some light on this issue.

 Thanks,

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