DEPRECATION NOTICE while trying to launch selenium chrome driver using nightwatch - selenium-webdriver

I use chromedriver with nightwatch for my web-ui testing. Things were working until i got this message. How do i get around this issue
DEPRECATION NOTICE: Property chrome_driver is deprecated since v0.5.
Please use the "cli_args" object on the "selenium" property to define
"webdriver.chrome.driver". E.g.:
{
"cli_args": {
"webdriver.chrome.driver":
"<VALUE>"
}
}

The answer is there in your own question, and in the example on the Nightwatch site:
"selenium" : {
"start_process" : false,
"server_path" : "",
"log_path" : "",
"host" : "127.0.0.1",
"port" : 4444,
"cli_args" : {
"webdriver.chrome.driver" : "<chromedriver path>"
}
},
[...]

Related

webview_flutter javascript channel can't communicate in release mode

I am using webview_flutter with version 3.0.0 in my app. I have heavy usage of two-way communication between flutter and javascript. Everything works on debug mode nicely. But, after I build the APK started to get some errors in the javascript channel. I tried with flutter run --release and got the same error.
In my web application (ReactJs), I am using channels in this way:
index.html
<div id="root">
<script>
function sendToFlutter(message) {
if (flutterChannel) {
flutterChannel.postMessage(message);
}
}
</script>
</div>
calling is from React component like this:
window.sendToFlutter("hello-world");
My Webview setup from Flutter end:
Completer<WebViewController> webViewCompleter = Completer<WebViewController>();
WebView(
debuggingEnabled: false,
initialUrl: "https://example.com",
javascriptMode: JavascriptMode.unrestricted,
onWebViewCreated: (WebViewController webViewController) {
webViewCompleter.complete(webViewController);
},
javascriptChannels: <JavascriptChannel>{
JavascriptChannel(
name: "flutterChannel",
onMessageReceived: (JavascriptMessage message) {
if (message.message == "hello-world") {
// Do something
}
})
},
navigationDelegate: (NavigationRequest request) {
if (request.url.startsWith('https://www.youtube.com/')) {
return NavigationDecision.prevent;
}
return NavigationDecision.navigate;
},
gestureNavigationEnabled: true,
zoomEnabled: false,
userAgent: Platform.isAndroid ? kAndroidUserAgent : kIosUserAgent,
);
When I call the channel from ReactJs, then I am getting this error:
TypeError: flutterChannel.postMessage is not a function
According to alexbatalov's research in https://github.com/flutter/flutter/issues/92548, the current workaround is to do the following:
Create android/app/proguard-rules.pro. At minimum you need to have a
rule for JavascriptInterface, but I recommend to copy entire
proguard-android.txt, given the fact that you don’t have these rules.
# Preserve annotated Javascript interface methods.
-keepclassmembers class * {
#android.webkit.JavascriptInterface <methods>;
}

Unrecognized pipeline stage name: '$planCacheStats'

Getting the below error when I run the following aggregate commands on MongoDB version 4.0.12. From what I read about the error, it looks like a syntax issue. But this was given to me by someone and they said it works. Can someone please tell me what I'm doing wrong?
db.bookings.aggregate( [ { $planCacheStats: { } } ] )
db.bookings.aggregate( [ { $planCacheStats: { } } , { $project: {createdFromQuery: 1, queryHash: 1 } } ] )
Output:
E QUERY [js] Error: command failed: {
"ok" : 0,
"errmsg" : "Unrecognized pipeline stage name: '$planCacheStats'",
"code" : 40324,
"codeName" : "Location40324"
} : aggregate failed :
_getErrorWithCode#src/mongo/shell/utils.js:25:13
doassert#src/mongo/shell/assert.js:18:14
_assertCommandWorked#src/mongo/shell/assert.js:536:17
assert.commandWorked#src/mongo/shell/assert.js:620:16
DB.prototype._runAggregate#src/mongo/shell/db.js:260:9
DBCollection.prototype.aggregate#src/mongo/shell/collection.js:1062:12
#(shell):1:1
As you are using version 4.0, it is not supported. So you are getting unrecognised pipeline error
$planCacheStats - New in version 4.2
Hence it is Supported from 4.2.
Reference

automation test using protractor with browserstack does't work with mobile browsers

I tried to set up test using angular protractor. It works fine when I use browsers of desktops, But failed with mobile browsers.
Here is the set of protractor.
seleniumAddress: 'http://hub.browserstack.com/wd/hub',
capabilities: {
'browserstack.user' : 'user',
'browserstack.key' : 'key',
'browserstack.debug': 'true',
'browserstack.local' : 'true',
'platform' : 'MAC',
'device' : 'iPad mini Retina'
},
And I got the error like this in the log of browserstack when using iphone:
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>6A1E5288B65A8A2C</RequestId>
<HostId>
ixGtp6t7yQWYa7cjkNqmaXLEHTXeKklSkf+Jmg9vnA/a+RYUfzUhJuNykqKAwOuoA3o1eQA9M9c=
</HostId>
</Error>
Error like this when using andriod
01:23 0 Injecting JavaScript-argsbodyscriptreturn (function () { var el = document.querySelector(arguments[0]); var callback = arguments[1]; try { angular.element(el).injector().get('$browser'). notifyWhenNoOutstandingRequests(callback); } catch (e) { callback(e); } }).apply(null, arguments);⇒
**This is feature will be implemented soon!**
Any one can give me some ideas about this?
You need to supply username and API key in request URL.
In your code:
http://hub.browserstack.com/wd/hub
It should be:
http://[username]:[api_key]#hub.browserstack.com/wd/hub
without [] brackets.
Also, you can read browserstack document for further understanding. https://www.browserstack.com/automate/ruby

How do I get protractor to accept the browser local camera

I've been trying to get protractor to accept the browser local camera by using
browser.actions().sendKeys(protractor.Key.TAB, protractor.Key.TAB, protractor.Key.ENTER).perform();
This tabs to the accept button properly, but the enter key never gets submitted. I've also tried using
browser.actions().sendKeys(protractor.Key.TAB, protractor.Key.TAB).perform();
browser.actions().sendKeys(protractor.Key.ENTER).perform();
thinking that maybe enter needed to be on it's own line.
Any ideas on this?
You can try to manipulate the question popup using switchTo(), but I am afraid this is not going to work since this is a native chrome popup and not a javascript alert:
browser.driver.switchTo().alert().accept();
Here are the options (not tested yet):
start chrome with disable-web-security argument set in chromeOptions:
chromeOptions: {
args: [
'disable-web-security'
]
}
start chrome with use-fake-ui-for-media-stream argument:
chromeOptions: {
args: [
'use-fake-ui-for-media-stream'
]
}
add your site to the VideoCaptureAllowedUrls list (taken from here)
chromeOptions: {
prefs: {
'VideoCaptureAllowedUrls': ['http://my_url']
}
}
Also, have you tried pressing TAB 3 times?
browser.actions().sendKeys(protractor.Key.TAB, protractor.Key.TAB, protractor.Key.TAB, protractor.Key.ENTER).perform();
Try this:
capabilities: {
'browserName': 'chrome',
'chromeOptions': {
args: ['--use-fake-device-for-media-stream','--use-fake-ui-for-media-stream'],
}
},

problems running qooxdoo simulation-run job

I am trying to use the qooxdoo simulation-run job for this simple test (with changed class namespace of course):
qx.Class.define("twitter.simulation.Settings", {
extend : simulator.unit.TestCase,
members :
{
testChangeLanguage : function()
{
this.fail("Test not implemented!");
}
}
});
However, every time I try to run it, I get this very misterious error:
js: uncaught JavaScript runtime exception: TypeError: org.mozilla.javascript.Undefined#275b35 is not a function, it is org.mozilla.javascript.Undefined.
I am using Rhino 1.7R4 for the Javascript engine. The Selenium version is 2.25 and qooxdoo is at 2.0.2. Here is the simulation-run job config:
"simulation-run" :
{
"let" :
{
"SIMULATOR_CLASSPATH" :
[
"../selenium/selenium-java-2.25.0.jar",
"../selenium/libs/*",
"../rhino/js.jar"
]
},
"environment" :
{
"simulator.selServer" : "localhost",
"simulator.selPort" : 4444,
"simulator.testBrowser" : "*firefox",
"simulator.autHost" : "http://localhost:8080",
"simulator.autPath" : "/application/index.html"
}
}
You need to use the 1.x Selenium client drivers.

Resources