Error message [null] or [null,null,null,null] when using browser.actions protractor - angularjs

When runnning code like:
element(by.css('input')).sendKeys(arg1).then(function() {
browser.actions().sendKeys(protractor.Key.ENTER).perform().then(callback);
});
Or anything using browser.actions()
I'm getting an error message like:
1) Scenario: User goes back to search results - features\headerNavigations.feature:31
Step: When I enter "1000W Rotary Lawnmower" - features\headerNavigations.feature:34
Step Definition: ..\node_modules\cucumber-tsflow\src\BindingDecorator.ts:163
Message:
[ null ]
Ever since updating to chromedriver 2.27 I'm seeing this issue.
Node: 6.9.1
Protractor: 5.1.0
Chrome: 56.0
Chromedriver: 2.27
Seen this which maybe similar:
https://github.com/angular/protractor/issues/4067
And raised a question here:
https://groups.google.com/forum/#!forum/chromedriver-users
Not seeing much action from the protractor or chromedriver community

Related

Akeneo 2.2.5: No JobInstance found with code "add_to_existing_product_model"

Since the forum at akeneo.com is locked down, I posted my question here.
When I try to add Produkts to a Product-Model via mass-edit, I get the following error message:
No JobInstance found with code "add_to_existing_product_model"
[2018-06-19 19:39:31] request.INFO: Matched route "pim_enrich_mass_edit_rest_launch". {"route":"pim_enrich_mass_edit_rest_launch","route_parameters":{"_controller":"pim_enrich.controller.rest.mass_edit:launchAction","_route":"pim_enrich_mass_edit_rest_launch"},"request_uri":"http://pim.eu-trading.eu/rest/mass_edit/","method":"POST"} []
[2018-06-19 19:39:32] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Translation\Exception\NotFoundResourceException: "No JobInstance found with code "add_to_existing_product_model"" at ./vendor/akeneo/pim-community-dev/src/Pim/Bundle/EnrichBundle/MassEditAction/OperationJobLauncher.php line 59 {"exception":"[object] (Symfony\\Component\\Translation\\Exception\\NotFoundResourceException(code: 0): No JobInstance found with code \"add_to_existing_product_model\" at ./vendor/akeneo/pim-community-dev/src/Pim/Bundle/EnrichBundle/MassEditAction/OperationJobLauncher.php:59)"} []
I get this error with the latest version of Akeneo 2 (v2.2.5). The product model was created manually, the products to be associated with the model came through the api.
This error looks like a missing job in the database. Did you run all the doctrine migrations?
To do so you need to launch this command:
bin/console doctrine:migrations:migrate --env=prod
If you already launched the migrations and they failed, you can install a clean 2.2.5 PIM elsewhere and dump the job instance table to be able to add the missing jobs. Here is the list of the jobs to add or update in 2.2:
- add_association
- move_to_category
- add_to_category
- remove_from_category
- add_to_existing_product_model
- compute_family_variant_structure_changes
- compute_completeness_of_products_family
- add_attribute_value
- delete_products_and_product_models

"TypeError: can't dup NilClass" in Capybara + selenium driver

I tried following code
crawler = Capybara::Session.new(:selenium)
crawler.visit "https://twitter.com" # Error this line!
with
gem:
capybara (= 2.2.0)
selenium-webdriver (3.3.0)
WebBrowser:
FireFoex53.0
OS:
Mac OSX
then got following Error
TypeError: can't dup NilClass
[stack trace]
gems/selenium-webdriver-3.3.0/lib/selenium/webdriver/remote/w3c_capabilities.rb:101:in `dup'",
gems/selenium-webdriver-3.3.0/lib/selenium/webdriver/remote/w3c_capabilities.rb:101:in `json_create'",
gems/selenium-webdriver-3.3.0/lib/selenium/webdriver/remote/w3c_bridge.rb:116:in `create_session'",
gems/selenium-webdriver-3.3.0/lib/selenium/webdriver/remote/w3c_bridge.rb:76:in `initialize'",
gems/selenium-webdriver-3.3.0/lib/selenium/webdriver/firefox/w3c_bridge.rb:45:in `initialize'",
gems/selenium-webdriver-3.3.0/lib/selenium/webdriver/common/driver.rb:52:in `new'",
gems/selenium-webdriver-3.3.0/lib/selenium/webdriver/common/driver.rb:52:in `for'",
gems/selenium-webdriver-3.3.0/lib/selenium/webdriver.rb:87:in `for'",
gems/capybara-2.2.0/lib/capybara/selenium/driver.rb:13:in `browser'",
gems/capybara-2.2.0/lib/capybara/selenium/driver.rb:45:in `visit'",
gems/capybara-2.2.0/lib/capybara/session.rb:197:in `visit'"
url "https://twitter.com" is working when I manualy visit on this FireFox browser.
but capybara's visit method is does't work..
I ran into this error (TypeError: can't dup NilClass) when trying to use the selenium-webdriver gem as instructed:
require "selenium-webdriver"
driver = Selenium::WebDriver.for :firefox
As suggested by Thomas, updating the selenium-webdriver gem number from 3.3.x to 3.4.x resolves the issue.

Target browser must be a string... (selenium, protractor)

i have upgraded my environment to have support for my tests for firefox, chrome, etc.
I have installed:
Node LTS (6.10.0)
Selenium Server Standalone 3.1.0
protractor#5.1.1
npm#4.1.2
When i now want to run my test i receive:
[17:31:32] I/launcher - Running 1 instances of WebDriver
[17:31:32] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
[17:31:32] E/launcher - Error: TypeError: Target browser must be a string, but is <undefined>; did you forget to call forBrowser()?
[...]
[17:31:32] E/launcher - Process exited with error code 100
Process finished with exit code 100
What does that mean?
The config.js is:
var TIMEOUT = 10000;
exports.config = {
...
capabilities: [
{
'browserName': 'firefox', //tried as 'firefox', firefox and "firefox"
//'marionette': true //tried true and false
},
],
...
};
That was tricky and funny :) You know what .. There is no issue with browserName. Problem was you are providing the capabilities object incorrectly. You are providing an array whereas you need to send 1 capabilities object
Remove '[' & ']'
capabilities: [{'browserName': 'firefox'},] - This is incorrect . This means an Array of size 1 with index 0 holding your firefox config
It should be this - capabilities: {'browserName': 'firefox'}

AngularDart on Firefox fails with "receiver.webkitCreateShadowRoot is undefined"

I have an AngularDart application that is working fine on Chromium and Chrome with Javascript. But in Firefox and IE, I get the following error:
[14:36:14.648] "NullError: receiver.webkitCreateShadowRoot is undefined
STACKTRACE:
.Element.createShadowRoot$0#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:84445
J.createShadowRoot$0$x#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:153659
._ComponentFactory.call$6#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:11337
.BlockFactory__instantiateDirectives__closure2.call$1#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:11097
.Primitives_applyFunction#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:5148
._FactoryProvider.get$2#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:125034
J.get$2$x#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:153716
.DynamicInjector__getInstanceBySymbol_closure.call$0#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:124806
._defaultCreationStrategy#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:125162
.Binding.creationStrategy$3#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:125271
.DynamicInjector._getInstanceBySymbol$2#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:124652
.DynamicInjector.get$1#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:124694
J.get$1$x#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:153713
.BlockFactory__instantiateDirectives_closure3.call$1#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:11183
.IterableMixinWorkaround_forEach#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:22126
.JSArray.forEach$1#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:1995
J.forEach$1$ax#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:153707
.BlockFactory._instantiateDirectives$5#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:10887
.BlockFactory._dom$_link$4#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:10816
.BlockFactory._dom$_link$4#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:10818
.BlockFactory._dom$_link$4#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:10818
.BlockFactory._dom$_link$4#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:10818
.BlockFactory.call$2#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:10776
.ngBootstrap_closure0.call$0#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:7661
._rootRun#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:27183
._ZoneDelegate.run$2#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:34652
.NgZone__onRun_closure.call$0#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:10306
.NgZone._onRunBase$4#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:10162
.NgZone._onRun$4#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:10181
$$.BoundClosure$4<.call$4#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:424
._ZoneDelegate.run$2#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:34652
._CustomizedZone.run$1#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:35046
.ngBootstrap#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:7485
.main#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:130170
._IsolateContext.eval$1#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:3635
.startRootIsolate#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:3301
#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:161315
#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:161295
#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:161309
#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:9
"
Here is my foobarUI/pubspec.yaml:
name: foobarUI
description: A sample web application
dependencies:
angular: 0.9.3
browser: any
json_object: any
petitparser: any
unittest: any
foobar:
path: ../foobarLib
I tried to add the js, shadow_dom and web_ui modules but it made no difference.
I tried to add "useShadowDom = true;" (and false) to the main dart file, no difference.
From the error, it seems obvious that the webkit support for DOM shadow root is missing but why is this module not handling this ?
The same error occurs with angular.dart.tutorial chapter_03 sample. This is clearly an issue with Angular.Dart. Bug filed as: https://code.google.com/p/dart/issues/detail?id=15752
The Dart bug for issue is at: https://code.google.com/p/dart/issues/detail?id=15144
It has been fixed in Dart bug has not been pushed to AngularDart yet. That work is blocked by https://github.com/angular/angular.dart/issues/366.

Using PhantomJS through Selenium with Python - WebDriverException error

I am using the following code, as recommended here: Is there a way to use PhantomJS in Python?.
from selenium import webdriver
driver = webdriver.PhantomJS()
driver.set_window_size(1024, 768) # optional
driver.get('https://google.com/')
driver.save_screenshot('screen.png') # save a screenshot to disk
sbtn = driver.find_element_by_css_selector('button.gbqfba')
sbtn.click()
When I try to run it I get the following error:
WebDriverException - "Unable to start phantomjs with ghostdriver."
Apparently, this error can be solved by replacing the 3rd line with:
driver = webdriver.PhantomJS(executable_path='/usr/local/lib/node_modules/phantomjs/lib/phantom/bin/phantomjs')
I'm using Windows7, and the path for me appears to be: "C:\Users\myname\AppData\Roaming\npm\node_modules\phantomjs\bin\phantomjs". I have tried using this and variations of it as the executable_path, but I still get the same error. I have also tried adding the folder location to the path. Nothing has worked. I suspect that I am missing something pretty obvious.
Aha!
It was a slightly different location. The line I was looking for was:
driver = webdriver.PhantomJS(executable_path=r'C:\Users\myname\AppData\Roaming\npm\node_modules\phantomjs\lib\phantom\phantomjs')

Resources