How to access Webview in appium python for iOS hybrid apps - ios

Tried with
handle = self.driver.window_handles[0]
self.driver.switch_to_window(handle)
on emulator, but no luck. I am not able to access / manipulate the elements in the page. I don't even know if i got switched to web view.
Any suggestions on how to use web views on iOS with appium (python) ?

driver.window_handles[0]is probably the current window - try inspecting window_handles to see what other windows are available. On iOS, the app that I test just has window handles like '1', '2', etc, and switching to the last element of window_handles usually does the trick.

Please use the below code to switch to WebView , if you are using appium 1.0
self.driver.switch_to.context('WEBVIEW');

Related

Codeceptjs swipe function

Im just working with codeceptjs and using appium driver for testing android application.
Now i have different issues with this framework. Im currently working for a test, where i have to use swipeLeft, but it isnt working, there is nothing happen when that function is calling, also swipe, swipeRight, swipeUp, swipeDown. Has anyone already solved this problem or can i use alternatively a back() function or something?
Use the following syntax to make your code work:
I.executeScript('mobile: swipe', {direction: 'left'});
Have you consider Touch Perform (or Action) ? It is working for me
I have used webdriverio and it seems like Codeceptjs have similarities with their implementations of appium methods for mobile automation.
Are you testing using Android or iOS device?
Have you tried using different method overrides for Swipes?
On my experience, iOS and Android have different Speed and Offset settings you need to adjust the values until you get the swipe action working.
And of course you need to make sure you are selecting the appropriate View/Slider/Element that is scrollable, otherwise swipe will fail.
https://codecept.io/helpers/Appium

Form behaving differently on phone than in resized browser. How do I replicate this?

I coded a simple form, tested it on my pc in different browsers and browser sizes and it worked fine. When I open the page in my phone's browser (iPhone 6, Safari) the form behaves differently.
How do I replicate this behaviour in my browser so I can debug and fix the issue? I don't know why for example the label 'verende zadelpen' is behaving this way, but I need to fix it.
example of what's happening
Is there a way to replicate exactly this, in my browser?
I don't know any other way to check what classes are causing this.
If you're using chrome (im not sure on windows keys) but for mac you can press cmd, alt, I and it will show you mobile versions. For safari you can use: cmd, alt R.

to hide the block the desktop during my startup program launch

i am develop a application based on log in and log out for my students. when my user logged in, the start up application will be load. during the start up!
My Question : all my desktop icon and other application should be disabled when my start up application load.Any one suggested me i really owe to you guys.
What language are you using? Here is an example of C#:
How to hide desktop icons programatically?
anyway you can use the windows API with C# or C++ don't know about java. Try and see if it works.

Web service call missing field value xamarin IOS

I'm having a web reference which is being used by both a Xamarin IOS application, Xamaring Android application, and a Windows Store application.
And this all worked very well, until I updated Xamarin.
Now, there is a field that But it works fine for the Android and Windows applications.
I have tried to update the web reference multiple times, with no luck. I have also tried to debug the web service locally, to see if it returns the same , which it does.
When I receive it in my Windows Store app., it looks like this:
And in my IOS app., it looks like this:
It is always the StructureId that is never set, for some reason. And it was not like that before I updated Xamarin.
Anyone who knows what I am doing wrong, or have stumbled onto the same kind of problem ?
That looks like the linker removed unused members. Defaults have not changed (it's not related to your update) but you should check that your application is being built with Link SDK (and not Link all).
If you want a smaller executable and set Link all to achieve this then you'll need to add [Preserve] attributes on the structure you're serializing (e.g. used in web services).
I was able to make it work. I am not sure if it cached anything, or what, but it helped to add some "noise" on the webservice call.
I just added DateTime.Now.Ticks to my webservice URL in Reference.cs, so it would always be a new URL call:
this.Url = "http://somewebsitename.com/ReportService/ReportService.asmx?v=" + DateTime.Now.Ticks;

"Rubber band" events on phonegap app

I'm working on an iOS app using Phonegap/ Cordova and jQuery Mobile.
I want to be able to refresh the data when the user pulls the page down (rubber band effect). I tried using iScroll 4 but it made scrolling my page slow.
I didn't find a phonegap plugin for this. I thought this was a pretty standard iOS feature so maybe I am missing something? Is there any easy way to listen to the pull down event using phonegap / cordova?
Thanks!
Adding this line into CDVViewController.m (Cordova 2.0 or later) is said to work but I've actually never tried it myself as I'm still using iScroll 4. Give it a shot and let me know how it worked for you.
[webView.scrollView setDecelerationRate:UIScrollViewDecelerationRateNormal];
Likewise, however somewhat irrelevant to this matter, the code snippet below is said to reduce the on click delay from 300 ms which is also something phonegap developers usually want. Neither this nor the line above has been properly tested but perhaps a good way to start off.
[webView.scrollView setDelaysContentTouches:NO];

Resources