Jason, Thanks for the tips. Indeed, this is a timing issue. I've tracked down to the place where the last code made a click on the div and added sleep 2 (sleep 1 not long enough, so I used sleep 2). It works totally now.
Thanks again, Winata On Jun 7, 1:26 am, jason <jason.franklin.sto...@gmail.com> wrote: > looks like you might have a timing problem. > Try adding sleep(1) instead of puts to see if this is the case. > > If this is the case you need to look at what you did before and if the > browser really did finish before it got to this line. > > Jason > > On 5 Jun., 23:33, Win <kinib...@gmail.com> wrote: > > > Hi folks, > > I'm using cucumber with watir frame-work for my testing. In my step > > file, I'm trying to move one of my div from one location to another > > location on a browser. > > > Here is my code: > > > When /^I move the card to the top area$/ do > > #puts active_empcard.style.TOP > > browser.div(:class => 'eeCard ui-draggable', :id => '0').style.TOP > > = "75px" > > end > > > I find a very strange behavior in this code. The div will not move to > > the new location unless I added "puts" statement (that I commented out > > in the above) prior to the setting. However, I am able to move the div > > by setting the value only (w/o adding "puts" statement prior to the > > setting) in the console. This is what I did: > > > c:\MSS_Test\MSS>console > > Type 'irb START' at the prompt.>> irb START > > >> login_page.goto > > => 0.838 > > >> browser.div(:class => 'eeCard ui-draggable', :id => '0').style.TOP = > > >> "100px" > > > => "100px" > > > Can someone help me explain this? > > > I would like to do this without showing the old location of the div > > (by having "puts" statement prior to the setting). > > > Thanks, > > Winata > > > I would like to have no output on the screen for the old values of the > > TOP location. Can someone explain why and help me. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---