Closing Smart App Banner in iOS Appium test - ios

I'm testing a website using Appium for iOS. The site has an associated app and uses Apple's Smart App Banners to promote the app. I'd like to test for the presence of the banner and close it at the beginning of my Appium test, but the banner doesn't appear to exist in the DOM. Is there any way to do this, short of mousing around with a pixel location?

Try to switch to native context:
driver.context("NATIVE_APP");
and check if it contains banner, for quick investigation you can print to console result of driver.getPageSource()

Related

Get arguments passed by Smart Banner iOS from flutter web safari

I have implement a simple code to my flutter web app:
https://developer.apple.com/documentation/webkit/promoting_apps_with_smart_app_banners
Now it shows a banner on top if app is installed or not.
If app is install it shows "Open" otherwise it shows "View" which takes to download.
Now the issue is as per the documents it says you can pass specific arguments if needed like this:
I want to know how do i check in flutter app if the app is opened from smart banner from safari and which app-argument was passed down on opening the app.
I am stuck on this issue for 3 days now.
Use native application(_:open:options:) method to get access to app-argument and Write custom platform-specific code to access it from Flutter or maybe use app_links plugin.

TBannerAd doesn't show ads

I've created a new App in Delphi 10.3.3 Community Edition, placed a TBannerAd, aligned it to bottom and I have a Button which loads the Ad (BannerAd1.AdUnitID:='ca-app-pub-XXXXXXXXXXXXXXXX/XXXXXXXXXX'; BannerAd1.LoadAd;). I tried The TBannerAd with the sizes "auto" and "small" but when I click the button on the running App no Ad is shown. Everything I do in my App works, but there are no ads shown. I used a Huawei ALE21 with stock rom (Anndroid 6) and a Samsung SM-A605FN/DS (A6 plus) also with stock rom to test the App. I tried test mode and normal mode, but in both cases there is no ad shown. I don't even get an error and I don't have any email from admob which tells me that it doesn't work... On my old computer (Same Delphi version and same mobile phones) I got ads to work. Now on a fresh installed Windows 10 with nothing more than Delphi and a few normal Apps I can't make an app with ads on it. And I don't use any ad blocking app on my phones. They're both stock rom.
Can anyone give me a hint why I can't display any ads without getting an error?
UPDATE: Google sent me an email a few days later saying my app code should change and the ads are not shown until my app fulfills requirements and some stuff like that.. so I guess the issue was I was trying just to show an ad to test ads are working and there was no real content in my app. After trying it a few weeks later in a real app I was trying to get ads shown in it it worked.. So sorry for asking this question. I just didnt know Google dooesnt show ads on blank apps..
Try setting the BannerAd's alignment to bottom and ensure that it has sufficient height. Start with the small size of Ad. Use the OnDidFail and OnDidLoad to debug. In my case I fixed the issue by the alignment and choosing small or medium size of Ad. Couldn't get the large or auto size to work so I am sticking with medium. Also, my BannerAd.TestMode is set to true as I am using the test ID provided by Google (I suppose you have done the same).
did you already set True on Project > Option > Application > Entitlement List > AdMob Service
I guess the simple answer is that there just are no ads to be shown available.. I get an error 3 code, which means the google ad server has nothing for me to show.. I think I should try other phones/accounts as well to get some ads running

How can I automate WiFi testing using Xcode Instruments?

I want to automate the UI flow on iOS, specifically below steps:
User taps on Settings
Opens WiFi options
Taps on the desired SSID
Enters Username and Password
Taps connect
Opens up a browser
I can do similar flow on Android with Android Debug Bridge. In Xcode Instruments, I don't see any WiFi options listed. Do we have any other tool to automate UI flow on iOS?
The standard is now to use UI Unit tests from XCode. Automation via instruments is deprecated (as far as I know).
However you can automate iOS itself, only the app you are testing. So accessing the settings like this will not work.
I'm also wondering why you need to test this. It's part of iOS and not your app. Therefore it's Apple's job to test it. You can just assume it works.
There is no way to do this on iOS. You may want to look into something like http://www.tapster.io.
Also ui_automation is remove from Xcode 8, so theres that.
I'm having pretty good luck with http://www.tapster.io

iOS custom smart app banner

I want to have custom view for smart app banner which I think is not possible. but I have seen it in wikipedia mobile site which is smaller than standard apple banner.
wikipedia shows custom banner on its mobile site only if wikipedia app is installed. if it is not installed or user uninstalls it then banner disappears.
Is there a way to achieve this kind of banners?
Are you talking about 'Open in app' banner? Those comes by default if you have supported for universal links in the app.
See screenshot:
For iOS6+, you can use Smart Banners: https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html
One of your requirement is to not show when the app is not installed (instead of promoting the app).
I do not know of a way to test for installation but I would look
url scheme: seems limited because the app will always open instead of
just being able to check if system can answer
cookies: can a cookie
be set from inside app that would be reused by safari when visiting
the same domain?
files: create a file from the app and try to open it
from safari

libGDX with MoPub (integrating AdMob) using RoboVM project for iOS

I am building a game using the latest (as of date) libGDX nightlies , RoboVM nightlies, and MoPub bindings that are available here. I used MoPub bindings to show AdMob ads, and I managed to show AdMob test ads on iPhone simulator; however, only test ads are shown on the simulator, and I have not specified any code to show test ads.
The question is: is this normal? is it always going to be test ads on simulator? will real ads show normally on devices?
Thank you.
Ahmad,
It is normal to see test ads once you have integrated. You should be able to see actual creatives from AdMob once the ad network is setup within your MoPub dashboard. It would take some refreshes to get the ads cached but then it would be serving to your simulator.
Another way to test the type of creatives that are coming in is to select ‘Test Ad’ in the Inventory tab over at mopub.com. In the Chrome browser, content may be blocked from being loaded. A shield icon in the address bar will appear. Click on the shield and then click on ‘Load unsafe script.’ Then click the ‘Run Again’ button.
You should be using your AdMob's 'Ad Unit ID' and not the 'Legacy Publisher ID.' I know it may be confusing as within MoPub's dashboard it mentions to have the 'Publisher ID' but really it should be the 'Ad Unit ID' from AdMob that should be entered.
Please consult this guide for more info: http://help.mopub.com/customer/portal/articles/1376821-how-to-set-up-updated-admob-revenue-reporting
Do you have marketplace feature enabled and seeing request/impression counts coming in?

Resources