I'm trying to check implicit wait functionality in winium but application is getting freeze while executing the below step.
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
Not sure if you have already received an answer to this, but here is what I did and it worked for me. It is similar to what you already have just updated some.
driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(15));
Related
Looking for some clarification as to how one can log caught exceptions using flutter's firebase_crashlytics package.
If I understand correctly (and from running some sample code) Crashlytics.instance.log('text'); will only add logs to the next crash report, rather than send off a non-fatal issue itself.
I'm looking for functionality which is equivalent to Crashlytics.logException(e); on Android, e.g.
try {
throwException();
} catch (e) {
Crashlytics.logException(e);
}
which allows you to log caught exceptions so they appear as non-fatal issues in the Crashlytics dashboard.
Is this currently possible with flutter's firebase_crashlytics package?
Is calling Crashlytics.instance.recordError('text', StackTrace.current) the way to achieve this for now?
Many thanks!
Short answer, yes.
Crashlytics.instance.recordError() is the equivalent of Crashlytics.logException()
If you dig into the Flutter firebase_crashlytics source code, you can actually see what Android APIs are involved.
Flutter’s recordError() invokes the method Crashlytics#onError in the Android library.
And tracing Crashlytics#onError, you’ll see that it goes to Crashlytics.logException(exception);
Additional note, you’ll also notice why Crashlytics.instance.log() ”will only add logs to the next crash report”. These logs are added to a ListQueue<String> _logs which is then packaged into the next call of recordError()
A snippet of Flutter’s invocation of Crashlytics.logException():
_recordError(...) {
...
final String result = await channel
.invokeMethod<String>('Crashlytics#onError', <String, dynamic>{
'exception': "${exception.toString()}",
'context': '$context',
'information': _information,
'stackTraceElements': stackTraceElements,
'logs': _logs.toList(),
'keys': _prepareKeys(),
});
}
And some reference notes for Crashlytics.logException():
To reduce your users’ network traffic, Crashlytics batches logged
exceptions together and sends them the next time the app launches.
For any individual app session, only the most recent 8 logged
exceptions are stored.
To add to the accepted answer, Crashlytics.instance.recordError() has now been deprecated for the new method FirebaseCrashlytics.instance.recordError(exception, stack).
BONUS TIP:
I had this problem where all the logged exceptions are grouped under the same issue in Crashlytics dashboard. These might be different crashes of the same or different code components. Due to this, I had to manually go through each instance of the crash to verify.
From my own testing, I found out the grouping is based on the top-most line in the stack trace you passed into the method above. Luckily, Dart has an easy way to get the current stack trace using StackTrace.current.
So to properly group the issues: get the current stack trace at the time of the exception and pass it in FirebaseCrashlytics.instance.recordError(exception, stack).
Hope this helps someone out there, I looked everywhere on the internet for a similar issue but can't find any.
So, I had a working xamarin forms app that used azure mobile services. I upgraded the server side to use mobile app service and upgraded the nugets in my client to use the latest and greatest client codes.
I manually updated my test/ios simulator sqlite db to use the proper column names for the system properties since they dropped the double underscore prefix.
When I finally got it all built and tried to run in the ios 6/8.3 simulator it ran fine until it hit the InitializeAsync method. It doesn't throw (its in a try catch) and I let it run for a long time and it just sits there.
I then tried to change the db name so it would make it from scratch, which it did but still just hung. So I then tried to simplify it to a single table and took out my delegating handler so it was as basic as I could get it and it still just hangs.
Has anyone else had this problem? I am at a complete loss because I don't get an error. Not sure where to start.
Thanks.
Edit, code added:
var store = new MobileServiceSQLiteStore(_localDatabaseName);
store.DefineTable<Profile>();
try
{
await _mobileService.SyncContext.InitializeAsync(store);
}
catch (Exception e)
{
Debug.WriteLine(e.Message);
}
I also tried with ConfigureAwait(false) as suggested but it made no difference.
I set breakpoints in the catch and the code that immediately follows this block but they are never hit.
Ok, so I poked around a bit more and found some info on deadlocked threads answered by Stephen Cleary, the guru of async/await.
It turned me onto looking upstream. The call into my azure init code looked like this:
var azureService = Container.Get<IAzureService>();
azureService.InitializeAzync().Wait();
Which was in the constructor of the calling component.
So, I changed it to this:
try
{
Task.Run(() => azureService.InitializeAsync()).Wait();
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message);
}
And the SyncContext.InitializeAsync() call worked fine and continued on.
So, I don't really know the answer for this, I guess the internals of the new azure client do something differently than the old code since using Wait() was how I did it before and never had a problem. But there was some sort of threading deadlock. Very odd and took days to get past, now I have to fix the next deadlock I hit. If Stephen is out there and can offer some clarification that would be great.
Had this same issue - changing to a Task.Run and ConfigureAwait(false) did fix it.
Very odd thing is the same code worked fine with Mobile Services, but broke when we upgraded to Mobile App Services.
Recently got this question from one of my friend but i am not sure how it works in oozie.
Question:
What happens if one action fails in workflow(assume multiple actions are there) and when we restart again whether it starts from failed action or start from previously completed action.
Please clarify this doubt.
Thanks
Saravan
This property comes into the consideration, oozie.wf.rerun.failnodes if true: It will start from the failed node, false: it will start from the start.
I am using hiredis library in my project. I'm using async API. I schedule a read command and wait for data. That works fine. However problem occurs when I try to close the connection - I call redisAsyncDisconnect, however the callback routine isn't called until I receive data.
Is it possible to cancel the read operation? How? Or is there a way how to force close the connection?
The answer is clear now - redisAsyncFree does what I need - stops all commands and calls redisAsyncDisconnect.
I have the following code in my test class (java) but the timeout doesn't seem to work (it has no effect at all). I've tested it with really slow connections and I expect it to fail after 5 secnods but it waits for page to load indefinately and sometimes it come back in 8-10 seconds and the test passes as the page has actually loaded but not within the time I specified. Any idea why page timeout command is not doing what it is supposed to do?
protected static WebDriver driver;
driver = new FirefoxDriver();
driver.manage().timeouts().pageLoadTimeout(5,TimeUnit.SECONDS);
driver.get("http://www.google.com");
I'm using Selenium 2.20.0.
Thanks in advance
Then report it as an issue
http://code.google.com/p/selenium/issues/list
pageLoadTimeOut makes no sense without "unstable" Firefox profile.
Probably, you will have to either download the plugin been mentioned at the selenium download page OR write a while loop that would run indefinitely and break only when the element is found. Make use of try-catch blocks as well.