How to read alert message content in android using appium? - appium

currently I am using following method to read the alert message content but it throws error saying not yet implemented. What is the alternative method to achieve this?
driver1.switchTo().alert().getText();
Error :org.openqa.selenium.WebDriverException: Not yet implemented. Please help us: http://appium.io/get-involved.html (WARNING: The server did not provide any stacktrace information)

In appium there is no need to use the switchto.alert method to capture the alert messages. Alert messages in mobile are actually in the native context and you have to switch to the native context to access the alert buttons/text.
driver1.context("NATIVE_APP");
After that you can capture the alert as an native element and fire any action upon it. Ex :
driver1.findElement(By.xpath("//android.widget.Button[#text='Yes']")).click();

Related

How to control upload extension initiated from controller center?

I implemented upload extension and setup RTMP server for broadcasting via upload extension. The broadcasting is initiated from control center, not through SetupUI extension. Since the SampleHandler.m doesn't provide RPBroadcastController, I can't programmatically pause or stop the broadcasting. I'd like to at least stop the broadcasting and show error message that the server is not available. I've looking through all WWDC docs, but couldn't find much info. Mobcrush is showing error message like "Not logged in", how they do that?
I found a mistakes in my code, finishBroadcastWithError function should call [super finishBroadcastWithError:] to call RPBroadcastController to stop broadcasting and show proper error message. You don't need to access RPBroadcastController nor need SetupUI to controller broadcast. That was it, I wasted 2 days on this, I wish no one do that.

Status message thingworx

I create a ThingWorx Project,i use a message box,When a status message appears, it waits 7 seconds and then disappears, if during this time a new message come, status box shows new message and old message together.i want that,it always shows only the new message.
Before thingworx 8.3 you can use JQuery and somehow hide that message but you cannot use JQuery for new versions. You can refer to Create An Extension for Thingworx guide and try to edit extension.

How can I send a message to a custom Google Cast Receiver from Chrome for iOS?

I'm using the CastHelloText-chrome example and am able to get it all working just fine from the Chrome browser on my desktop, however, when I try to use Chrome on my iOS device, I receive the following error when trying to create a session:
{ "code": "channel_error", "description": "The operation couldn't be completed. (com.google.chrome.ios.cast error 2.)" }
This error happens when executing the following:
chrome.cast.requestSession(function(e) {
session = e;
session.sendMessage(namespace, message, onSuccess.bind(this, "Message sent: " + message), onError);
}, onError);
Specifically, this seems to happen on the requestSession function call (the nested callback never actually executes).
Everything up until this point seems to work. In fact, on my iOS device, I even receive the popup asking where to cast to (Chromecast) and once I select it, my Chromecast does indeed display my custom receiver. However, I still receive that error message and never get a session object, so I can't send messages to the receiver.
Like I said, this seems to work fine on my desktop Chrome browser, but does not work on my iOS Chrome browser. Does this sample not work on iOS devices? Is there a way to make it work?
Chrome on desktop and Chrome on mobile are not the same. You need to use the iOS API. Use the sample app for CastHelloText-ios as a reference.

com.google.GCKError Code=2 when connecting to ChromeCast device

I'm working on an iOS app where I now want to integrate ChromeCast support. I use the HelloGoogleVideoCast example to test my hardware setup and get inspiration for my app.
I have now stumbled on a problem that is present both in my app and in HelloGoogleVideoCast. When I connect to a device (connectToDevice method in HelloGoogleVideoCast) I get error "The operation couldn’t be completed. (com.google.GCKError error 2.)". I have power-cycled the device with no change in behavior. I never get to the callback deviceManagerDidConnect, instead deviceManager:didFailToConnectWithError is called with this error. Still, I can connect with the iOS YouTube app.
I can't find anything with substance if I google it and I can't find any good ChromeCast developer forums.
Is there anybody who has an inroad to how to solve this?
I m not sure it will help but u can try:
Download the Chromecast app from app store:
chromecast link
After u see your chromecast -> select your chromecast -> General -> make sure both check box are selected (I know the text is nothing to do with your problem).
Try now.
If the error still occur, try to reboot your chromecast.
If your error still occur, try to reset your chromecast, and then check the boxes again (don't forget!).
Make sure that you initialize the Receiver Manager in your receiver app as soon as possible. Don't wait for the window.onload. If the receiver takes too long to load and initialize the receiver manager, the connection is automatically torn down.
I had the same problem as you did and making the following changes on receiver worked for me:
I've put the script src="//www.gstatic.com/cast/sdk/libs/receiver/2.0.0/cast_receiver.js" inside head tag and before title tag;
I've put my script file which managed all cast functions after
body tag (actually I've put all script declarations, except for cast_receiver, after body tag, including jQuery);
I hope it can help you yet :)

Detect whether email is sent or not + Blackberry

I am facing a little problem with Transport.send(msg) function of Blackberry API. In my application i need to send a sound file. But I want to know what happens if the device loses connectivity in middle of sending the email.
I tried to enclose the Transport.send(msg) call within try catch block but it never throws exception even if i manually turn off the wifi from the device while the file is being sent.If by any chance email could not be sent i want to show the user a Dialog saying that email could not be sent.
Kindly help.
Regards,
tek3
You can catch SendFailedException which is thrown when a message cannot be sent.
You can monitor the messages by calling getStatus() on a message which should return you the values given here

Resources