[wtr-general] Re: It doesn't work when clicking a button in Updatepanel

2011-06-27 Thread Green Yin
Yes, I can sure that. The page will go to the next page if clicking
the Add button by manually.

On Jun 22, 3:13 pm, Ankur Gera ankurg...@gmail.com wrote:
 Hi Green,

  Are your sure that after clicking btnAdd button manually you go to the
 next page?

 Thanks  Regards,
 Ankur Gera







 On Mon, Jun 20, 2011 at 6:08 AM, Green Yin green...@gmail.com wrote:
  My web application uses the updatepanel control. See my watir scripts:
  {

  ie = Watir::IE.start(url)
  ie.text_field(:id, txtLogin).set(XXX)
  ie.text_field(:id, txtPassword).set(xxx)
  # Without using updatepanel
  ie.button(:id, btnLogin).click

  # Using updatepanel
  ie.button(:id, btnAdd).click
  }

  It's no problem when clicking Login button, the page will go to the
  next page. After clicking btnAdd button, the page just refresh
  without going to next page. I was tried to use id, name and value of
  the button to click it, but it's the same result.

  Does anyone met the problem? Thanks!

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

-- 
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: It doesn't work when clicking a button in Updatepanel

2011-06-27 Thread Green Yin
Hi Ashok,

I've tried with the regular expressions, the page just still refresh
without going to next page. I can see that the button has been clicked
by automatically, that is, the button has been located. Before we
didn't use the UpdatePannel control, we never met the problem.

On Jun 22, 9:17 pm, Ashok Tulachan tulachanas...@gmail.com wrote:
 Hi Green,

 It might not have clicked because you might have some other button with the
 same id. Seems like your id name sounds like a class name as most of the id
 name have some no on it so we gonna have to use some regular expressions.

 Try with the id and the regular expressions and let me know.

 browser.button(:id, /id-name/).click

 Hope that helps.

 Ashok









 On Wed, Jun 22, 2011 at 2:13 AM, Ankur Gera ankurg...@gmail.com wrote:
  Hi Green,

   Are your sure that after clicking btnAdd button manually you go to the
  next page?

  Thanks  Regards,
  Ankur Gera

  On Mon, Jun 20, 2011 at 6:08 AM, Green Yin green...@gmail.com wrote:

  My web application uses the updatepanel control. See my watir scripts:
  {

  ie = Watir::IE.start(url)
  ie.text_field(:id, txtLogin).set(XXX)
  ie.text_field(:id, txtPassword).set(xxx)
  # Without using updatepanel
  ie.button(:id, btnLogin).click

  # Using updatepanel
  ie.button(:id, btnAdd).click
  }

  It's no problem when clicking Login button, the page will go to the
  next page. After clicking btnAdd button, the page just refresh
  without going to next page. I was tried to use id, name and value of
  the button to click it, but it's the same result.

  Does anyone met the problem? Thanks!

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

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

 --
 Regards,

 Ashok Tulachan

-- 
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: It doesn't work when clicking a button in Updatepanel

2011-06-27 Thread Green Yin
Hi Chuck,

Sorry, I never use the IRB, but I could sure that it wasn't a time
issue. I thought it was related to the updatepannel control, before we
never met the problem before applying the control.

On Jun 23, 9:07 am, Chuck van der Linden sqa...@gmail.com wrote:
 On Jun 20, 3:08 am, Green Yin green...@gmail.com wrote:









  My web application uses theupdatepanelcontrol. See mywatirscripts:
  {

  ie =Watir::IE.start(url)
  ie.text_field(:id, txtLogin).set(XXX)
  ie.text_field(:id, txtPassword).set(xxx)
  # Without usingupdatepanel
  ie.button(:id, btnLogin).click

  # Usingupdatepanel
  ie.button(:id, btnAdd).click

  }

  It's no problem when clicking Login button, the page will go to the
  next page. After clicking btnAdd button, the page just refresh
  without going to next page. I was tried to use id, name and value of
  the button to click it, but it's the same result.

  Does anyone met the problem? Thanks!

 It might be there is client side javascript that needs to run in order
 to setup what that button is doing.  Watirtries to execute the very
 next command as soon as the page has finished loading (downloaded the
 last page element from the webserver) which can be 'too soon' if there
 is client side javascript that is executing onpageload

 A good test for that is to execute your script via IRB, pasting in a
 line at a time.  If that works, then it's likely a timing issue, and
 you may just need to havewatirwait a littlle bit (such as with a
 sleep statement) before script tries to click that second 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


[wtr-general] Re: It doesn't work when clicking a button in Updatepanel

2011-06-27 Thread Chuck van der Linden
You should learn to use IRB, it is a very useful means of developing
and debugging ruby code.

http://lmgtfy.com/?q=how+to+use+ruby+irb

You are probably correct that the 'problem' is the updatepanel
control.  The solution maybe as simple as allowing it a second or two
for client side code to run after the page has loaded (see:
http://wiki.openqa.org/display/WTR/How+to+wait+with+Watir)  or it may
be that you need to discover how the control works and fire specfic
events against specific objects in order to make it work.

Without seeing the HTML, and perhaps details of how that control is
implemented, about all any of us can do is guess.

On Jun 27, 12:26 am, Green Yin green...@gmail.com wrote:
 Hi Chuck,

 Sorry, I never use the IRB, but I could sure that it wasn't a time
 issue. I thought it was related to the updatepannel control, before we
 never met the problem before applying the control.

 On Jun 23, 9:07 am, Chuck van der Linden sqa...@gmail.com wrote:







  On Jun 20, 3:08 am, Green Yin green...@gmail.com wrote:

   My web application uses theupdatepanelcontrol. See mywatirscripts:
   {

   ie =Watir::IE.start(url)
   ie.text_field(:id, txtLogin).set(XXX)
   ie.text_field(:id, txtPassword).set(xxx)
   # Without usingupdatepanel
   ie.button(:id, btnLogin).click

   # Usingupdatepanel
   ie.button(:id, btnAdd).click

   }

   It's no problem when clicking Login button, the page will go to the
   next page. After clicking btnAdd button, the page just refresh
   without going to next page. I was tried to use id, name and value of
   the button to click it, but it's the same result.

   Does anyone met the problem? Thanks!

  It might be there is client side javascript that needs to run in order
  to setup what that button is doing.  Watirtries to execute the very
  next command as soon as the page has finished loading (downloaded the
  last page element from the webserver) which can be 'too soon' if there
  is client side javascript that is executing onpageload

  A good test for that is to execute your script via IRB, pasting in a
  line at a time.  If that works, then it's likely a timing issue, and
  you may just need to havewatirwait a littlle bit (such as with a
  sleep statement) before script tries to click that second 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


[wtr-general] Re: It doesn't work when clicking a button in Updatepanel

2011-06-22 Thread Chuck van der Linden
On Jun 20, 3:08 am, Green Yin green...@gmail.com wrote:
 My web application uses the updatepanel control. See my watir scripts:
 {

 ie = Watir::IE.start(url)
 ie.text_field(:id, txtLogin).set(XXX)
 ie.text_field(:id, txtPassword).set(xxx)
 # Without using updatepanel
 ie.button(:id, btnLogin).click

 # Using updatepanel
 ie.button(:id, btnAdd).click

 }

 It's no problem when clicking Login button, the page will go to the
 next page. After clicking btnAdd button, the page just refresh
 without going to next page. I was tried to use id, name and value of
 the button to click it, but it's the same result.

 Does anyone met the problem? Thanks!

It might be there is client side javascript that needs to run in order
to setup what that button is doing.  Watir tries to execute the very
next command as soon as the page has finished loading (downloaded the
last page element from the webserver) which can be 'too soon' if there
is client side javascript that is executing onpageload

A good test for that is to execute your script via IRB, pasting in a
line at a time.  If that works, then it's likely a timing issue, and
you may just need to have watir wait a littlle bit (such as with a
sleep statement) before script tries to click that second 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