Hi Oscar, Sorry for late reply, yes that was mistype here. looks like its Getting the correct Username and password, but no result.
here is the log -> POST session/30cb296d-47a2-413c-875d-4a9965890770/frame >>> http://127.0.0.1:7065/hub/session/30cb296d-47a2-413c-875d-4a9965890770/frame | {"id":null} > {"Accept"=>"application/json", "Content-Type"=>"application/json; charset=utf-8", "Content-Length"=>"11"} <- {"name":"switchToFrame","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":""} -> POST session/30cb296d-47a2-413c-875d-4a9965890770/element >>> http://127.0.0.1:7065/hub/session/30cb296d-47a2-413c-875d-4a9965890770/element | {"using":"id","value":"txtUserNameM"} > {"Accept"=>"application/json", "Content-Type"=>"application/json; charset=utf-8", "Content-Length"=>"37"} <- {"name":"findElement","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":{"ELEMENT":"{6cf77772-0b86-45c9-871d-7b569989bbe0}"}} -> GET session/30cb296d-47a2-413c-875d-4a9965890770/element/%7B6cf77772-0b86-45c9-871d-7b569989bbe0%7D/name <- {"name":"getElementTagName","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":"input"} -> GET session/30cb296d-47a2-413c-875d-4a9965890770/element/%7B6cf77772-0b86-45c9-871d-7b569989bbe0%7D/attribute/type <- {"name":"getElementAttribute","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":"text"} -> GET session/30cb296d-47a2-413c-875d-4a9965890770/element/%7B6cf77772-0b86-45c9-871d-7b569989bbe0%7D/enabled <- {"name":"isElementEnabled","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":true} -> POST session/30cb296d-47a2-413c-875d-4a9965890770/frame >>> http://127.0.0.1:7065/hub/session/30cb296d-47a2-413c-875d-4a9965890770/frame | {"id":null} > {"Accept"=>"application/json", "Content-Type"=>"application/json; charset=utf-8", "Content-Length"=>"11"} <- {"name":"switchToFrame","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":""} -> POST session/30cb296d-47a2-413c-875d-4a9965890770/element >>> http://127.0.0.1:7065/hub/session/30cb296d-47a2-413c-875d-4a9965890770/element | {"using":"id","value":"txtUserNameM"} > {"Accept"=>"application/json", "Content-Type"=>"application/json; charset=utf-8", "Content-Length"=>"37"} <- {"name":"findElement","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":{"ELEMENT":"{6cf77772-0b86-45c9-871d-7b569989bbe0}"}} -> GET session/30cb296d-47a2-413c-875d-4a9965890770/element/%7B6cf77772-0b86-45c9-871d-7b569989bbe0%7D/name <- {"name":"getElementTagName","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":"input"} -> GET session/30cb296d-47a2-413c-875d-4a9965890770/element/%7B6cf77772-0b86-45c9-871d-7b569989bbe0%7D/attribute/type <- {"name":"getElementAttribute","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":"text"} -> GET session/30cb296d-47a2-413c-875d-4a9965890770/element/%7B6cf77772-0b86-45c9-871d-7b569989bbe0%7D/attribute/readonly <- {"name":"getElementAttribute","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":null} -> POST session/30cb296d-47a2-413c-875d-4a9965890770/element/%7B6cf77772-0b86-45c9-871d-7b569989bbe0%7D/clear <- {"name":"clearElement","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":""} -> POST session/30cb296d-47a2-413c-875d-4a9965890770/element/%7B6cf77772-0b86-45c9-871d-7b569989bbe0%7D/value >>> http://127.0.0.1:7065/hub/session/30cb296d-47a2-413c-875d-4a9965890770/element/%7B6cf77772-0b86-45c9-871d-7b569989bbe0%7D/value | {"value":["usernane"]} > {"Accept"=>"application/json", "Content-Type"=>"application/json; charset=utf-8", "Content-Length"=>"18"} <- {"name":"sendKeysToElement","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":""} -> POST session/30cb296d-47a2-413c-875d-4a9965890770/frame >>> http://127.0.0.1:7065/hub/session/30cb296d-47a2-413c-875d-4a9965890770/frame | {"id":null} > {"Accept"=>"application/json", "Content-Type"=>"application/json; charset=utf-8", "Content-Length"=>"11"} <- {"name":"switchToFrame","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":""} -> POST session/30cb296d-47a2-413c-875d-4a9965890770/element >>> http://127.0.0.1:7065/hub/session/30cb296d-47a2-413c-875d-4a9965890770/element | {"using":"id","value":"txtPasswordM"} > {"Accept"=>"application/json", "Content-Type"=>"application/json; charset=utf-8", "Content-Length"=>"37"} <- {"name":"findElement","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":{"ELEMENT":"{80b91eec-a51b-4634-95fb-09b307f0bd3f}"}} -> GET session/30cb296d-47a2-413c-875d-4a9965890770/element/%7B80b91eec-a51b-4634-95fb-09b307f0bd3f%7D/name <- {"name":"getElementTagName","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":"input"} -> GET session/30cb296d-47a2-413c-875d-4a9965890770/element/%7B80b91eec-a51b-4634-95fb-09b307f0bd3f%7D/attribute/type <- {"name":"getElementAttribute","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":"password"} -> GET session/30cb296d-47a2-413c-875d-4a9965890770/element/%7B80b91eec-a51b-4634-95fb-09b307f0bd3f%7D/enabled <- {"name":"isElementEnabled","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":true} -> POST session/30cb296d-47a2-413c-875d-4a9965890770/frame >>> http://127.0.0.1:7065/hub/session/30cb296d-47a2-413c-875d-4a9965890770/frame | {"id":null} > {"Accept"=>"application/json", "Content-Type"=>"application/json; charset=utf-8", "Content-Length"=>"11"} <- {"name":"switchToFrame","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":""} -> POST session/30cb296d-47a2-413c-875d-4a9965890770/element >>> http://127.0.0.1:7065/hub/session/30cb296d-47a2-413c-875d-4a9965890770/element | {"using":"id","value":"txtPasswordM"} > {"Accept"=>"application/json", "Content-Type"=>"application/json; charset=utf-8", "Content-Length"=>"37"} <- {"name":"findElement","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":{"ELEMENT":"{80b91eec-a51b-4634-95fb-09b307f0bd3f}"}} -> GET session/30cb296d-47a2-413c-875d-4a9965890770/element/%7B80b91eec-a51b-4634-95fb-09b307f0bd3f%7D/name <- {"name":"getElementTagName","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":"input"} -> GET session/30cb296d-47a2-413c-875d-4a9965890770/element/%7B80b91eec-a51b-4634-95fb-09b307f0bd3f%7D/attribute/type <- {"name":"getElementAttribute","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":"password"} -> GET session/30cb296d-47a2-413c-875d-4a9965890770/element/%7B80b91eec-a51b-4634-95fb-09b307f0bd3f%7D/attribute/readonly <- {"name":"getElementAttribute","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":null} -> POST session/30cb296d-47a2-413c-875d-4a9965890770/element/%7B80b91eec-a51b-4634-95fb-09b307f0bd3f%7D/clear <- {"name":"clearElement","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":""} /usr/local/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.39.0/lib/selenium/webdriver/remote/bridge.rb:407: warning: instance variable @file_detector not initialized Exception `Errno::EAGAIN' at /usr/local/lib/ruby/1.9.1/net/protocol.rb:141 - Resource temporarily unavailable - read would block Exception `Errno::EAGAIN' at /usr/local/lib/ruby/1.9.1/net/protocol.rb:141 - Resource temporarily unavailable - read would block Exception `Errno::EAGAIN' at /usr/local/lib/ruby/1.9.1/net/protocol.rb:141 - Resource temporarily unavailable - read would block Exception `Errno::EAGAIN' at /usr/local/lib/ruby/1.9.1/net/protocol.rb:141 - Resource temporarily unavailable - read would block -> POST session/30cb296d-47a2-413c-875d-4a9965890770/element/%7B80b91eec-a51b-4634-95fb-09b307f0bd3f%7D/value >>> http://127.0.0.1:7065/hub/session/30cb296d-47a2-413c-875d-4a9965890770/element/%7B80b91eec-a51b-4634-95fb-09b307f0bd3f%7D/value | {"value":["111"]} > {"Accept"=>"application/json", "Content-Type"=>"application/json; charset=utf-8", "Content-Length"=>"17"} <- {"name":"sendKeysToElement","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":""} -> POST session/30cb296d-47a2-413c-875d-4a9965890770/frame >>> http://127.0.0.1:7065/hub/session/30cb296d-47a2-413c-875d-4a9965890770/frame | {"id":null} > {"Accept"=>"application/json", "Content-Type"=>"application/json; charset=utf-8", "Content-Length"=>"11"} <- {"name":"switchToFrame","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":""} {:build_wd_selector=>".//button[@name='btnLogin_input'] | .//input[@name='btnLogin_input' and (translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')='button' or translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')='reset' or translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')='submit' or translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')='image')]"} Exception `Errno::EAGAIN' at /usr/local/lib/ruby/1.9.1/net/protocol.rb:141 - Resource temporarily unavailable - read would block Exception `Errno::EAGAIN' at /usr/local/lib/ruby/1.9.1/net/protocol.rb:141 - Resource temporarily unavailable - read would block Exception `Errno::EAGAIN' at /usr/local/lib/ruby/1.9.1/net/protocol.rb:141 - Resource temporarily unavailable - read would block Exception `Errno::EAGAIN' at /usr/local/lib/ruby/1.9.1/net/protocol.rb:141 - Resource temporarily unavailable - read would block Exception `Errno::EAGAIN' at /usr/local/lib/ruby/1.9.1/net/protocol.rb:141 - Resource temporarily unavailable - read would block -> POST session/30cb296d-47a2-413c-875d-4a9965890770/element >>> http://127.0.0.1:7065/hub/session/30cb296d-47a2-413c-875d-4a9965890770/element | {"using":"xpath","value":".//button[@name='btnLogin_input'] | .//input[@name='btnLogin_input' and (translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')='button' or translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')='reset' or translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')='submit' or translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')='image')]"} > {"Accept"=>"application/json", "Content-Type"=>"application/json; charset=utf-8", "Content-Length"=>"445"} <- {"name":"findElement","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":{"ELEMENT":"{a0639c3c-6fde-48ea-9fb7-9b8ceac62ccf}"}} -> GET session/30cb296d-47a2-413c-875d-4a9965890770/element/%7Ba0639c3c-6fde-48ea-9fb7-9b8ceac62ccf%7D/name <- {"name":"getElementTagName","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":"input"} -> GET session/30cb296d-47a2-413c-875d-4a9965890770/element/%7Ba0639c3c-6fde-48ea-9fb7-9b8ceac62ccf%7D/attribute/type <- {"name":"getElementAttribute","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":"button"} -> GET session/30cb296d-47a2-413c-875d-4a9965890770/element/%7Ba0639c3c-6fde-48ea-9fb7-9b8ceac62ccf%7D/name <- {"name":"getElementTagName","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":"input"} -> GET session/30cb296d-47a2-413c-875d-4a9965890770/element/%7Ba0639c3c-6fde-48ea-9fb7-9b8ceac62ccf%7D/enabled <- {"name":"isElementEnabled","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":true} -> POST session/30cb296d-47a2-413c-875d-4a9965890770/element/%7Ba0639c3c-6fde-48ea-9fb7-9b8ceac62ccf%7D/click <- {"name":"clickElement","sessionId":"30cb296d-47a2-413c-875d-4a9965890770","status":0,"value":"ok"} it used to show me "Invalid username or password" but now it does not do anything!! On Wednesday, January 15, 2014 4:16:44 PM UTC, Oscar.Rieken wrote: > > in your code you are using :id => "txtUserNameM" for both the username > and password... > im going to guess thats just a copy paste problem. > > what is the error you get when you run your code? > > > > On Tue, Jan 14, 2014 at 3:51 PM, Fosiul Alam <[email protected]<javascript:> > > wrote: > >> Hi Experts. >> I am tying to use watir to setup a monitoring for a webpage. >> I am trying to login to the home page by using user name and password. >> >> I am using Firefox as browser, but i cant login, >> >> 1)How do i debug the issue to understand where its failing? >> >> 2) from my understanding, if firefox can login to that site, Watir should >> be able to login right ?? >> >> >> the watir is clicking the button but the site say "invalid login" >> i am using bellow code :- >> >> b = Watir::Browser.new :firefox, :profile => 'default' >> b.goto 'http://xxxxxxxx' >> b.text_field(:id => "txtUserNameM").fire_event('onfocus') >> b.text_field(:id => "txtUserNameM").set 'username' >> b.text_field(:id => "txtUserNameM").fire_event('onfocus') >> b.text_field(:id => "txtUserNameM").set("password") >> b.button(:name => 'btnLogin_input').click >> >> >> the Code behind the login (just an example as the site use too much java >> script validation:- >> >> >> <form name="form1" method="post" action="xxxxx" >> onsubmit="javascript:return WebForm_OnSubmit();" >> onkeypress="javascript:return WebForm_FireDefaultButton(event, 'btnLogin')" >> id="form1"> >> >> >> <td><span id="lblUserNameM" class="Reg">User Name</span></td> >> <td><input name="txtUserNameM" type="text" id="txtUserNameM" >> class="xxxxx" autocomplete="off" >> style="border-color:#A09E9F;border-width:1px;border-style:Solid;width:200px;" >> >> /><span id="txtUserNameMValidator" class="txtFormErr" >> MyPrevControlUniqueID="txtUserNameM" style="color:Red;display:none;"> >> xxxxxxxr</span></td> >> </tr> >> <tr> >> <td><span id="lblPasswordM" class="Reg">Password</span></td> >> <td><input name="txtPasswordM" type="password" >> id="txtPasswordM" class="txtForm" autocomplete="off" >> style="border-color:#A09E9F;border-width:1px;border-style:Solid;width:200px;" >> >> /><span id="txtPasswordMValidator" class="txtFormErr" >> MyPrevControlUniqueID="txtPasswordM" >> style="color:Red;display:none;">xxxxxxxr</span></td> >> </tr> >> >> >> Can any one please help, I am trying to solve this from last couple of >> days. >> >> >> >> -- >> -- >> Before posting, please read http://watir.com/support. In short: search >> before you ask, be nice. >> >> [email protected] <javascript:> >> http://groups.google.com/group/watir-general >> [email protected] <javascript:> >> >> --- >> You received this message because you are subscribed to the Google Groups >> "Watir General" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected] --- You received this message because you are subscribed to the Google Groups "Watir General" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
