UIAutomation - WebKit Threading Violation - initial use of WebKit from a secondary thread - webkit

Running UIAutomation from the command line I often get:
WebKit Threading Violation - initial use of WebKit from a secondary thread.
Note, I'm using the -w flag and it's at the beginning. This answer didn't help: WebKit Threading Violation - initial use of WebKit from a secondary thread in UI Automation
Any idea how to avoid?
==== UPDATE
Just getting Instruments NOT to print this out would be useful.

Related

wxWidgets wxMessageDialog works well in a secondary thread while a custom dialog doesn't

I am programming using C++ /CLI with wxWidgets on Windows 11.
I'm Also Using .NET threads
When I create a wxMessageDialog in a secondary thread and run ->ShowModal() , it works.
But when I create a custom dialog in a secondary thread, running ->ShowModal() pops up a wxWidgets debug alert window :
I tried searching on the wxWidgets forum for the same issue but couldn't find one. I found similar issues but none of them addresses my problem.
I also tried to surround MyCustomDialog->ShowModal() with calls to wxMutexGuiEnter(); and wxMutexGuiLeave(); , but that also didn't work.
I also learned about wxThread while scrolling through the forum but if wxMessageDialog works without me having to create a wxThread, I shouldn't have to create a wxThread myself.
I know I shouldn't be calling GUI methods from a secondary thread, but somehow wxMessageDialog's ShowModal() doesnt have a problem with that.
I would like to know how wxMessageDialog works, and if I can implement the same thing with my custom dialog.
Thank you.
In a few words, no there's no way to use a custom dialog from a secondary thread with current implementation and in the foreseeable future.
Even though your current code works today using wxMessageDialog, there's no guarantee that it will continue to work tomorrow, or on different Windows version or on other OS.
Some more details:
wxMessageDialog and a custom dialog are significantly different internally, even though they represent similar UI features.
wxMessageDialog has native implementation, and you can find its wxMessageDialog::ShowModal() implementation in src/msw/msgdlg.cpp.
A custom dialog will be assembled an run by wxWidgets code, even though the dialog itself and other components are native widgets. You can find wxDialog::ShowModal() in src/msw/dialog.cpp.
If you really want to pursue some experimental development (because it would still not be suited for anything else), and being on Win 11, you could try wxRichMessageDialog. It provides more features than wxMessageDialog and on Vista and later versions it has native implementation, which might go along with your "hack".
But again, using UI from secondary threads will lead to a dead end sooner or later.

What automation tools can be used for yfile based graphs

I have a UI where yFiles based graphs are used.
What would be the best automation tool suitable to automate and test the same
yFiles for HTML can be automated using the usual tools for web UI automation with some caveats (see below). Internally we use the Selenium WebDriver API, but some other approaches work as well.
The main requirement for an automation tool is that events are reproduced faithfully like they would be by normal interaction with a browser. yFiles can be very sensitive to the correct order of input events, since we use a state machine that can get out of sync if, e.g., a mouse-down event isn't followed by a mouse-up event. Some testing approaches don't bother raising the correct events (e.g. only raising a click event while disregarding the mouse-down and -up events) and this can sometimes cause yFiles to not work as expected.

Finding performance-related release-only bugs in Cocoa

I am currently developing a project and I'm working in debug during development.
Typically, I'm just working in release mode before I am releasing the next update to check if everything works as expected.
During the last release tests, I found a bug that just appears in release mode.
As soon as I set the optimization level to 1 or higher (I'm using LLVM 4.2), the bug starts to appear.
I don't have any clue what the error could be related to.
Does anyone have an idea what I could do to find the reason of the error?
Instruments maybe? Didn't find a mode that would fit.
It's a performance-related error and I can't seem to find it with breakpoints.
My first guess is that the main thread is running full so that not all events can be processed in time.
If that was it, why would that not happen in debug mode?

Titanium NSInvalidArgumentException

I'm trying to build a crossplatform (Android-ios) mobile application, using Titanium SDK. I didn't have a chance for a long time to build it for ios, I only used my Windows-android combination, to test it, and it works great on the Android system. But when i try to build it on the mac for the ios, i get this message, and the application shuts down in a second:
The application has crashed with an uncaught exception
'NSInvalidArgumentException'.
Since i can not provide any relevant code, because the exception doesn't show what's the problem with my javascript code, and I certainly didn't write any native, ios specific code, i have no idea, what to do.
From the few posts i have found here is what i have tried:
Restart Titanium Studio
Clean the project
Made sure to close any ResultSet, and DB objects when done with
them (as suggested here: topic)
Test the code on both 3.0.0 and 2.x.x versions
I'm looking forward to any advice, on how you solved this problem, if you had it!
Thanks in advance!
Update:
The problem was the following: I called hasOwnProperty on Titanium UI elements, and on the ios version these elements don't have this function (which is weird, since every javascript objects have it, if i'm not mistaken).
If you have similar problems, i recomend reading this article, besides mr.VVoos answer, it helps a lot in avoiding the problems i had!
I'm developing with Titanim and iOS & Android for a long time. Usually there are many differences between iOS and Android parts of the code.
In most cases this exceptions means that an operation is called that is not available for the called class. (In Java this would mean: Class.method() -> Class has no method called method()).
You can try to run the app in debug mode (on iOS Simulator). There is a big advantage debuggin iOS compared to Android. Usually the iOS simulator stops if there is an exception and it shows the JavaScript code that caused the exception. Unfortunately this doesn't work all the time and it only works on simulator.
If this does not provide any further information you can do the following:
- go to your app.js and set a breakpoint in one of the first lines.
- start app in debug mode.
- move on this breakpoint each time until your app crashes - maybe then you are able to detect the error or provide further information.
One last tip: Check your code if there are any platform-specific parts. (Like Android Intents and something that is not available on iOS).
I know that this can be very ugly but we had to solve many of these nasty issues while migrating from iOS to Android.

Running Secondary Threads in Background Continuosly

I need to create a new thread which will have infinite while loop, so that it won't block main UI thread. The newly created thread is getting killed when I send the application to background mode, But I need to run it in background. Any help?
There is a difference between a Background Thread and a Background Task in iOS, but the underlying answer remains the same; don't run a background thread unless you simply cannot avoid it. Furthermore, you can't just spin off a thread and have it run if your app wants to support backgrounding in iOS.
First, you should read the documentation. It is extensive and provides many examples.
Then, if you have any specific questions not covered by the docs (or to clarify the docs), ask 'em here!