WebDriverIO : Retrieving browser console messages - wdio

I have wdio#7 installed and want to retrieve browser console messages. According to documentation I have tried with browser.getLogs('browser') but it seems this method is deprecated in v7.
Can you suggest me any method for rederiving browser console messages.

Related

Using form submit from script on extension page

I'm developing an extension for Chrome, Firefox and Safari and I'm adding a feature that uses a form.submit style post to initiate a search on another web site.
I have the code working in Chrome using the method described in this post:
Chrome Extension Development - POST to new tab
However, it doesn't work in the Safari extension. There are two problems. The first is that the sendMessage to the new tab never gets to the post script. I found a solution to that: in Safari it doesn't treat a script loaded by an extension web page as a content script. So I have to use runtime.sendMessage rather than tabs.sendMessage.
The second problem is where I am stuck. The post script submits the form but there appears to be an error on the server side and I am unable to see what it is.
In the Safari Web Inspector the "Preserve log" doesn't keep the log when this error occurs. The server loads a new page (with blank search fields) and I can't see any info on the request header sent with the post or the response since the Web Inspector logs are cleared.
I suspect it may be a security issue since Safari tends to be more strict. Any ideas on any ways around this?

How to implement multi-window support in my custom browser provider plugin

I've updated to testcafe v1.9.4 and I would like to make use of the new multi-windows support.
However I use a custom browser provider.
When I run a test with openWindow I get the error
Multi window mode is supported in Chrome, Chromium, Edge 84+ and
Firefox only. Run tests in these browsers to use the "openWindow"
method.
If I add the following methods to my browser provider
supportMultipleWindows: true,
getActiveWindowId(browserId) {
return this.openedBrowsers[browserId].activeWindowId;
},
setActiveWindowId(browserId, val) {
this.openedBrowsers[browserId].activeWindowId = val;
},
Then my browser will start, but no longer open the url of the page under test, it just hangs on the browser idle page.
I have not found any documentation and the Testcafe browser provider generator seems to have not been changed to document or implement multi-window support.
Therefore I'm asking here.
At this moment, this feature is at the 'beta' stage. Implementation details may be changed before the release. This is why we don't announce 'multiple windows' support for a custom browser provider and cannot give any recommendations on the implementation of this feature. Once it is released, we will consider supporting multiple windows for custom browser providers.
UPDATE: Support for multiple browser windows was released as a stable feature in TestCafe v1.11.0. Due to its complexity and a huge amount of browser-specific code, we decided to not implement support for additional browsers and custom browser providers. While there is a possibility that we will implement it some day, we do not have plans to address this in the nearest future

Expo AuthSession: WebBrowser.dismissBrowser is not available on android

Having the error running on android:
The method or property WebBrowser.dismissBrowser is not available on
android, are you sure you've linked all the native dependencies
properly?]
- node_modules/#babel/runtime/helpers/construct.js:30:26 in _construct
- node_modules/#babel/runtime/helpers/wrapNativeSuper.js:26:23 in Wrapper
- ... 19 more stack frames from framework internals
I can open a browser. Once inside the browser if I quit the browser and went back to the application, the above message show up.
I tried look at WebBrowser from expo documentation
WebBrowser.openAuthSessionAsync(url, redirectUrl)
Opens the url with Safari in a modal on iOS using SFAuthenticationSession. The user will be asked whether to allow the app to authenticate using the given url. Unavailable on Android.
What does the line mean? does that mean android don't work etc.
The user will be asked whether to allow the app to authenticate using
the given url. Unavailable on Android.

How to test MobileFirst Adapter API outside of application

I am going through the tutorials of IBM MobileFirst. I have created an android application in MobileFirst and uploaded the Java HelloWorld adapter.
I can successfully trigger the API (such as the greet function) through my android app and I get back the desired result. But I would like to test the API also in the Browser, or through curl or through postman... But whenever I use the Browser or curl or Postman with:
http://localhost:XXXPORTXXX/mfp/api/adapters/SampleAdapter/resource/greet?name=myname
I dont get any string back... the browser stays empty and curl does not write anything...
If you're using MobileFirst v8, the adapter APIs are exposed as a Swagger doc. The swagger doc also gives you the curl command to run.
However, this works only on unprotected adapter methods.
If you wish you use this with protected methods, then you'll need to make use of a confidential client. See https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/authentication-and-security/confidential-clients/

MobileFirst Adapters - Why am I getting a "401 Unauthorized" error when making request on Swagger Docs page in the MobileFirst Operations Console

I am using MobileFirst CLI 8.0.0-2016070716, Java 1.8.0_91 (on Mac OS X 10.11.6 if it matters). I have been working through this tutorial on creating Java adapters using MobileFirst CLI.
After following the steps on creating, building, and deploying the adapter, I open the operations console and select the adapter I just deployed --> Resources --> "View Swagger Docs". When I press "Try it out" on any of the operations, I receive a "401 - Unauthorized" response code.
Any idea what problem might be?
"To add a Test Token to the request, so that the security framework skips any security challenges protecting your resource, click the on/off switch button on the right corner of an endpoint's operation.
You will be asked to select which scopes you want to grant to the Swagger UI (for testing purposes, you can select all). If you are using the Swagger UI for the first time, you might be required to log in with a Confidential Client ID and Secret. For this, you will need to create a new confidential client with * as its Allowed Scope."
Documentation regarding this is located here in our getting started tutorials.
https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/adapters/testing-and-debugging-adapters/#using-swagger