[wtr-general] Error in script as button is disable for some time

2010-12-02 Thread Sudeep
Hi,

I am automating an application which adds goals for the day. It
contains a text area in which a goal is written and when the Submit
Goal is clicked, it is added to the Goal List. The user then can add
the next goal.

When the goal is being addeed to the goal list, till the action is
completed, the Add Goal button remains disabled and after the goal
is added, the button is enabled again to add the next goal.

As the script does not take into account the disable time of the
button, it is throwing an error message while running the WATIR script
which says the button is disabled.

following is my code:

require rubygems
require watir

url=http://ourgoalplan.com;
browser=Watir::IE.start(url)
putsTest Started

browser.text_field(:name,txtName).set(sudeepp)
browser.text_field(:name,txtPassword).set(x)
browser.button(:name,btnLogin).click

#This is Goal 1
browser.text_field(:name,ucAddGoal$txtAddGoal).set(Execute RUBY
WATIR programs.)
browser.button(:name,ucAddGoal$btnAddGoal).click

#This is Goal 2
browser.text_field(:name,ucAddGoal$txtAddGoal).set(Execute the
testcases for page level elements.)
browser.button(:name,ucAddGoal$btnAddGoal).click

putsGoals added


The button remains disabled for sometime when a goal is added to the
goal list.


Please can you suggest a way to get rid of this. Do we have any
feature to make the control wait for sometime till the button is
enabled again.


Thanks in advance,
Sudeep.

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

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


Re: [wtr-general] Error in script as button is disable for some time

2010-12-02 Thread Željko Filipin
On Thu, Dec 2, 2010 at 12:20 PM, Sudeep sudeeppattn...@gmail.com wrote:
 Do we have any
 feature to make the control wait for sometime till the button is
 enabled again.

Sure:

http://wiki.openqa.org/display/WTR/How+to+wait+with+Watir

I remember people saying wait syntax changed in the new Watir release, so
search this list if the code from the wiki page does not work.

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

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

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


[wtr-general] Re: click_no_wait not working for Checkbox

2010-12-02 Thread Babitha
Try increasing the sleep time. When it works through IRB, but not in
code, most often than not, the issue is related to timing.

On Nov 30, 3:30 am, Deep dedeepya.kanipa...@gmail.com wrote:
 Hi,

 I need to clear the checkbox which gives a pop up with OK and Cancel
 buttons. Then I have to click on OK button to proceed.

 I have used the following code to clear the check box:

      Object.click_no_wait
      Sleep 40

 To click on OK button on the pop up, code used is

           When /^clicks OK in the pop up box$/i do
            sleep 5
            startClicker(browser, OK, 60)
           end

 Have the following method used for startClicker

 def startClicker(browser, button , waitTime = 9, user_input = nil)
         # get a handle if one exists
         hwnd = browser.enabled_popup(waitTime)
         if (hwnd)  # yes there is a popup
                 w = WinClicker.new
                 if (user_input)
                         w.setTextValueForFileNameField(hwnd, #{user_input})
                 end
                 # I put this in to see the text being input it is not 
 necessary to
 work
                 sleep 3
                 # OK or whatever the name on the button is
                 w.clickWindowsButton_hwnd(hwnd, #{button})
                 #
                 # this is just cleanup
                 w = nil
   end
 end

 Ruby Version: 1.8.6_26

 Issue Description: click_no_wait , clears the check box and throws
 popup when tested through IRB. But the same is not working when i run
 the automated script.

 Can anyone provide your inputs here. Thanks much.

-- 
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] Accessing internal FireWatir methods -- get_links()

2010-12-02 Thread dave
I was checking out the showLinks() method
http://wtr.rubyforge.org/rdoc/1.6.5/classes/FireWatir/Firefox.html#M000133
and checking out the source

# File firewatir/lib/firewatir/firefox.rb, line 782
def show_links
  links = Document.new(self).get_links
  puts There are #{links.length} links
  index = 1
  links.each do |l|
puts link:  name: #{l.name}
puts  id: #{l.id}
putshref: #{l.href}
puts   index: #{index}
index += 1
  end
end

it would be nice to have access to the get_links() method... Is there
a way to access this?

-- 
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] WatirRecorder being forked and resurrected.

2010-12-02 Thread watirboy
Hey Guys,

I dont know how else to tell people about this, and I hate promoting
it, but I have recently resurrected the WatirRecorder that Hanselman
did back in the day. It is updated to use more modern WATIR standards
and calls a config.xml file for template changes.

http://code.google.com/p/watirrecordersharp/

I would love the community to play, test, break, and contribute if
possible. This is a first release, and I am planning on changing the
UI from utilizing SandBar and SandDock to WPF.

Again, any help will be tremendous. It's a great tool and I would hate
to see it die...

--watirboy

-- 
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] I can find an element with irb, but when I run the test it cannot be found, and also not by SciTE tool.

2010-12-02 Thread Shlomit Gazit
The watir code I have is:
ie.cell(:class,c2p-action-down-arrow-horizontal).click

When I do inspect element I see: td class=c2p-action-down-arrow-
horizontal
/td
When I do view source I cannot find 'c2p-action-down-arrow-
horizontal'.

Any idea why?

-- 
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] WatirRecorder being forked and resurrected.

2010-12-02 Thread Charley Baker
Hey Enrique,

  Good work. We generally have an anti-recorder philosophy for Watir,
and for any issues/user support you might want to resurrect
WatirRecorder lists or set up a new one. I'm assuming you've talked to
Scott about this as well? I don't know what the original license was.
People will have questions about it, and I'd recommend you monitor
this group and gently redirect to the group specific to the recorder.

 There's more historical information in the group about why we choose
not to support recorders, which I'd recommend taking a look at. Also
you may want to blog a bit about your intentions and the inherent
dangers in recorders. Without going into too much detail, most of
which you'll find through a quick search, I'm more inclined to rename
it and consider it a potential scraper, not recorder.

hth,

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



On Thu, Dec 2, 2010 at 9:53 AM, watirboy enrique.j.ma...@gmail.com wrote:
 Hey Guys,

 I dont know how else to tell people about this, and I hate promoting
 it, but I have recently resurrected the WatirRecorder that Hanselman
 did back in the day. It is updated to use more modern WATIR standards
 and calls a config.xml file for template changes.

 http://code.google.com/p/watirrecordersharp/

 I would love the community to play, test, break, and contribute if
 possible. This is a first release, and I am planning on changing the
 UI from utilizing SandBar and SandDock to WPF.

 Again, any help will be tremendous. It's a great tool and I would hate
 to see it die...

 --watirboy

 --
 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: I can find an element with irb, but when I run the test it cannot be found, and also not by SciTE tool.

2010-12-02 Thread Darryl Brown
Hi,

What happens if you:
ie.cell(:class,c2p-action-down-arrow-horizontal).flash

 -or-

if
  ie.cell(:class,c2p-action-down-arrow-horizontal).exists?
  puts yes
else
  puts no
end

Regards,
Darryl

On Dec 2, 2:29 pm, Shlomit Gazit shlomitpatr...@gmail.com wrote:
 The watir code I have is:
 ie.cell(:class,c2p-action-down-arrow-horizontal).click

 When I do inspect element I see: td class=c2p-action-down-arrow-
 horizontal
 /td
 When I do view source I cannot find 'c2p-action-down-arrow-
 horizontal'.

 Any idea why?

-- 
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: Issues to sync with page correctly in watir1.6.7

2010-12-02 Thread Darryl Brown
Hi,

Are your pages using AJAX ? Watir does not wait for AJAX objects. In
our scripts, we wait until the last AJAX object to exist before
continuing.

Regards,
Darryl

On Nov 25, 10:54 am, alex.ikhelis alex.ikhe...@gmail.com wrote:
 Raised it as a tickethttp://jira.openqa.org/browse/WTR-466

-- 
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] Error while running script

2010-12-02 Thread Sudeep
Hi,

I got the following error after the line which is inin the
script below.


C:\Documents and Settings\sudeepp\Desktop\Ruby Programsruby
GPS_GoalEntry.rb.txt
Test Started
C:/Ruby186/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/
input_elements.rb:374:in
 `method_missing': select (WIN32OLERuntimeError)
OLE error code:800A025E in Unknown
  No Description
HRESULT error code:0x800a025e

from C:/Ruby186/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/
input_eleme
nts.rb:374:in `set'
from GPS_GoalEntry.rb.txt:23



while the following script was run :

require rubygems
require watir

url=http://ourgoalplan.com;
browser=Watir::IE.start(url)
putsTest Started

browser.text_field(:name,txtName).set(sudeepp)
browser.text_field(:name,txtPassword).set(m...@jan1)
browser.button(:name,btnLogin).click

browser.text_field(:name,ucAddGoal$txtAddGoal).set(AA.)
browser.button(:name,ucAddGoal$btnAddGoal).click
sleep 1 until browser.button(:name,ucAddGoal$btnAddGoal).enabled?

browser.text_field(:name,ucAddGoal$txtAddGoal).set(BB)
browser.button(:name,ucAddGoal$btnAddGoal).click
 sleep 1 until browser.button(:name,ucAddGoal$btnAddGoal).enabled?


browser.text_field(:name,ucAddGoal$txtAddGoal).set(CC)
browser.button(:name,ucAddGoal$btnAddGoal).click
sleep 1 until browser.button(:name,ucAddGoal$btnAddGoal).enabled?


browser.text_field(:name,ucAddGoal$txtAddGoal).set(DD)
browser.button(:name,ucAddGoal$btnAddGoal).click

putsGoals added



Please can you let me know the reason???


Thanks  Regards,
Sudeep

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

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