How is click action implemented in appium for chrome android - appium

I know that the click action in iOS Safari is implemented with javascript, unless nativeWebTap capability is set to true (as reported here), I cannot find a description of how the click action is implemented in chrome on a mobile device running android. Can somebody help gathering this information?

Appium uses WebDriver API to test Web applications on Android Chrome browser, so basically it is using Chromedriver to make calls to Chrome DevTools and interact with DOM.
It is not like pure JS commands by default, but WebDriver API still allows you to send JS code for execution.

Related

How to get WebRTC logs on Safari Browser

I have been trying to get the webrtc logs for my web application running over safari browser, similar to what we get in firefox by going to the page about:webrtc and on chrome by using chrome://webrtc-internals.
Alternatively, Is there any js API for webrtc to get the logs on the console itself, similar to what we use in Native Android and iOS applications using the RTCLogger.
Thanks in Advance
On Safari Version 15.4 (17613.1.17.1.13), useful information can be retrieved this way:
In Preferences... -> Advanced, ensure Show Develop menu in menu bar is enabled.
In the Develop menu Settings, select the Console tab, then ensure WebRTC Logging is not Off (and so choose either Basic or Verbose).
At that point the Console will show WebRTC events and data structures.
e.g.:
Solution
If you open the Safari and also open the console application, you can filter WebRTC logs with these filters:
category:WebRTC
process:safari (optional)
just copy-paste them one by one to the search bar in the console application. Actually, the second one is optional (process:safari).
I'm not sure about the others but at least you can see:
SDP offers and answers
ICE candidates
WebRTC statistics
incoming and outgoing video frame counters
Fun Fact
Based on the official documentation of WebRTC you can't see logs on Safari :)
Useful Infos
Do you know there is a WebRTC menu in the Safari. Check the Develop > WebRTC sub-menu
Check the Safari Technology Preview app for more options and flags
If you’re not logged in as an administrator, you need to enter an administrator name and password to search for and view log messages.

Test offline browsing with Android Chrome

I am trying to build an offline-data persistent web application with Service Workers. I managed to have it working on my laptop Chrome (51) and it loads the cached files and displays an offline message when I simulate being offline via the Chrome DevTools - Network tab.
I uploaded the application to github to make sure it is available with https (https://mguardos.github.io/index.html)
However, when I try to test it with my Android Chrome (Nexus 5 - Android 6.0.1 - Chrome 51), the application loads fine when online, but if I set the plane mode on and reload the page, the browsers is not checking the service worker but displaying the offline message directly
"You are offline.
Your devide is offline.
Try: ...
ERR_INTERNET_DISCONNECTED"
Is there any option that I have to enabled in my Android Chrome for Service workers to work?
Thanks for any tip
PS (edited): Same issue occurs with Opera 37 on Android 6.0.1. However, the Registration service happens properly for both Chrome and Opera in the background (validated via an alert upon the registration method is successfully completed)
PSS: The link above tries to be a very basic example of combining service workers with AppCache, to retrieve localStorage and IndexedDB data so any constructive critic would be very much appreciated on top of the original question
The problem in Chrome seems to be that it requires the entry '/' to be added to the files to be cached for the Service Worker. I added that entry and I could see the application working fine while offline with my Android
However, the problem with Opera remains the same, I can even replicate it with the https://airhorner.com app
Just Open Opera (make sure you clean the cache before)
go to https://airhorner.com (the application loads fine - although it does not sound)
Activate airplane mode
Reload the page (the application still loads because it is reading from local cache)
Close the browser or simply go to a different address
Then go back to https://airhorner.com (The Offline message I added to the original question appears)
I will continue my investigation and will potential create a new question just for the Opera browser, as this question has been answered for Chrome

How did a Captive Portal force to open a browser

I've setup a Captive Portal with dd-wrt, wifidog, authpuppy and some plugins from authpuppy as well as my own web app.
I am wondering what's the exact thing that will trigger a
browser on the client device to popup?
Is the popup browser from iPhone/iPad a regular browser mode?
It seems some JavaScript will fail on the browser mode, like the shake.js,
event though iOS Safari version is > 4.2.1 from https://github.com/alexgibson/shake.js/
P.S.:
I've done the research like
http://en.wikipedia.org/wiki/Captive_portal
https://personaltelco.net/wiki/CaptivePortal
they don't talk much about the popup browser.
Could anyone help?
If you will try to see the network statistics [request/response] you will find out that devices like ios and android both of them continuously hits some particular urls [in case of android it is www.google.com/generate_204 , don't remember exact url for ios]. These url are generated by system internally. These pings let their server know about various details. So as soon as ios gets connected with a captive portal it tries to hit the system generated url, failing to which it understands that this is packet level protected network and open the browser.
Hope this helps.

Web Page for iPad: how to send data to server without PHP

I've developed a website that uses some PHP to write the client's user responses to a data file on my server. I've realized that the iPad cannot run PHP sites, and I'm at a complete loss as to what a good alternative would be. Javascript and HTML can't be used to write to a server, right? Help?
Thanks in advance.
Edit: I fixed it. The problem was that the iPad has problems with recognizing .click. I had to change it to .bind("click tap touch", function.... instead. It's weird how it was still able to recognize the click events that did not initiate a form submission (that is, when I was still using .click, the button worked, except for when it had to submit a form).
You'll need to put the PHP scripts up on a web host (e.g. GoDaddy.com or BlueHost.com) and then navigate to the website from a web browser on your iPad. The PHP will run on the server and so it will work whether you access it on a PC or an iPad.
While your developing, you could also access the server running on your computer from your iPad by navigating to http://<ip-address-of-your-computer>/myscript.php from mobile Safari or Chrome.
[EDIT] - Please note that the second option will only work while your computer and iPad are both on the same network.

Custom back button for Google Chrome

I've noticed in the latest iPhone Gmail app, that if I tap a link (and if I have the Google Chrome iPhone app installed) it opens up Google Chrome, and changes the back button in Chrome to show it going back to "Gmail"
I was wondering if anyone has managed to find a way to get this to work with their own apps, or if it's a private Google API?
I've tried Google's OpenInChromeController (https://developers.google.com/chrome/mobile/docs/ios-links) though that only seems to provide helper methods to open Chrome, and not change the back button
Google Chrome uses the x-callback-url scheme to create this type of behavior.
One example is something like this:
googlechrome-x-callback://x-callback-url/open/?x-source=MyApp&x-success=com.myapp.callback%3A%2F%2F&url=http%3A%2F%2Fwww.google.com
You can customize it to have a different response for a success or failure, and define whether Chrome will open the link in a new tab. There's more information available lower in the document that you linked to.

Resources