Anybody, tell me an way to open firefox and opera browsers in an android device and i have to get driver object for that browser, with the driver object I need to perform several actions on the webpage like, open the URL, getting element locations/positions, clicking the object, verifying the object attributes, etc., I am unsuccessful in using with "RemoteWebDriver" and "Selendroid Driver", so please give me some idea/approach to do it.
you are doing it in the wrong way. To use an android application in your selendroid driver you need to have the .apk file for that application. You can get .apk files for Firefox and Chrome by searching on Google Guru and use them as the application under test. You can load the URL which you want by using
driver.get("Your URL");
If you have any problem writing scripts go through documentation at Selendroid. And in case of further assistance edit your question.
Related
I have to develop a user registration form that is going to run on an Android tablet locally, without internet connection.
The idea I have is to make the submit using Javascript and store the user data in a .CSV file.
The page that show the form will be opened with Chrome or Safari, that is, in a web browser.
Is it possible to do this on an Android tablet? What would be the procedure?
I think that programming the form and then putting it in some internal folder will be enough and then open the index.html file with the browser.
Any advice or suggestion?
Thank you very much.
We have a file server on which we place PDF documents and then embed links to them in a smart device app. Up until recently, using links to the PDF documents starting with http:// worked fine for Android and iPhone users. All could load the PDF file just fine. Then a few months back (approximately) Android phone users started reporting they would get an error when trying to load any PDF. Yet iPhone users had no issues loading the same PDF document. It was verified that these PDF documents (several) were not corrupted and opened fine when placed on another file server.
I have an iPhone so I can't give you the exact error msg received by Android users but to reproduce it, it was along the lines of... click the link to the PDF, a button appears showing View PDF, click that button and several apps appear to choose the app to open the PDF with, click one (like Adobe Reader, or Google Drive) and an error appears stating the file could not be opened and may be corrupted of the wrong syntax.
Tonight I found the solution.
The url to the PDF on all these documents on our server had been like http://...
but when I changed it to https://... it works fine.
I can't find ANYWHERE any mention of a change by Google that this is now a requirement.
My question...
Can someone explain and/or point me to a reference that explains why https must be used in embedded links to PDF documents? It seems like a pretty big deal to make this a requirement and not tell anyone. My searching the internet has so far not turned up anything.
I have a webapp that when opened in a browser, the user can select a file (using the <input type="file" accept="image/*">. As expected this lists the image type of files from the mobile. On selection the app processes it.
When I convert the same to a Trusted Web App (TWA) pointing to the same URL, I find the the button shows all files from the directories. The accept filter does not seem to apply. In any case, if I chose the correct file type, the app does process.
Is something to be set on the manifest side to get this working? Thanks
In the Trusted Web Activity the application should behave in exactly the same way it does in a regular browser tab, so this seems to be a browser bug to me.
If the browser in question is Chrome, please file a bug at https://crbug.com/.
The pdf isn't on the server yet, but is created on the run. The URL would look like https://mydomain.com/?pdf=example¶ms=abc. If I open it in the desktop Browser, the PDF is shown. But on the mobile phone, it won't alawys start downloading, and if it does, the file is not readable. In the LogCat I get the following error:
hostname mydomain.com was not verified.
I've seen that other people have stumpled over the same error message, but unfortunately they're all writing in Java, and as im developing a web app I don't have the possibility to write Java code to fix the problem. Thanks in advance for any help.
I could locate the problem. The certificate is only valid for https://www.mydomain.com, while I was trying to get the pdf without the www in the link. When I changed this, it worked. May be helpful for someone else with the same problem.
I have a simple web app built with Phonegap and Android that call external ressources (js, css, html) from server instead of storing it in Phonegap assets folder. I prefer using external ressources because my server can deliver html pages taking in charge internationalization.
This web app work fine on my android device when WIFI is on but it fail when stopping WIFI. My index.html file delivered by my server contain a valid manifest file with correct mimetype ('text/cache-manifest') that list every files the app need to work.
My Android Activity class is supposed to have caching enable:
this.appView.getSettings().setDomStorageEnabled(true);
this.appView.getSettings().setAppCacheMaxSize(1024 * 1024 * 15);
String appCachePath = getApplicationContext().getCacheDir().getAbsolutePath();
this.appView.getSettings().setAppCachePath(appCachePath);
this.appView.getSettings().setAllowFileAccess(true);
this.appView.getSettings().setAppCacheEnabled(true);
It may worth mentionning that my app use ajax call with urls like /aaa/bbb/ to call web pages from server and I don't know if that may be the problem (l'm not calling physical pages directly like index.html)... However, this web app work well in desktop browser (Google Chrome) when offline...
Any idea what more can I do to enable this HTML5 cache feature on my Phonegap app?
Thanks a lot
After playing around for a while I get it to work. Here is some points you should verify when stucked with this type of caching problem:
Take care about url parameters passed with GET method... I was passing parameters when navigating between pages of my app and those parameters was making my urls different from the ones in manifest file making cache to fail.
When testing offline mode on my phone, I was only shutting down the WIFI thinking this was enough to trigger cached version of my app but it was not... As I was testing my app published under a local network IP (like 192.168.2.11), it appear that my app was trying to reach that IP trough the 3G network that was still ON... So use airplane mode when testing offline.
Not sure if this one was necessary as I read it on some others threads but I renamed my manifest file to cache.manifest.
Regards
Apparently you need "to fix the Android Shell Native App to enable HTML5 caching".
If you haven't already, please check out: http://tmkmobile.wordpress.com/2012/03/04/html5-offline-solution/
I am developing a similar system. What I did was I created the Phonegap webpages and stored them in the www folder of my WAMP server. Then what I do is I basically super.LoadURL("insert_ip_address_here/insert_name_of_folder_where_webpage_is_located") in the onCreate method and this loads the phonegap application perfectly (yes all you need is just only line of code in the Android app itself). However you still have to make sure that the config.xml, manifest and all configurations needed for phonegap are properly done (for instructions on this see https://www.adobe.com/devnet/archive/html5/articles/getting-started-with-phonegap-in-eclipse-for-android.html).
Let me know if this the path you choose to pursue. I can provide extra support with things like making the ip-address (in the line super.loadurl(...)) dynamic for the local system using multi-casting, etc.