Selenium Java - If statement? - java

Hi everyone I have a problem that I don't know how to solve them. I'm actually testing an android apk and sometimes (depens on the user) showns an dialog and sometimes not. my ask is: ¿why if Im use an if statement the test stop when don't find the dialog?
what im using
if(Dialog.isDisplayed()){ DialogButton.click();
but when it's showns the actually works well. What I want to do is if the dialog doesn't appears continues normaly.
Thanks for everything. I'm not english native talker,so,sorry if don't understand something

Related

How Do I Make Android WebView Load Page Modal Elements?

I'm trying to make a really simple app for a friend to display his bar's ordering website in an app for when they reopen with the social distancing measures in place. The web app already exists, so this is really a simple matter of displaying the content in a WebView.
I've got the page loading, the content is visible, the styling is done - The only problem is that it doesn't seem to be loading all the elements. There's a line of filters at the top which just display as 3 dots (i.e. loading), and when I click any of the items on the menu, nothing happens. There should be a window pops up asking for a table number etc... If I open this in the Chrome browser on my phone, rather than a webview in the app it works perfectly so I know it isn't the website.
I've done the following;
setJavaScriptEnabled(true);
setJavaScriptCanOpenWindowsAutomatically(true);
setSupportMultipleWindows(true);
I've also turned off safe browsing in the manifest in case that was blocking anything. I have also given the app permissions to use the internet. I can't figure this one out at all and nothing online seems to be helping!
Admittedly I'm a tester (automated, but still), so coding isn't my best suit. I may be missing something really simple here. Any ideas?
Scratch that. For anyone who's interested, I needed to add this line;
setDomStorageEnabled(true);
For such a simple thing it proved impossible to find info on, I just enabled everything until something worked! So hopefully you don't have to do the same if you're looking at this.

Android app button text disappears after months of working fine

I have a field service reporting android app that I created in Oracle MAF. it has been in use for almost a year now with no UI issues, Over the last few days, I have been getting reports from our end users that the button text is disappearing. so - anywhere where there is a button with text inside it, the text is not visible. same font is being used elsewhere in the app with no issues. All the end users are running this on the Samsung Tab A 8.1. The last android update for the device was a few weeks ago. The problem is slowly propagating, like only 4-5 users a day are reporting that they go to use the app and the text is gone. luckily they are used to the app and know what all the buttons do, but I have to eventually fix it. I can't get any straight answers from Our IT department or Samsung as to why it is happening like this, and the update didn't seem to have anything in it that could do this. A factory reset fixes it for a day or two, and then the issue comes back.
What it is supposed to look like
Example of missing text
Like I said, this has been working fine for a while now. I'm mainly looking to see if anyone is aware of an Android update that would cause this, or if there was anything in the Samsung security update that would do it.
Google pushed an update to Chrome that they have discovered caused problems like this, and many others.
I was able to instruct my end users to disable chrome and let it roll back to the factory version.
this fixed the issue.

Can i insert a some code in HTML to set android wallpaper

This would be my first post ever on stackoverflow.com
I have found many many of the answers to my questions but this one question i cannot figure out.
I know that it is possible to invoke few android commands via either java code or other html code and was wondering if it is possible for a my website to set an image on my site as their wallpaper on their android phone.
To better explain this is what im doing.
My website will have say for example 50 images of something and when the user clicks on one of those photos the website will ( if possible ) invoke the android " set as background " Process.
Currently it is set to just download to their phone and then the user goes and selects the photo as their wallpaper from their download folder on their phone.
Thank You in advance
Vick S.
Interesting question. In Android, java runtime environment is what being run inside OS, and in order to execute commands you wish to make, rooting to OS is only way, and this can be done in java. So, if I were in your shoes, I'd drop the idea of rooting command line to android via HTML - but look over onto java side.
In other words...yes, it is possible. But, end-users will already have their phone/mobile pre-set to guard against that rooting commands, but to ask for permission from owner. If owner clicked yes, then you are in game. The hardest part about this is the complexity requiring bunches of efforts to code such rooting functions.
But, this could something as a starting point, at least? Running Shell commands though java code on Android?
Good luck!

how to get android spellchecker framework working

I have tried getting the android spelling checker working
http://developer.android.com/guide/topics/text/spell-checker-framework.html
However cannot understand how to. The hello spellchecker will load up a blank activity whilst the service example does nothing.
They are accessible through the sdk examples.
Does anyone know how to use them?
It gives you a TextView of the words they have entered in the HelloSpellChecker and a few suggestions.
FIRST install the SampleSpellCheckerService and then install the HelloSpellChecker app. If it doesnt work the first time try making a minor change to the HelloSpellCheckerActivity(insert a comment or a clank space) and run it again, it works.

Eken m009s Android

Hi I'm trying to produce an App for my Eken m009s Android, and want to know if there's some sample code in java out there that I can try, the ones that I've tried so far don't work.
Ok. I don't know any more about getting it to work with Eclipse - maybe this link will help. You can also try using the AVD Manager to see if there is a problem loading that AVD.

Categories