Accessing elements of webview within a native iPhone app using UI Automation - ui-automation

I am working on UI test automation using Apple's UIAutomation framework for a native iPhone app that uses web views for its checkout transactions. The problem I am facing is that when I tap on Checkout button from the native app, a webview within the app opens up which has a button named 'Complete Checkout' that I am not able to access. I have tried using target.logElemenTree() to get the elements of the WebView, but I do not get to see anything in Instruments. Can anybody let me know how to access webview elements within the native app on iOS?

You can get the X,Y coordinates of the Complete Checkout button and have UI Automation tap it. For example, if the X,Y coordinates of the button are x:10, y:20 you would run target.tap({x:10, y:20});

If your checkout button is a link inside a webview then you will be able to access it.
check the property of the "complete checkout". Tapping using X and Y co-ordinates is not a recommended option.

Related

How to use Flutter to implement a button like ios virtual home button

I want to create a button can move to any position like iPhone Style (Virtual Home Button) in Flutter but I don't know any packages or any library can do it. Moreover, I'd like the button to be able to show along with a specific app, eg. dial-up UI. If I deploy to desktop, will its behavior the same with mobile?
ios virtual home button
show button along with dial-up UI
Hope you guys help me ways to create it.
I have tried with unicorndial, floating_bubble, popup window, etc.
but all of them are widget within flutter app, instead of system-wide.
Sorry you can't really create anything like that outside of your App context. Apple is very strict in situations like this.
You can implement this sort of feature in Android by using Floating Service. But for Apple it's a NO NO.

Instruments UI Automation tests for iPhone app

I'm a newbie in UI Automation using instruments and I have the following question:
- the application starts and I get the mainWindow screen (which contains SignIn and Register buttons)
- I've managed to write the JavaScript code in order to tap one of the two buttons.
-> after tapping one of the buttons, another screen is displayed. let's say the Sign In screen which contains two fields: username and password.
In this case, how can I tell Instruments that this is another screen and this contains another elements that should be retrieved in order to fill the fields and tap the Sign In button ?
I only know to retrieve the mainWindow. I don't know how to write the code for a next screen
Did you try to capture what you do with the small record button in the Javascript editor window? That way you can find out how Instruments can call the elements you use.
See also this thread:
UI Automation - how to capture - record using javascript editor

Run the existing iPhone app in background from JSP page inside an UIWebView

I have a button in JSP page inside an UIWebView by pressing the button i want to run another
existing iPhone native application in background only.Do anyone have a solution for this.
You can't start any apps programatically. The only exception is if the desired app supports URL schemes. (see docs)
But it is not possible to launch it in background only.

Link Target in iPhone Based web app

I am building a web application that is to be run by adding the app to the home screen. Currently it has a list of users, clicking on a user takes you to a detail screen for that user and on that screen is a notes link to take the user to another screen with a grid of notes and a text box to add more notes.
When any links are clicked/tapped, the link is opened in Safari, not the current full screen Safari instance. I tried setting the target of the link to _self, but this had no effect.
Any ideas?
I learned a full screen iPhone webapp can only be a single web page. Any link you try to open will launch Safari instead of replacing the current page. To combat this, I used asp.net postbacks with panels to hide/load/show requested data.
I use target="_webapp" and it works just use for example <a href="http://your.link" target="_webapp"> and it gonna open the link without exit landscape (full screen) i dont know why but with some of my webapps works and sometimes dont.

how do you pop up the Save Image/Open in New Page/Copy menu on command in mobile safari?

I need to find out how to make the menu that appears in mobile safari on the iphone/touch when you tap & hold an element appear on a single tap without having to hold. how would i do this? preferably i would use webkit & no js.
UIWebView does not does not call any methods until a link is actually activated, and it does not expose any information about its subviews. There is no way to do with current SDK, you should file a bug with Apple if you need this functionality.