On Tuesday, February 17, 2015 at 5:51:17 PM UTC-8, Nice Faith wrote: > > I have this line of codes: > > if @browser.text_field(:id => "street").exists? > puts "street exist" > puts @browser.text_field(:id => "street").html > else > puts "street does not exist" > end > > and the result is: > > Run options: > > # Running tests: > > > > > > > street exist > E > > Finished tests in 83.598781s, 0.0120 tests/s, 0.0000 assertions/s. > > 1) Error: > test_login(TC_Login): > Selenium::WebDriver::Error::JavascriptError: invalid 'in' operand a > [remote server] http://sample.org/user/ line 68 > Function:18:in `G' > [remote server] http://sample.org/user/ line 68 > Function:18:in > `anonymous/</<' > [remote server] http://sample.org/user/ line 68 > Function:15:in > `anonymous/<' > [remote server] http://sample.org/user/ line 68 > Function:15:in > `anonymous' > [remote server] http://sample.org/user/:68:in `handleEvaluateEvent' > > c:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/response.rb:52:in > > `assert_ok' > > c:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/response.rb:15:in > > `initialize' > > c:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/http/common.rb:59:in > > `new' > > c:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/http/common.rb:59:in > > `create_response' > > c:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/http/default.rb:66:in > > `request' > > c:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/http/common.rb:40:in > > `call' > > c:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/bridge.rb:640:in > > `raw_execute' > > c:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/bridge.rb:618:in > > `execute' > > c:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/bridge.rb:339:in > > `executeScript' > > c:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/common/driver.rb:193:in > > `execute_script' > > c:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.11/lib/watir-webdriver/atoms.rb:20:in > > `execute_atom' > > c:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.11/lib/watir-webdriver/elements/element.rb:290:in > > `outer_html' > excel.rb:277:in `test_login' > > 1 tests, 0 assertions, 0 failures, 1 errors, 0 skips > > It diplays "street exist"...so the problem there is on displaying the html. > >> >> 1) are you sure there is any actual HTML code (tags etc) contained by the text field object? Do you maybe just want to use .text instead of .html?
2) your error is on line 277 of excel.rb ,., what is on that line? -- -- 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/d/optout.
