Long Press Keycode functionality not working? - appium

I'm trying to make a Webdriver.io project using Appium protocol for mobile automation, and I'm testing out the driver.longPressKeycode() function.
When I'm sending keycode of W i.e. 51 (according to android documentation), instead of long pressing the w key and sending input as '2', it's sending the input as 'ww'.
Tested it out with real device as well as emulator. Both have same output.
What is the exact functionality of longPressKeyCode() and how do I test its output it correctly?

Related

(React-Native) Set Cookie doesn't work in IOS, but perfectly on Android

Problems
I'm using react-native for our current services, and we are sending cookies to our webpage to send information which is needed to seen in our webview. These process is working PERFECTLY in android devices, but not in IOS. (The most annoying thing is set-cookie works sometimes in IOS in same condition. It just randomly succeeded, and I cannot find the reason why.)
How To Reprouce
First of all, these are the stacks we are currently using.
Application: React-Native
Webview: react-native-webview (https://github.com/react-native-webview/react-native-webview)
Cookie: #react-native-cookies/cookies (https://github.com/react-native-cookies/cookies)
Webpage: React (Already deployed in AWS)
Cookie: react-cookie (useCookie)
And the following is our process we are currently doing.
If the user clicks a button (I will call this button as 'Apply' button), it navigates to screen that includes <WebView />
This is a abstract of our webview screen code (For our security issue, I just abstracted and changed some code for it, so if you think more information for our code, please let me know.)
Rendering Page
enter image description here
WebView Component
enter image description here
Send Cookie
enter image description here
Send Cookie Function
enter image description here
(This function is kinda messy bc this is a collective code from 3 files, and I tried my best to set cookie differently with android. (The same logic with android doesn't work in IOS))
Webpage (Launched in AWS)
enter image description here
I Want My Code To Do This
I want my code to send cookie in loading state, and after loading, when the webview rendered, the webpage get some cookie and based on that cookie, it shows some data.
It PERFECTLY works on Android, but not in IOS. It works randomly in IOS so I have no idea what the heck is wrong with this code and hard to define a problem.
I tried...
Someone said to me to add '.' infront of domain. It worked for the very first time, but after the second trial, it starts to not working again
I also tried clear all cookie data before set cookie using
await CookieManager.clearAll();
, but it works same as the first measure I tried.
I also tried to use webkit. I send all true arguments to use webkit while using cookiemanager, but it has no effect.
I expected to do...
As I write in the above, I hope the cookie is rightly set in both android and ios environment, perfectly works in both platform.

Seaside redirect for render not working on physical iOS devices

We're having a problem with physical iOS devices (works fine on Chrome virtual device) where a final Seaside redirect is not happening after an Azure SSO redirect.
I'd like to understand what triggers the Seaside redirect: I can see it in normal rendering, but I've never had to dig into it like this before.
When I log from a non-iOS device I see...
1 - WAApplication>>handleFiltered: application URL
self requestContext redirectTo: 'https://login.microsoftonline.com/...'
redirects back to our app URL with an access token
2 -WAApplication>>handleFiltered: application URL with MS access token & no _s & _k values
validate token with Azure
save user info in new WASession
finish render
3 - WAApplication>>handleFiltered: application URL with _s & _k plus callback values like: &2=2160&1=3840&3=false
WAResponse>>location: application URL with _s & new _k and no callback values
4 - WAApplication>>handleFiltered: application URL with _s & _K
finish render
With iOS step 3 does not happen; I'd like to know what triggers it normally.
Just to add to the fun, we have a two WAApplication registered. The default application fails on iOS, the other works fine. I can see no obvious difference between the two.
Thanks for any help (I'll cross post on the the Seaside mailing list and Discord)
Problem is caused by a seven year old method that used a window.location.href= to gather device characteristics, like screen size and touch support. Removing that href fixes the problem with iOS. Lots of other & cleaner ways to get the data.
Quick fix is to wrap the href with a setTimeout for 200 ms.

Angular 2/4 : Mobile Number Auto Detection not working in Angular2/4

Feature : "By default, Safari on iOS detects any string formatted like a phone number and makes it a link that calls the number."
Working as expected Environments : Plain HTML and Angular 1.x.
We do the same implementation in another angular 2 application . this feature is not working as expected.
Current behavior : In Angular2/4 - Safari on iOS does not detect any string formatted like a phone number and it does not make it a link(iOS Devices).
Expected behavior : By default, Safari on iOS detects any string formatted like a phone number and makes it a link that calls the number.
Please go with the below JS Fiddle URL: (Please open this URL in iOS Devices we will not see this auto detection feature)
https://jsfiddle.net/1hk7knwq/3752/

App with custom URL callback and custom search URL

I'm looking for recommendations for an iOS barcode scanner app. Specifically for iPad which will support a custom URL callback to enable the app to be launched from a web browser.
Additionally, it needs to support and a custom search URL which will send the user back to the website once the barcode has been decoded into a URN (SKU).
I have discovered ZBar which is an excellent app, unfortunately it doesn't support custom URL callback and it's designed for the iPhone.
Another app pic2shop PRO seems to tick these boxes, but it's relatively expensive at £10.49 and the setup will require somewhere in the region of 200 installs.
I did a similar project using the free version of pic2shop . The thing is that the free version can read only these types of barcodes : UPC-A, UPC-E, EAN-13, EAN-8 , according to the documentation of the app.
Pic2shop is a free barcode scanner app available for iOS® and Android®. It reads UPC-A, UPC-E, EAN-13, EAN-8 and QR codes. The app also display comparison shopping results for UPC and EAN.
From my personal experience, I can say that it scans and decodes the barcode very fast and very accurate.
In my project the app is launched from a webpage, it works for both android and ios. In order to get it working you have to invoke the pic2shop app from a url and then set your callback address. You will find the decoded barcode data as a value to a parameter in the callback url. To help you more, you can get those values using this javascript function found here.
For example:
<input type=button OnClick="scan();" value="Scan Barcode">
<script>
function scan(){
window.location="pic2shop://scan?callback=http://yourwebsiteurl.com/index.html?barcode=ean"
}
</script>
As soon as the item is successfully scanned it will redirect you to the callback url with the actual barcode number as a value to a parameter. For example http://yourwebsiteurl.com/index.html?barcode=5123548745123. I already told you how to get the value of a url parameter with javascript.
PDF417.mobi Pro barcode scanner app supports that use case.
Note: I'm a developer on that project.
Basically, the app can be launched from any other app, including a web application, when url in the form: pdf417://scan?type=PDF417,UPCA&callback=myscheme://myaction is launched.
The app then scans the barcode, in multiple formats, (PDF417 and UPCA in this example), until the result is obtained.
Then, the app opens the URL myscheme://myaction. In your case, this can be your web service, http://www.somemyscanner.com/service.
Specifically, it will open the URL using format: http://www.somemyscanner.com/service?data=[data]&type=[type].
You can then use those parameters to implement your desired functionalities.
I tried the PDF417 app and it is EXTREMELY expensive (for an app - $28) and does not work. I bought it anyway because I am trying to solve the same issue and I can tell you it is not the solution for general barcode scanning.
It might work with pdf417 barcodes, but those are few and far between and I haven't been able to get it to work. I definately does not support any standard barcode formats. It also has no settings panel (in settings) and the tap target in the app that should be settings just take you to the company web site.
I am still testing other apps but haven't found any app that does what you ask, Red Laser used to but it no longer has that functionality.

send text code phonegap ios

I need to add a "share this app via text" button to my app. I am currently using Phonegap 3.3. I use this code
share via text
This works fine for Android, but on iOS devices it doesn't pass the subject or actual content of the message though.
No, it is not possible.
The sms scheme is used to launch the Messages app. The format for URLs
of this type is “sms:”, where is an optional parameter that specifies
the target phone number of the SMS message. This parameter can contain
the digits 0 through 9 and the plus (+), hyphen (-), and period (.)
characters. The URL string must not include any message text or other
information.
Answer was taken from this Link.
It is possible, if you make a phonegap plugin that in turn uses this Native API to get the result you are looking for:
Here's a tutorial that helps too:
http://iosdevelopertips.com/core-services/how-to-send-an-sms-progammatically.html

Resources