Forum Discussion
Hi there,
It may have been mentioned in a previous post, but you should have a look at the "WaitForControlWithText" function.
Even though your text for your toast is changing, surely this is expected for you test scenario and thus you can look for it :)
Have a look below, try it out and see if it works for you.
//JScript
function getToast(){ var android_process = Aliases.Device.Process("com.android.qa"); //Returns boolean value (true = found) if(android_process.WaitForControlWithText("toast_text","1000")){ //Do something if the text was found } else { //Do something if the toast was not found } }
- harsh_chhibber10 years agoContributor
Hi
I tried below function actually when the screen comes where toast message display- Objects are not visible in Object Browser for this particular screen. It is mobile device calling screen when we dial any number. Application is dependent on this screen to make a call.
So I am getting Object not found issue for android_process. Is there any other approach to capture toast message.
var android_process = Aliases.Device.Process("com.android.qa");
- altus_nel10 years agoContributor
Hi there,
Please have a look at your Object Browser. In there you will see a "Mobile" parent node with a "Device" child node. Inside the "Device" node you will find the "Process" node. Select this node and have a look at the "ProcessName" property. This is the value you must use to address your process.
var android_process = Aliases.Device.Process(<process_name>);
- harsh_chhibber10 years agoContributor
I have replaced the process name. My issue is not with the process name but the issue is that I can't run this function because the screen on which toast message appears is out of the application(dial in screen). When screen shows then the object browser display no objects.
So if objects are not display in Object browser so I can't run "WaitForControlWithText" function-
Any other approach to deal with toast message.
Related Content
Recent Discussions
- 5 hours agoSubhraDas
- 11 hours agoJacobjacob44