Not able to inspect element in IOS webview on real devices - ios

I am using appium 1.8.0 with and launching webview from my app. For that webview In IOS I am not able to get the page source and not able to do any operation.
The same thing is working on android.
Do I have to do any steps to enable the IOS webview to get the page source?

The best suggestion could be to use something you are already familiar i.e. chrome dev tools which you have used for android webview inspection, same thing can be used for ios webview also
Install node module
npm install remotedebug-ios-webkit-adapter -g
Start the adapter at port 9000 - This will auto start "ios-webkit-debug-proxy" (Make sure this should be installed as a prerequisite on mac machine)
remotedebug_ios_webkit_adapter --port=9000
Open chrome and navigate to chrome://inspect and iOS targets will show up
More details here on the tools github readme file

Related

How to connect flutter to Bluestacks emulator?

I'm setting up an Android device for flutter development and need to have a lightweight emulator. How do I connect bluestacks to flutter? Since the android studio is too slow for my machine and I only have an iPhone.
Yes, You can connect Flutter to Bluestacks.
You have to enable adb on Bluestacks' configurations, by following:
gear icon > Advanced configs > (marks as true: enable ADB connection)
after that, you must to restart your bluestacks, then open a terminal and go to your Android SDK folder:
%localappdata%/Android/Sdk/platform-tools/
then type the follow commands:
adb connect localhost:5555
So, by now if you type flutter devices you will get the emulator device name on the list, then you can run your apps on it
In this case what I would like to suggest you is to download GenyMotion.
Is a very lightweight emulator and it has its own plugin for Android Studio.
I was on a similar situation with an AMD processor and this was a really helpful way for me to test my apps.
Here is the URL for download: http://cloud.geny.io/
Steps
Install the latest version(4.180.10.1006) of bluestack
Open the bluestack
Enable the adb by setting>preferences>tick "Enable Android Debug Bridge"
Open the cmd
Create a flutter project by typing "flutter create [projectName]"
Access to your project folder by typing "cd projectName"
Run flutter app by typing "flutter run"
How to enable adb over bluestack
Step1 - Click the setting(gear)
Step2- Click the preference
Step3 - Scroll Down to Enable Android Debug Bridge
Hello, I hope it's not too late for you - but:
You can use sublime text as editor and for running your app.
You can use command prompt (cmd) on windows and as an emulator, you can use Genymotion.
It will fit for you if you need a light editor along with a good emulator that does not take too much RAM space.
I have tested it, and it was running perfectly.
However, the problem were flutter packages for sublime text(coding helper).
I couldn't find any packages for sublime text, only dart. You can update the question for further information.
I hope you understand this and it will help you.

How to run Appium with an iOS app

How do you use Appium with iOS? I know this question seems ridiculously simple, but actually you'd be surprised. There is apparently no documentation online that explains how to do this, except for perhaps youtube videos, which I can't watch anyway because my workplace disallows it.
I have a Mac. I have an app that is loaded in Xcode. I have the Appium desktop app running.
What do I do now?
BTW, I am already very familiar with Appium, as I have created tests for the Android version of the app.
Steps
install homebrew: to install and update the required packages easily
install Node.js
install Appium
install libimobiledevice: required to run our tests on real
devices
install ios-deploy: required to deploy our apps to our devices
you also need WebDriverAgent: to opens the apps when it is downloaded to the device
Visit IOS Mobile Test Automation Using Appium and JAVA to learn how to install and run appium with an ios app. Hope this will help you.

How to run the AppBuilder to deploy a NativeScript application

I try to deploy my NativeScript application to my iOS device. I know there have been quite a few questions on this but I just can not get behind it.
What did I try to do?
I followed this tutorial:
http://docs.telerik.com/platform/appbuilder/nativescript/running-your-app/run-app-device
It tells me to install the AppBuilder - which I did (like mentioned here, where I am told to simply run sudo npm install appbuilder -g --unsafe-perm). Executing this (in my project directory) it installs the appbuilder with the following message:
Autocompletion is already enabled
/usr/local/lib
└── appbuilder#3.7.5
So far so good, so I ran appbuilder doctor
WARNING: Mono 3.12 or later is not installed or not configured properly.
You will not be able to work with Android devices in the device simulator or debug on connected Android devices.
To be able to work with Android in the device simulator and debug on connected Android devices,
download and install Mono 3.12 or later from http://www.mono-project.com/download/
When you file an issue, these warnings will help the AppBuilder team to investigate, identify, and resolve the report.
Please, ignore them if you are not experiencing any issues with AppBuilder.
I ignored this warning, since I do not want to deploy to android (yet). So I went ahead on the tutorial and it told me I had to use code-signing of iOS-Apps. On this side they tell me to meet the following prerequisites:
Verify that your preferred AppBuilder client is running and you are logged in.
Verify that you have opened the code for your app in AppBuilder.
Which is where I am already passing out. How do I run the AppBuilder? I thought that was just like NativeScript and I could access anything of it just via the Terminal (if necessary).

How to run Inspector when appium is installed using npm?

I used npm to install appium, but I don't know how to run the inspector.
I need to use the Inspector to locate elements in iOS.
How can I run inspector while using appium from terimnal and not from graphical app?
Appium inspector is not available for command line installation. Better download and install the UI version of appium which support the appium inspector for finding the element easily.
Also Appium inspector won't work in windows machine.
So you can do this by
Install npm (which you have already done
Install the Appium application (Slavo gave the link to Appium site answer)
go to developer settings in the app
Check "Use external appium package
enter in the location of your NPM install in text area.
When you do this the version of appium you installed via npm will be connected to the GUI application.
The gui does have its own version of the appium server, but it is an older version. That said it will still work, though it will be an old version and connecting the most recent version via an npm install and a gui download is the reccommended approach in the appium docs I think
Visit official Appium website
In the middle of the page there is big blue button with label Download Appium.
Download the client app to run the inspector, but before that you should run Appium doctor to check if all dependences were installed properly.
If you have downloaded appium using npm then you will run it through terminal by running "appium" command.
After starting appium server from terminal, open older graphical appium (install it first if you don't have it already). Don't press Launch button from gui. Press apple button and add capabilities there (platform version, device name etc) and press Inspector button.

Accessing iOS Safari Web Inspector from Windows Machine

New iOS 6 Safari comes with Web Inspector feature which allows to connect to it from your desktop Safari via USB cable. It then allows you to debug pages opened in iOS Safari from your desktop. But as far as I seen, this feature curently supported only on Mac Safari, not on Windows? Am I right, or Windows Safari also has the possibility? Or it will become available later maybe?
It appears to require Safari 6, which has not been released for Windows. Regarding the unavailability of Safari 6 on Windows, Apple has stated "Safari 6 is available for Mountain Lion and Lion. Safari 5 continues to be available for Windows."
I regularly use weinre. It basically runs a webserver that in turn acts as an inspector-enhanced proxy to browse webpages and websites. The inspector can be started by adding a script to your page or running a bookmarklet.
weinre is a debugger for web pages, like FireBug (for FireFox) and Web Inspector (for WebKit-based browsers), except it's designed to work remotely, and in particular, to allow you debug web pages on a mobile device such as a phone.
To install it, you will need NodeJS and NPM (included with NodeJS). You will also need a WebKit-based browser on the desktop/receiver end (Safari, Google Chrome, or Chromium). It should work on Windows, OSX, and Linux.
Official page: https://people.apache.org/~pmuellr/weinre/
Documentation & Getting Started: https://people.apache.org/~pmuellr/weinre/docs/latest/
NPM Package: https://www.npmjs.com/package/weinre
If you already have NodeJS and NPM installed, you can install and run it with:
npm i -g weinre
weinre
# Go to the URL that it outputs for instructions to use it
UPDATE:
#EvAlex has pointed out another tool very similar to Weinre called Vorlon.js. It is pluggable and supports viewing/switching between the inspector of multiple devices simultaneously.
Setup Vorlon on Windows
npm i -g vorlon
vorlon
Verify Vorlon is Running
Open a web browser and navigate to http://localhost:1337
Setup Ngrok
Download Ngrok: https://ngrok.com/download
Unzip it
Open a command prompt: Start -> Search -> cmd
Navigate to ngrok.exe: cd <ngrok_path_where_ngrok.exe is stored>/
Run it: ngrok.exe http <port> e.g. ngrok.exe http 1337
Ngrok provides a url e.g. https://0ad8c32f.ngrok.io -> localhost:1337
Copy and paste the ngrok url into your webpage.
<script src="https://0ad8c32f.ngrok.io/vorlon.js"></script>
Navigate to the page under test on your device(s):
http://thepageiwanttotest.com/testing123
References
Vorlon Reference: http://vorlonjs.com/#getting-started
Ngrok Reference: https://ngrok.com/download
Stumbled upon this blog which shows how to debug iOS web app on Windows using a stndalone app by Telerik called AppBuilder. You're supposed to create an account on their platform before using it and it has a 30 day trial.
I've used this on windows 7 64 bit for both vanilla web apps and Phonegap apps both on iPad with iOS 7.1, and it works. You get web development tools very similar to those in Chrome.
I have found a great tool called GapDebug
that's was the right solution for me :)
After trying to get Weinre installed on my Windows 10 machine which is running IIS and a localhost client and never being able to get it to work, I looked for an alternate solution.
Turns out Safari for Windows was discontinued by Apple but I was able to fine a copy after discovering the following link. Oh, the Web Inspector in Safari was able to help me find the problem in my application once it was installed.
https://apple.stackexchange.com/questions/68836/where-can-i-download-safari-for-windows
Once Safari was installed, I needed to turn on the developer tools. This required going into Preferences > Advanced > check "Show Develop menu in menu bar" > (click on page icon next to sprocket icon hover over Develop) Start Debugging in JavaScript. From here on it felt very much like Chrome...:-)
Use iOS WebKit debug proxy
It allows you to debug directly in Chrome with live preview.

Resources