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.
Related
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>;
}
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
I'm working in an Ionic 1 project. What i'm trying to make is a function that sends a notification using the package ionic-push-server. But for some reason the program trows me an error saying that the require function is not defined.
ReferenceError: require is not defined
This is my code (taken from https://www.npmjs.com/package/ionic-push-server)
$scope.notification = function(){
var ionicPushServer = require('ionic-push-server');
var credentials = {
IonicApplicationID : "APP_ID",
IonicApplicationAPItoken : "APP_API_TOKEN"
};
var notification = {
"tokens": TOKEN,
"profile": "push",
"notification": {
"title": "Hola",
"message": "Hola mundo!"
}
};
ionicPushServer(credentials, notification);
};
I've already installed the package using npm, so i know this is not the problem.
I've tried to do something like this:
<script src="node_modules/ionic-push-server/server.js"></script>
And use the function inside (export), but it trowed me an error like this:
GET http://localhost:8100/node_modules/ionic-push-server/server.js
Also i've tried doing this:
import * as ionicPushServer from "ionic-push-server";
But i've got this error:
Uncaught SyntaxError: Unexpected token import
I could solve it using local notifications.
https://github.com/katzer/cordova-plugin-local-notifications
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>"
}
},
[...]
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