In case that anyone will encounter the problem using send_keys:enter

it is a known bug; in my case it is mandatory to use it into my application,
because i have no button

that sollution works perfect and is avoiding using the enter key

   $browser.text_field(:id => "sample").set("somestring\n")


Using "\n" is working just great!

Cristina

On Wed, Oct 5, 2011 at 3:40 PM, Cristina Dumitrescu <
[email protected]> wrote:

> With chrome I run in another problems when I try to read the selected value
> for a drop down list:
>
> for instance
> $browser.select(:xpath, "//select[@id='_language']").value
>
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/remote/response.rb:45:in
> `assert_ok': Selenium::WebDriver::Error::UnhandledError
>         from
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/remote/response.rb:15:in
> `initialize'
>         from
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/remote/http/common.rb:54:in
> `new'
>         from
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/remote/http/common.rb:54:in
> `create_response'
>         from
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/remote/http/default.rb:64:in
> `request'
>         from
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/remote/http/common.rb:35:in
> `call'
>         from
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/remote/bridge.rb:410:in
> `raw_execute'
>         from
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/remote/bridge.rb:388:in
> `execute'
>         from
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/remote/bridge.rb:364:in
> `find_elements_by'
>         from
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/common/search_context.rb:61:in
> `find_elements'
>         from
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.3.4/lib/watir-webdriver/locators/element_locator.rb:123:in
> `wd_find_all_by'
>         from
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.3.4/lib/watir-webdriver/locators/element_locator.rb:69:in
> `find_all_by_one'
>         from
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.3.4/lib/watir-webdriver/locators/element_locator.rb:45:in
> `locate_all'
>         from
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.3.4/lib/watir-webdriver/element_collection.rb:82:in
> `elements'
>         from
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.3.4/lib/watir-webdriver/element_collection.rb:76:in
> `to_a'
>         from
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.3.4/lib/watir-webdriver/element_collection.rb:21:in
> `each'
>         from
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.3.4/lib/watir-webdriver/elements/select.rb:108:in
> `find'
>         from
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.3.4/lib/watir-webdriver/elements/select.rb:108:in
> `value'
>         from C:/watir/mac2/newDomainDefault.rb:696:in `checkDomainDefaults'
>         from rundomaindefaults.rb:25:in `<main>'
>
> Also chroms is closing when a script stop running.
>
>
> But what looks strange to me that the enter is working for another elements
> into my application.For jump box it is not working
>
> For instance save the following code to testdom.rb and just run it
> require 'rubygems'
> require 'watir-webdriver'
>
>
> #---------------------------------------------------------
> #firefox
> #----------------------------------------------------------
> prof = Selenium::WebDriver::Firefox::Profile.new
> #prof.add_extension("C:/watir/firebug/firebug-1.8.3.xpi")
>
> $browser = Watir::Browser.new(:firefox, :profile => prof)
> #----------------------------------------------------------
>
> $browser.goto("http://admin.qa.hostedemail.com";)
> $browser.text_field(:id, "_auth_username").flash
> $browser.text_field(:id, "_auth_username").click
> $browser.text_field(:id, "_auth_username").set("[email protected]")
>
> sleep 3
> $browser.text_field(:id, "_auth_password").flash
> $browser.text_field(:id, "_auth_password").click
> $browser.text_field(:id, "_auth_password").set("a")
> sleep 6
>
> $browser.button(:class => "macXfunc").flash
> $browser.button(:class => "macXfunc").click
> sleep 4
> $browser.div(:xpath => "//div[@class='machidden sub macXstring macXfunc'
> and @string='create_domain']").flash
> $browser.div(:xpath => "//div[@class='machidden sub macXstring macXfunc'
> and @string='create_domain']").click
>
>     domainname = "dom" + "#{Time.now.to_i}" + ".com"
>     $browser.text_field(:class => "macXfunc", :id => "__domain").flash
>     $browser.text_field(:class => "macXfunc", :id => "__domain").click
>     $browser.text_field(:class => "macXfunc", :id =>
> "__domain").set(domainname)
>     $browser.send_keys:enter
>     sleep 2
>
>
>
>
> You will see that enter is working for create_domain.
>
> Why for that element it is working and for jump is not working.
>
>
> I have no idea what to do?
>
> Do I have to return to firefox 3.6?
>
> I have attached the screen snapshot also.
>
> Isn't that strange?
>
> Thanks,
> Cristina
>
>
> On Wed, Oct 5, 2011 at 3:01 PM, Rahul Sharma <[email protected]>wrote:
>
>> OK. I just found a thread relating to this issue. Don't know if it's been
>> resolved. Seems like an issue with firefox. Did you try on any other
>> browser?
>>
>> Here is the thread
>>
>> http://code.google.com/p/selenium/issues/detail?id=157
>> On 5 Oct 2011, at 19:29, Cristina Dumitrescu wrote:
>>
>> I have attached  the screen snapshot.
>> Is the Jump textfiled-
>>
>>
>> Thanks a lot,
>> Cristina
>>
>> On Wed, Oct 5, 2011 at 2:21 PM, Rahul Sharma 
>> <[email protected]>wrote:
>>
>>> OK. I can't see this text field :
>>>
>>> $browser.text_field(:class => "macXfunc", :id => "macjumpbox")
>>>
>>>
>>> Where is it on the page??
>>> On 5 Oct 2011, at 19:09, Cristina Dumitrescu wrote:
>>>
>>>  Because of that I cannot do any progress. The way to edit something is
>>> just to use that jump box.
>>>
>>> Thanks a lot in advance,
>>> Cristina
>>>
>>> On Wed, Oct 5, 2011 at 12:06 PM, Cristina Dumitrescu <
>>> [email protected]> wrote:
>>>
>>>> Hi,
>>>>
>>>>
>>>> I do not know why   is not working on that particular element.
>>>>
>>>> just save the following code into a ruby file and run it.
>>>>
>>>>
>>>> #---------------------------------------------------------
>>>> #firefox
>>>> #----------------------------------------------------------
>>>> prof = Selenium::WebDriver::Firefox::Profile.new
>>>> prof.add_extension("C:/watir/firebug/firebug-1.7.2.xpi")
>>>> $browser = Watir::Browser.new(:firefox, :profile => prof)
>>>> #----------------------------------------------------------
>>>>
>>>> $browser.goto("http://admin.qa.hostedemail.com";)
>>>> $browser.text_field(:id, "_auth_username").flash
>>>> $browser.text_field(:id, "_auth_username").click
>>>> $browser.text_field(:id, "_auth_username").set("[email protected]")
>>>> sleep 3
>>>> $browser.text_field(:id, "_auth_password").flash
>>>> $browser.text_field(:id, "_auth_password").click
>>>> $browser.text_field(:id, "_auth_password").set("a")
>>>> sleep 6
>>>>
>>>> $browser.button(:class => "macXfunc").flash
>>>> $browser.button(:class => "macXfunc").click
>>>> sleep 4
>>>> $browser.text_field(:class => "macXfunc", :id => "macjumpbox").flash
>>>> $browser.text_field(:class => "macXfunc", :id => "macjumpbox").click
>>>> $browser.text_field(:class => "macXfunc", :id => "macjumpbox").set("
>>>> [email protected]")
>>>> puts "....................1"
>>>> $browser.text_field(:id => "macjumpbox").flash
>>>> sleep 2
>>>> #$browser.text_field(:id => "macjumpbox").send_keys:enter
>>>> $browser.text_field(:class => "macXfunc", :id =>
>>>> "macjumpbox").send_keys:enter
>>>> puts "....................2"
>>>> sleep 2
>>>>
>>>>
>>>>
>>>> Can one try to run it an tell me what can be wrong.
>>>>
>>>> I am not receiving any error, just the entr is not working.
>>>>
>>>> Thanks a lot,
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Cristina
>>>>
>>>>
>>>
>>>
>>> --
>>> Cristina
>>>
>>>
>>> --
>>> 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]
>>>
>>>
>>>  Regards,
>>> Rahul Sharma
>>>
>>>
>>> --
>>> 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]
>>>
>>
>>
>>
>> --
>> Cristina
>>
>>
>> --
>> 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]
>> <jump.png>
>>
>>
>> Regards,
>> Rahul Sharma
>>
>>  --
>> 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]
>>
>
>
>
> --
> Cristina
>
>


-- 
Cristina

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

Reply via email to