Watir webdriver, using Firefox clicking on a link giving error - UnknownError: l is undefined, whereas in chrome its working fine - watir-webdriver

I have a web page (https://) in to this page whenever I'm trying to click on any link it is giving me weird error. This is giving me error when I'm using firefox browser to automate.
If I use chrome it is clicking on any link without giving any error.
HTML is like this:
<li id="tab2" class=""><a role="button" aria-pressed="false" id="tab2link" onfocus="onFocusLink("tab2link")" onblur="onBlurLink("tab2link")" href="/workplace/myportal/!ut/p/c5/04_SB8K8xLLM9MSSzPy8xBz9CP0os3hLAyAwNTAwsvAKM‌​jbw9HQJdXYLCTU2CDYAykeaxRvgAI4GIN1OIGYASHeYM1C3ob-_ZaCfr4GBvxFENx55_HaHg1xrFu_nbx‌​TqZuJpaGhh5mpoYGTmYeLkE-Zp4O5iDJHH4zo_j_zcVP2C3NAIgywTRQDl3__u/?uri=nm:oid:6_B0000‌​P002GVC30IMJ4J6J400U3" style="outline: none; ">MyLink</a></li>
The error I'm getting is as follows :
Selenium::WebDriver::Error::UnknownError: l is undefined
from [remote server] file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/webdrive r-profile20120921-5620-dorvjl/extensions/fxdriver#googlecode.com/components/comm and_processor.js:9497:in `unknown'
from [remote server] file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/webdrive r-profile20120921-5620-dorvjl/extensions/fxdriver#googlecode.com/components/comm and_processor.js:10131:in `unknown'
from [remote server] file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/webdrive r-profile20120921-5620-dorvjl/extensions/fxdriver#googlecode.com/components/comm and_processor.js:10136:in `unknown'
from [remote server] file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/webdrive r-profile20120921-5620-dorvjl/extensions/fxdriver#googlecode.com/components/comm and_processor.js:10074:in `unknown'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/s elenium/webdriver/remote/response.rb:52:in `assert_ok'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/s elenium/webdriver/remote/response.rb:15:in `initialize'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/s elenium/webdriver/remote/http/common.rb:59:in `new'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/s elenium/webdriver/remote/http/common.rb:59:in `create_response'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/s elenium/webdriver/remote/http/default.rb:65:in `request'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/s elenium/webdriver/remote/http/common.rb:40:in `call'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/s elenium/webdriver/remote/bridge.rb:598:in `raw_execute'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/s elenium/webdriver/remote/bridge.rb:576:in `execute'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/s elenium/webdriver/remote/bridge.rb:358:in `clickElement'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/s elenium/webdriver/common/element.rb:54:in `click'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.1/lib/watir-webdriver/elements/element.rb:108:in `click'
from (irb):6
from C:/Ruby192/bin/irb:12:in `<main>'irb(main):007:0>
Can anyone help me out for this as this is completely out of my mind.
Watir code I'm using is a simple link clicking code by its text
browser.link(:text, "MyLink").click
Also if I pass any argument in click method like :shift or :control, it is working, it is clicking on the link but not without arguments, It is happening in firefox using watir-webdriver

Since your html shows an anchor element try this instead (I've had similar issues and do this to get around):
browser.a(:text, 'MyLink').click

Related

Generate war file using warbler

I am trying to generate war file using warbler for jruby, but i got stuck and i am getting this error:
warble aborted!
NoMethodError: undefined method `booter=' for nil:NilClass
config/warble.rb:9:in `block in initialize' /Users/xxx/.rvm/gems/jruby-9.0.5.0/gems/warbler-2.0.4/lib/warbler/config.rb:216:in `initialize'
config/warble.rb:4:in `<eval>'
/Users/xxx/.rvm/gems/jruby-9.0.5.0/gems/warbler-2.0.4/lib/warbler/task.rb:46:in `initialize'
/Users/xxx/.rvm/gems/jruby-9.0.5.0/gems/warbler-2.0.4/lib/warbler/application.rb:27:in `load_rakefile'
/Users/xxx/.rvm/gems/jruby-9.0.5.0/gems/warbler-2.0.4/lib/warbler/application.rb:79:in `run'
/Users/xxx/.rvm/gems/jruby-9.0.5.0/gems/warbler-2.0.4/lib/warbler/application.rb:74:in `run'
/Users/xxx/.rvm/gems/jruby-9.0.5.0/gems/warbler-2.0.4/bin/warble:11:in `<top>'
/Users/xxx/.rvm/gems/jruby-9.0.5.0/bin/warble:23:in `<top>'
(See full trace by running task with --trace)
my config file in config/warble.rb:
Warbler::Config.new do |config|
config.dirs = %w(app config views)
config.gems += ["sinatra"]
config.gems -= ["rails"]
config.jar_name = "jsinatra"
config.webxml.booter = :rack
config.webxml.jruby.compat.version = "1.9"
config.webxml.rackup.path = '/WEB-INF/config.ru'
end
any help, advice apricciated. thank you.
over all, i am trying to create docker container and i am using pdf file as a reference but the pdf is somehow vaguely written.
http://www.ibm.com/developerworks/cloud/library/cl-sinatra-softlayer-app/cl-sinatra-softlayer-app-pdf.pdf
Worked for me
In the pdf I posted there is file named rackup.ru with this contents:
require "sinatra"
require File.dirname(__FILE__) + '/app/main'
run MyApp
After hours of googling, I decided to create identical file and name it config.ru. Worked.
Not working
I have also tried to change
config.webxml.rackup.path = '/WEB-INF/config.ru'
to
config.webxml.rackup.path = '/WEB-INF/rackup.ru'
Did not work.

ares-inspect luna-send command failed

I'm trying to debug my webos3 tv but I keep getting the following error:
ares-inspect --device web30 com.starz.lgtv.app_0.0.1_all.ipk
ares-inspect ERR! ares-inspect: Error: luna-send command failed (not exist)
It doesn't say anywhere in the documentation what luna-send is and it's closed source. I'm running on mac using the cli for webos. Is there anything I need to install?
Thanks
By trial and error, I found that you need to omit the version numbers for it to work:
ares-inspect --device web30 com.starz.lgtv.app --open
Don't forget the --open argument to open the inspector. :-)
The documentation doesn't explicitly say that you need to omit it but it is inferred in the demo code:
http://webostv.developer.lge.com/sdk/using-webos-tv-cli/debugging-web-applications-cli/
It's not about omitting version or removing suffixes from filenames. You should use the app id here, same as in your appinfo.json file.
ares-inspect [OPTION...] [--app|-a] APP_ID
APP_ID = ID of the app whose information is to be viewed using Web Inspector.
See http://webostv.developer.lge.com/sdk/tools/using-webos-tv-cli/ for reference.

Can't launch browser with Selenium Remote Driver

I don't know why but I cannot launch browser using the below code. I am using EPIC on eclipse. I have installed required selenium modules for this.
I get this error when I run below mentioned code: "Could not connect to SeleniumWebDriver at C:/ProgramFiles/Perl/site/lib/Selenium/Remote/Driver.pm line 220"
Any help is appreciated.
Here is my code:
use Selenium::Remote::Driver;
my $driver = new Selenium::Remote::Driver(browser_name => 'firefox', port => 5555,
platform => 'WINDOWS');
$driver->get('http://www.google.com');
print $driver->get_title();
$driver->quit();
It might be closing the page before you notice it? Also, I think by default the port number selenium listens on is 4444.
Try this:
use Selenium::Remote::Driver;
my $driver = new Selenium::Remote::Driver(browser_name => 'firefox', port => 4444,
platform => 'ANY',);
$driver->get('http://www.google.com');
sleep(200);
print $driver->get_title(),"\n";
$driver->quit();
I changed the Selenium version to 2.31 and it worked. Previously I was using 2.28 which had incompatibility with FF 19
Charles, my PC was updated with new Java version and so my server start up file was failing to start the server. I corrected the start up file with correct java path and it launches the browser.
But I don't know why it gives blank page as it should open google.com
before run the code you should start the remote server.
Enter the path as below where your chrome driver and jar file are exited in your system and
Go to the command prompt an run the following command- please
java -Dwebdriver.chrome.driver="\Enter folder path\chromedriver.exe" -jar \Enter folder path\selenium-server-standalone-2.53.0.jar
and if you are using Firefox then write the following code.
my $driver = Selenium::Remote::Driver->new();
for chrome user following -
my $driver = Selenium::Remote::Driver->new(browser_name => 'chrome');

Emacs Elnode can't show html pages

I have installed Emacs elnode by Marmalade, and everything looks OK. And I have read the manual carefully.
Now elnode has started, and I can view the folder public_html under .emacs.d\elnode folder.
If I input url http://localhost:8000 in my Chrome, it will show following content:
/
.
..
default-webserver-image.png
test.html
But when I click the test.html file, chrome just can't get the response from elnode. I check my Emacs, the Message file provides two errors:
elnode-error: elnode--sentinel 'open from 127.0.0.1.' for process elnode-webserver-proc 127.0.0.1:2224 with buffer nil
elnode-error: Elnode status: elnode-webserver-proc 127.0.0.1:2224 open from 127.0.0.1
elnode-error: filter: calling handler on elnode-webserver-proc 127.0.0.1:2224
elnode-error: starting HTTP response on elnode-webserver-proc 127.0.0.1:2224
error in process filter: apply: Spawning child process: invalid argument
error in process filter: Spawning child process: invalid argument
I just don't know how to debug it. I also tried elnode-send-file function, it also doesn't work.
But If I run the Hello World example, it works:
(defun my-status-page (httpcon)
(elnode-http-start httpcon 200 '("Content-type" . "text/html"))
(elnode-http-return httpcon "<html><b>HELLO!</b></html>"))
(elnode-start 'my-status-page :port 8010)
The core problem is that Emacs can't send html page!
Is it necessary to do some basic configuration after installing elnode?
Thanks
Water Lin
The newest edition has solved the problem. If you meet the same problem as me, please download the newest edition.
My test environment is Windows7 & Emacs 24.2.1.

Problems with Rails 3 Webrick and loading video for iPhone/iPad ( mp4 m4v ) video files

I'm trying to get Rails (3.0.0) to serve a simple m4v video file for iphone in a html5 video block. For sanity's sake i'm using the big buck bunny video from http://camendesign.com/code/video_for_everybody that I know is properly encoded for iphone and works
When i run this on an apache server it runs perfectly. But on my rails dev environment it just loads a black box with a slash through it. My instinct tells me it has to be some type of mime issue.
I've tried adding these lines to my mime_types.rb file:
Mime::Type.register "video/mp4", :mp4
Mime::Type.register "video/mp4", :m4v
Rack::Mime::MIME_TYPES.merge!({
".ogg" => "application/ogg",
".ogx" => "application/ogg",
".ogv" => "video/ogg",
".oga" => "audio/ogg",
".mp4" => "video/mp4",
".m4v" => "video/mp4",
".mp3" => "audio/mpeg",
".m4a" => "audio/mpeg"
})
But no luck. Some have suggested to add this line to the mime_types file too
MIME::Type.add(MIME::Type.from_array("video/mp4", %(m4v))
But that results in this error:
NameError: uninitialized constant MIME
from (irb):4
from /Users/theshaolinmonk/.rvm/gems/ruby-1.9.2-p0#rails3/gems/railties-3.0.0/lib/rails/commands/console.rb:44:in `start'
from /Users/theshaolinmonk/.rvm/gems/ruby-1.9.2-p0#rails3/gems/railties-3.0.0/lib/rails/commands/console.rb:8:in `start'
from /Users/theshaolinmonk/.rvm/gems/ruby-1.9.2-p0#rails3/gems/railties-3.0.0/lib/rails/commands.rb:23:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Anyone have any idea ?
Maybe add the following line to your Gemfile?
gem 'mime-types', :require => 'mime/types'