How to waitForElementVisible in Silk Performer? - performance-testing

What is the Silk Performer 16.5 (Web Browser driven) equivalent of Seleniunm IDE's waitForElementVisible? I cannot find it in the help or manual.

if found out the function below basicaly does the same as waitForElementPresent in selenium IDE and did work for me in the Silk Performer Script.
BrowserFind(HANDLE_DESKTOP, "//INPUT[#id='send']", true, 60000, false);

Related

Cordova-Electron : Is there a way to add preload.js script and disable node-integration?

In the Apache Cordova doc (https://cordova.apache.org/docs/en/10.x/guide/platforms/electron/index.html), it is suggested to set "nodeIntegration" to true in settings.json file to use NodeJs and Electron API in the renderer part of my app.
However, in the electron doc, this action is not recommended for security reasons, and it is suggested to use a preload script to do so.
Is it possible to do the same with cordova-electron ?
Something like this doesn't seems to work :
{
"browserWindow": {
"width": 1024,
"height": 768,
"fullscreen": false,
"frame": false,
"webPreferences": {
"nodeIntegration": false,
"preload": "file://{Directory}/preload.js",
"contextIsolation": true
}
}
The "preload" option isn't read.
I'm using cordova 10, with cordova-electron 2.0.
Thanks in advance for any advice. :)
According to the Electron documentation we have to use absolute path for the preload and file:// protocol is considered as a non-absolute. If you change the path to a really absolute one the app will try to preload it.
The problem here is defining dynamic path in that json configuration. As far as I can see it couldn't be set using __dirname directive, so the easiest way at least for now is using nodeIntergration: true in cordova-electron build

Cannot capture system audio output with Electron desktopcapturer in Ubuntu

I want to capture OS system audio output with Electron desktopcapturer, it works well in Windows as following:
constraints = {
// audio: false,
audio: {
mandatory: {
chromeMediaSource: 'desktop'
}
},
video: {
mandatory: {
chromeMediaSource: 'desktop'
//maxFrameRate: 15
},
}
then, I use:
navigator.webkitGetUserMedia(constraints, function(dstream) {...
However, in Ubuntu, it always shows "could not start audio source". Can anyone tell me how to do? Thanks for your help.
Because of a patch merged in Chromium, it's not possible to access system audio without much low-level tinkering. Here is an issue raised on Electron's github page but is left un-resolved since 6yrs. Quoting a reply from the issue, that seems to be of little hope:
I was searching through the Chromium issue tracker, and found this: https://bugs.chromium.org/p/chromium/issues/detail?id=1143761&q=linux%20streaming&can=2
This may be worth keeping an eye on, since it seems related to this issue. It's possible that this issue may see resolution when the Chromium team starts pushing fixes.
Here is the pulseaudio patch submitted to chromium, which is the root cause of this issue. Comming to a potential solution you can revert back before this commit and audio capture should work fine then. But, I haven't tried out this solution. Let me know if someone manages to fix this, or try this.
Leaving my answer here for the record, it may or may not work for you. I ran into this error while testing my Electron app, while being in a Google Meet at the same time (i.e. Chrome had a lock on my microphone). The error stopped happening once I ended the Meet.

how to detect the browser

How can I detect if the browser is an internet explorer or firefox or chrome? Is there an easy way like just using jquery. Because I want to limit the jquery calls if my user agent is internet explorer.
Please advise.
Many thanks.
jQuery.browser is deprecated in jQuery since 1.9.
There is a plugin for jQuery that adds this "back" to jquery. You will fid it (and documentation) at https://github.com/gabceb/jquery-browser-plugin
Install it by adding <script src="/path/to/jquery.browser.js"></script> after where you are adding jQuery.
then you can use the following.
$.browser.msie; //returns true if ie
$.browser.webkit; //returns true if webkit-browser (Safari, Chrome)
$.browser.mozilla; //returns true if firefox
Try jQuery.browser
Check if IE
$.browser.msie ? alert('Internet Explorer') : alert('Not Internet Explorer');
Or info for the browser that is accessing page
$.each($.browser, function(i, val) {
$("<div>" + i + " : <span>" + val + "</span>").appendTo(document.body);
});
Working example here

How can I bootstrap Dojo 1.7 in Node.js?

I've looked at the dojo-node module (https://github.com/agebrock/dojo-node) and the author says that Dojo 1.7 will support Node.js natively.
There is a configNode.js file in Dojo 1.7, but I'm not sure how to use it to have Dojo up and running.
http://download.dojotoolkit.org/release-1.7.0b1/dojo-release-1.7.0b1/dojo/_base/
Can somebody point me into the right direction? Perhaps show me a small example also?
Appreciate any help I can get.
Here's my solution, although it may look tricky since I can't search out any official examples, I have to read the source and work it out:
Assume dojo is under /home/root/dojoroot/dojo/dojo.js
Create /home/root/mynode/test.js with content:
dojoConfig = {packages:[{name: 'test', location: '../../mynode'}]};
require('../dojoroot/dojo/dojo');
Create /home/root/mynode/main.js with content:
define(['dojo/date'], function(date){
console.log('Hi ' + date.getTimezoneName(new Date()) + ', welcome to NodeJS!');
});
$> node /home/root/mynode/test.js load=test

Dojo - problem sending form with IE6

I am getting a JavaScript error in IE6 when trying to send form data with xhrGet. Here is the code:
var kw = {
url: "Save.action",
load: function(data){
},
error: function(data){
},
form: "editData"
};
dojo.xhrGet(kw);
It works fine in IE 8. I am using Dojo 1.3.2 and the error in the uncompressed dojo.js is at line 8713.
Any suggesttions (other than "don't support IE6")?
Thanks
Looks like it was a combination of two things: Dojo not liking IE6 and me not using the preferred call. When I switched from xhrGet() to xhrPost() it works fine.
To answer the question above, my error was "invalid argument". I still think this is a problem with Dojo but am happy to move on.

Resources