Breakpoint debugging in Appium - debugging

Is there a way on how to set breakpoints in appium or get a better debugging experience than looking through logs and printing console.log() all the time?
I would like to be able to stop the test run in any step and see what are the values - proceed to next step and so on. I saw that this might be possible using IDE but is there a better integration solution? Also saw that cloud device providers provide similar logging solutions like https://www.browserstack.com/docs/app-automate/appium/set-up-tests/debugging-options but this is only on the cloud devices and I would like to see it localy.
Maybe a dependency that would include what I am asking for?
My setup is appium, webdriver.io, mocha.
Thank you in advance!

First of all, debug with IDE and BrowserStack logs it's not the same. I don't know why you need it, but the best way to debug is to use the IDE
enter image description here
enter image description here
enter image description here
Also, you can create your custom logger util, which will store all the events to log file and print it
And the last one is https://appium.io/docs/en/commands/session/events/get-events/
self.driver.execute_script("mobile: deviceInfo")

Related

How to run Microsoft Teams sample app in debug mode

I am using this app https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples/tab-personal-sso-quickstart/csharp_dotnetcore
It works fine.
I wish to extend the functionality - specifically in auth.js - so I need to be able to run it in Debug mode.
I have tried for some time but have no success getting a breakpoint hit. I use the instructions at https://devblogs.microsoft.com/microsoft365dev/debugging-microsoft-teams-app-locally-with-teams-toolkit as guidance but have no success. (In particular I don't have 'Debug (Chrome)' or same for Edge available as a config in VS Code.
Can anyone point to guidance on this please or perhaps advise if I need a specific launch.json config
Thanks
Update – the Teams sample code I was using comes from https://github.com/OfficeDev/Microsoft-Teams-Samples
They run fine but I had no success getting them to debug. Any search for ‘Teams samples’ is going to find those first!
The repo linked from the ‘Samples’ button of the VS Code Teams Toolkit is at https://github.com/OfficeDev/TeamsFx-Samples and works as the article above describes.
As for why there are 2 sets of official samples, not cross referenced … go figure.
Hope that helps someone.

How do I build Flutter application locally?

I have developed (on a Mac) a small Flutter app to learn the technology. Now, I would like to build it and use it on Mac, Linux and Android. The few packages I have used claim compatibility with all systems.
So the first thing I did was to run flutter build macos. I indeed obtain an application under build/macos/Build/Products/Release/nameofmyapp.app. It seems this runs correctly, but it fails, for instance, loading data from a DB, which is the first thing it should do.
I have a few questions:
are there any other steps that I should take? I see a long guide about the release process, but to be frank I don't need or want any of that: I only want to use the app myself. Is there something else to do other than flutter build macos?
am I looking for the built app in the right place?
if I did everything correctly, could it be that I need to authorize the app to access to the file in some way? Should I manage this workflow myself, or is there a standard way to perform this action in Flutter?
Sorry for asking more than one question, but I am not sure whether what I am doing wrong is
the build process
where to look for the built app, or
(not) handling the app permissions.
EDIT
Following a suggestion by Madhavam, I tried flutter run --release. The result is identical to running the built application: nothing is loaded from the database, and no errors appear in the console.
To be clear, these are the libraries that are not working:
sqflite should load data from a database (in my Documents folder) but does not show anything
file picker cross should allow me to load data from a JSON file, but when I try this interaction, I an not shown any dialog to load a file
shared preferences should read some settings, but they all appear as null
In short, anything that has to do with interacting with external files or storage does not seem to work
Yup, you have to manage it yourself. Take a look at this package
:https://pub.dev/packages/permission_handler
If you're using Firebase then you probably need to add the release keys.
One thing too, if you face an error only in the release build then I recommend running the app with flutter run --release so that you can see the errors that are being thrown.
So it seems that this is related to the default being an app that runs in sandbox. Since I do not want to distribute the app, it was fine for me to disable this setting. Details are in this answer

Debugging cucumber steps in WebStorm

I'm experimenting with Cucumber/WebdriverIO UI tests using Webstorm (NodeJs platform). At certain steps I would really love to stop it in debug mode, check the retrieved element and see what can I do with it.
But unfortunately the Debug button is disabled and I couldn't find anything specific in Webstorm documentation as well.
If I can achieve my original goal (stopping a step and experimenting with the elements) without using Webstorm's Debug mode, that's totally fine for me.
Debugging Cucumber specs is not currently supported, please vote for WEB-15146
I'm not sure how this would work with Cucumber but WebdriverIO now has a debug command you can use

IBM Worklight - Shell Component

When I have created a shell component, inside the shell component common folder there is folder called preview. I need to know what is the use of this folder. I am trying to understand about it using the following point specified in IBM modules.
preview: can be used to implement native functionality stubs for simulation in the Worklight Console preview instead of receiving exceptions
Still i am not having any clear idea about this. Can anyone give a clear idea about this.
Thanks in advance!
I believe that the main idea of the preview folder for shell component is to simulate its native behaviour, let's say for example you want to you the Google Maps API on a given area.
For the one developing the shell they do not have the final App, to test its behaviour. So, they can create some simulation such as a picture for a Map or a Picture of a Android TOAST, to allow them to work in the shell it self.

Test Suite Execution Jubula

I've been looking at Jubulas automated functional testing tool and following along with the tutorials, but I've become stuck before I ever even got off the ground with it. The user manual provided with the installation hasn't given any answers and I can't find anything in blogs dedicated to Jubula.
My question: I have my test suite, complete with test cases & steps, all set up and ready to go. I've mapped my objects using the editor. I've started the AUT and connected to it. All I have to do is start the test execution.... I click start.... nothing happens.
The Java application is visible (it's a simple calculator) and I can interact with it. But I don't get any dialogue boxes when I press start, which is what is supposed to happen according to the tutorial.
Has anyone tried Jubula and had this problem?
Two things come to mind.
If the "Start Test Suite" button is disabled, then it means you still have some sort of a problem stopping the Test Suite being executed (e.g. missing data or object mapping).
If the "Start Test Suite" button is enabled, then it might just be that you need to select a Test Suite to execute from the drop-down menu (opened by clicking on the small arrow next to the green button).
I had the same problem but at least I got a report about the tests failing. After I specified the JRE for the AUT (this setting is only shown if you click on the advanced or expert button) my tests finally started to work.
I think it's none of the previous answers. If you get a Failed-test report or your Start Test Suite button is disabled then it's pretty obvious. You can find those mistakes mentioned in documentation/blogs.
BUT! There are two errors which leave no traits; no error messages, nothing in logs.
1.) If there's a version incompatibility If you installed Jubula from a standalone installer or from Eclipse marketplace then it will work. But if you put it together for yourself then you cold mix up the components. I have an answer on these issues:
Jubula doesn´t recognize running AUT after upgrade to 2.0
2.) If you mislead your AUT-agent by starting an other .exe It has exactly the symptoms mentioned in the question. It's happening because the application has the Remote-Control (rc) plugin started in it and the AUT-agent is notified about the start. It tries to identify the process within the AUT-configs listed in the client's (testexec's) database and it misidentifies it.
You can solve this by adding each run-situation as a different AUT-config in your database. It's mostly about location in the filesystem: about where the exec process is launched from. I.e: debug-local (from Eclipse launch-bar), exported-local (for Delta-pack exports), QA-local (if you have PDE in your build) etc.

Resources