Switch webdriverIO between Desktop Browser and Mobile App - selenium-webdriver

I want automate a scenario which starts with Desktop chrome after performing certain action need to switch to Mobile app and validate the data in the Mobile App.
Currently Im using separate scenario to perform these test. Is it possible to load 2 driver in single session and switch at runtime ?
Using Webdriverio Typescript with Cucumber and Appium plugin for Mobile Automation

Related

Can we achieve testing of web application loading and content rendering in headless browser in test automation?

we have a requirement to test our web application through test automation using Selenium Webdriver
Validate web application is loaded completely or not
validate content is rendered or displayed without issues
Headless mode
My doubt is can we certify that web application is loaded and content rendered without issues?
in headed mode ? yes , but headless mode it browser will invoke without head
Can someone help me to understand and is it right way to do test automation?
currently I have implemented in head mode and certifying to achieve as expected
now the requirement is headless on CI .
Expectation: Is it right approach headless mode to test content render and web application loading?
Headless Browser
A Headless Browser is just like a regular web browser except that it doesn't have a a visible UI shell, so no tabs, URL bar, input fields, buttons, etc. It's just the website and nothing else as there’s no GUI to navigate. A Headless Browser can be controled through an automated script or manually through a command-line interface and you can still validate rendered contents without any issues.
tl; dr
Getting Started with Headless Chrome

Web Test framework for Mobile as well as Server browsers

Is there any framework available where I can write single set of test code for both Server browsers as well as Mobile browsers.
eg. test.py runs with Chrome on Android as well as Windows
I am planning to use browserstack for my testing until I figure out the infrastructure handling is possible with browserstack or not.
Please help me figure out a way for deciding over the infrastructure as well.
You can try TestCafe. It's an open source project.
TestCafe allows to run tests on desktop and mobile browsers without any additional installations and plugins.
Here you can see how easy to run tests on a mobile phone with TestCafe: https://twitter.com/DXTestCafe/status/804368394569052160.
Also it's easy to setup testing on mobile browsers in a cloud service (like BrowserStack or Saucelabs). For example you can find the "testcafe-browser-provider-saucelabs" plugin on GitHub to run tests on Saucelabs out-of-the box.
Selenium + Appium should be able to cover what you need to be done. To share code however, you'll need use a mobile browser (Chrome or Safari) or have an app that uses webviews that are the same as the browser version.
The Selenium bindings will handle driving the automation for the browsers. By itself, you could test the desktop browser with a normal size screen, as well as a mobile size, and test various browsers as well (Chrome, Firefox, etc).
Appium will allow you to open the browser (or app) on the mobile device or simulator, and if the web view is the same as the browser, the same locator strategies you used with the desktop browsers and Selenium will work with Appium as well (Appium extends the Selenium spec with browser capabilities).
If you code the framework using the Selenium Grid, you can then almost drop replace a remote managed grid setup (via Saucelabs or Browserstack) to run the browsers for you (otherwise you'd need to setup a local grid or run the tests with a local Selenium server set up)
All this is quite possible
framework available where I can write single set of test code for both Server browsers as well as Mobile browsers
We have build it in our company, since we have a vast diversity of different platforms and browsers to support.
We use combination of Selenium based frameworks on NodeJS
webdriverIO
cucumberJS
appium
... etc.
The main concept we try to follow is JAVA's WORA. To achieve all this you need a good understanding of DSLs, Application driver layer and design patterns (e.g. Strategy).
It is not that hard to put all this together, since Selenium supports pretty much every binding you need. Just pick the language you are most comfortable with and use it.

How to automate a Silverlight based web application using selenium?

I am trying to automate a web application using selenium, however that application is developed using Silverlight. Hence, i am not able to inspect the elements in the web page. Could anyone please suggest on how to tackle this problem?
Out of the box, selenium won't natively support testing a Silverlight-based web app. There is https://code.google.com/archive/p/silverlight-selenium/, but it doesn't look like that project is currently being maintained. Beyond that, Silverlight itself is not longer under development, and it won't run on recent versions of Chrome or Edge (or Android or iOS).

Same Ionic Framework interface for Mobile and non-mobile browsers?

I am working on 2 identical GUI: 1 for mobile (using Ionic), 1 for non-mobile. The non-mobile interface is responsive so it's already mobile-ready! So, 99% of the code is the same.
I develop the mobile part of the GUI in Ionic Framework (Angular). The non-mobile interface is using Angular only. I could simply merge the non-mobile site (Angular only) into the Ionic project. Then, I would only have ONE branch to maintain.
Knowing that we can use the command "ionic serve" to expose the Ionic Interface in the non-mobile browser, I am thinking to simply use the command "ionic serve" on the production server to expose the web interface of the ionic to non-mobile users. Is it a good practice? If not, what should I do to have 1 branch only?
Doing ionic serve is creating a webserver on your folder www
This will not perform many very usefull operation for production such as :
minification / offuscation
clearing comments
sass build etc...
Those tasks are for example triggered by grunt / gulp tasks or hooks into ionic build command if your properly configure it.
Therefore, I'd recommand you the two possibilities :
cordova platform add browser
This is the one I prefer, as you can take good advange of cordova hooks steps and use the same hooks for mobile & non mobile.
Copy your www folder and make your own build process
In both case, you'll have to perform some tests as ionic is developped and optimized for Android & iOS, which is not all mobiles (ex: windows phones ) and not browsers.
I remember on one project adding some spec class for browser and detecting if user uses browser or not for specific behaviours.

IBM Worklight - Using native pages in a mobile web application

In worklight we can use native pages in a Hybrid application. Similarly I want to use the native pages in a the Mobile Web environment.
Is there any possibility to do this?
Short answer: No.
Longer answer:
WL.NativePage.show is available, as the documentation states, for Android and iOS.
Mobile Web environment - a webpage that is served, loaded, displayed, ... in the device's mobile browser app.
Hybrid app - an app that is comprised of a native shell and a WebView inside it, allowing the ability to open a native page... you do not have that in a browser.
There is no such thing in mobile web. Mobile web is a web site and not an application. However, you can leverage url schemas supported in iOS/Android. e.g. create an app that will declare myapp:// schema support and then add a link to your mobile web site, e.g. myapp://doAction1?param1=someparam
The application will start and process the URL. You can get a lot of info about it on the internet, e.g. http://wiki.akosma.com/IPhone_URL_Schemes

Resources