i use UIAutomation and instrument for my UI Tests and when i try to tap some letters, instrument return me an error:
Script threw an uncaught JavaScript error: target.frontMostApp().keyboard() failed to tap 'V' on line 27
A part of code:
passwordField.tap();
target.frontMostApp().keyboard().typeString("VEMO");
Has anyone some ideas about it?
Thank
There is an undocumented function that exists on the UIAKeyboard object that will help you avoid this problem.
var keyboard = target.frontMostApp().keyboard();
keyboard.setInterKeyDelay(seconds);
keyboard.typeString("VEMO");
You can push the delay up as high as you want but I found that a delay of 0.1 was enough to prevent the keyboard from failing.
Related
I've hit an assertion in code and wondering if there's a way to create a wrapper around the assert that would enable breaking out and continuing execution or some other function that would enable a way to suppress the assert through the lldb debugger.
assert(condition(), makeCriticalEvent().event.description, file: fileID, line: UInt(line))
This is the standard assertion in apples libraries here. When I hit this assertion I tried continuing execution but it stays stuck at the assertion. I'd like to silence the assertion (likely through the lldb debugger by typing some command). Anyone have an idea how to do this?
You have to do two things. First, you have to tell lldb to suppress the SIGABRT signal that the assert delivers. Do this by running:
(lldb) process handle SIGABRT -p 0
in lldb. Normally SIGABRT is not maskable, so I was a little surprised this worked. Maybe because this is a SIGABRT the process sends itself? I don't think there's any guarantee suppressing SIGABRT's has to work in the debugger so YMMV, but it seems to currently. Anyway, do this when you've hit the assert.
Then you need to forcibly unwind the assert part of the stack. You can do that using thread return, which returns to the thread above the currently selected one w/o executing the code in that frame or any of the others below it. So just select the frame that caused the assert, go down one frame on the stacks and do thread return.
Now when you continue you won't hit the abort and you'll be back in your code.
Is it possible to catch the following exception?
"Failed to get matching snapshots"
Most of the stability issues with XCUITest is due to not having a proper method to wait for element to exist. Tried exists(), waitforexistence(),xctwaiter waits etc. In all cases it fails randomly with above error. Is there a way we have handle this exception do a retry in our tests itself.
You should stick to combination of two methods
Use it for every flaky element
button.waitForExistence()
button.tap()
I didnt change anything but suddenly I got this error in my xproject and the app got stuck and thing the when I do simulator through my Xcode is working but not with physical device.
the full log is here:
'Failed to print error: ', 'global.nativeTraceBeginSection is not a function. (In \'global.nativeTraceBeginSection(TRACE_TAG_REACT_APPS, profileName, args)\', \'global.nativeTraceBeginSection\' is undefined)'
WARNING: Logging before InitGoogleLogging() is written to STDERR
E0910 19:37:09.077337 1871998976 JSCHelpers.cpp:137] Got JS Exception: Exception calling object as function: global.nativeTraceEndSection is not a function. (In 'global.nativeTraceEndSection(TRACE_TAG_REACT_APPS)', 'global.nativeTraceEndSection' is undefined) (<unknown file>:2303)
E0910 19:37:09.077525 1871998976 JSCHelpers.cpp:143] Got JS Stack: endEvent#http://192.168.1.27.xip.io:8081/index.bundle?platform=ios&dev=true&minify=false:2303:35
__callFunction#http://192.168.1.27.xip.io:8081/index.bundle?platform=ios&dev=true&minify=false:2098:24
http://192.168.1.27.xip.io:8081/index.bundle?platform=ios&dev=true&minify=false:1927:29
__guard#http://192.168.1.27.xip.io:8081/index.bundle?platform=ios&dev=true&minify=false:2068:11
callFunctionReturnFlushedQueue#http://192.168.1.27.xip.io:8081/index.bundle?platform=ios&dev=true&minify=false:1926:19
callFunctionReturnFlushedQueue#[native code]
2018-09-10 19:37:09.079 [fatal][tid:com.facebook.react.JavaScript] Error calling Systrace.setEnabled
Unhandled JS Exception: Exception calling object as function: global.nativeTraceEndSection is not a function. (In 'global.nativeTraceEndSection(TRACE_TAG_REACT_APPS)', 'global.nativeTraceEndSection' is undefined) (<unknown file>:2303)
2018-09-10 19:37:09.082 [error][tid:com.facebook.react.JavaScript] global.nativeTraceBeginSection is not a function. (In 'global.nativeTraceBeginSection(TRACE_TAG_REACT_APPS, profileName, args)', 'global.nativeTraceBeginSection' is undefined)
2018-09-10 19:37:09.083 [info][tid:com.facebook.react.JavaScript] 'Failed to print error: ', 'Can\'t find variable: regeneratorRuntime'
E0910 19:37:09.086755 1871998976 JSCHelpers.cpp:137] Got JS Exception: Exception calling object as function: global.nativeTraceBeginSection is not a function. (In 'global.nativeTraceBeginSection(TRACE_TAG_REACT_APPS, profileName, args)', 'global.nativeTraceBeginSection' is undefined) (<unknown file>:2298)
E0910 19:37:09.086828 1871998976 JSCHelpers.cpp:143] Got JS Stack: beginEvent#http://192.168.1.27.xip.io:8081/index.bundle?platform=ios&dev=true&minify=false:2298:37
__invokeCallback#http://192.168.1.27.xip.io:8081/index.bundle?platform=ios&dev=true&minify=false:2125:28
http://192.168.1.27.xip.io:8081/index.bundle?platform=ios&dev=true&minify=false:1950:32
__guard#http://192.168.1.27.xip.io:8081/index.bundle?platform=ios&dev=true&minify=false:2068:11
invokeCallbackAndReturnFlushedQueue#http://192.168.1.27.xip.io:8081/index.bundle?platform=ios&dev=true&minify=false:1949:19
invokeCallbackAndReturnFlushedQueue#[native code]
(lldb)
I have been trying to find solution, didn't succeed with any of them.
this error shows on my Xcode logged and not on my screen of the phone
Thank you so much for the help!!
I had the same issue because I unintentionally enabled Start Systrace and since it is a known react native issue... I was getting the error.
What worked for me was just disabling Start Systrace and restarting the project. How I do that?
Command ⌘ + D
Press Disable Start Systrace, that's it!
This is a known, unresolved React Native issue. There are a few workarounds in the GitHub issue, including:
Delete, and then reinstall the app from Xcode or react-native run-ios
Revert to the old bridge (instructions)
See https://github.com/facebook/react-native/issues/15003 for more details.
sometimes the execution of
AudioOutputUnitStop(inputUnit)
results in the app to be freezed for about 10/15 seconds and the following console message:
WARNING: [0x3b58918c] AURemoteIO.cpp:1225: Stop: AURemoteIO::Stop: error 0x10004003 calling TerminateOwnIOThread
Such code is handled by the Novocaine library and in particular it occurs in the [Novocaine pause] method which I invoke to stop the execution of the playback of an audio file (https://github.com/alexbw/novocaine/blob/master/Novocaine/Novocaine.m).
Any hint is really appreciated!
Thanks,
DAN
Have a system build using C++ Builder 2010 that after running for about 20 hours it starts firing of assertion failures.
Assertion failed: xdrPtr && xdrPtr == *xdrLPP, file xx.cpp, line 2349
Tried google on it like crazy but not much info. Some people seem to refer a bunch of different assertions in xx.cpp to shortcomings in the exception handling in C++ Builder. But I haven't found anything referencing this particular line in the file.
We have integrated madExcept and it seems like somewhere along the way this catches an out of memory exception, but not sure if it's connected. No matter what an assertion triggering doesn't seem correct.
Edit:
I found an instance of a if-statement that as part of it's statement used a function that could throw an exception. I wonder if this could be the culprit somehow messing up the flow of the exception handling or something?
Consider
if(foo() == 0) {
...
}
wrapped in a try catch block.
If an exception is thrown from within foo() so that no int is returned here how will the if statement react? I'm thinking it still might try to finish executing that line and this performing the if check on the return of the function which will barf since no int was returned. Is this well defined or is this undefined behaviour?
Wouldn't
int fooStatus = foo();
if(fooStatus == 0) {
...
}
be better (or should I say safer)?
Edit 2:
I just managed to get the assertion on my dev machine (the application just standing idle) without any exception about memory popping up and the app only consuming around 100 mb. So they were probably not connected.
Will try to see if I can catch it again and see around where it barfs.
Edit 3:
Managed to catch it. First comes an assertion failure notice like explained. Then the debugger shows me this exception notification.
If I break it takes me here in the code
It actually highlights the first code line after
pConnection->Open();
But it seems I can change this to anything and that line is still highlighted. So my guess is that the error is in the code above it somehow. I have seen more reports about people getting this type of assertion failure when working with databases in RAD Studio... hmmmm.
Update:
I found a thread that recursively called it's own Execute function if it wasn't able to reach the DB server. I think this is at least part of the issue. This will just keep on trying and as more and more worker threads spawn and also keep trying it can only end in disaster.
If madExcept is hinting that you have an out of memory condition, the assert could fail if the pointers are NULL (i.e. the allocation failed). What are the values of xdrPtr and xdrLPP when the assert occurs? Can you trace back to where they are allocated?
I would start looking for memory leaks.