Inspecting the WebView element using the Chrome browser is the easiest and most efficient way. So in this blog, I am going to explain how to inspect the WebView element using the chrome browser. Let’s first understand what WebView is and why to use it.
What Is A WebView?
It is widely used to display web pages in an application. The web pages and web apps can reuse in an Android application. The content used to display inside a WebView is responsive and mobile-friendly and because of this, it works better towards providing a better user experience.
Now let’s see how to inspect elements on Android WebView
1) The first step is you need to connect your mobile device to your system.
2) The second step is you need to go to your chrome browser and go to chrome://chrome-urls/ then you will see the result like the below screenshot:
3) You need to select “chrome://inspect/” from that list.
4) Click on it and it will open a window like this. There is an option to discover USB devices in it. It will display information about the devices that are currently attached to the system.
5) Now launch the app on your mobile device, and for inspecting the element just click on inspect.
This will open a new chrome window containing all the UI details of that screen.
Now you can inspect the elements for the webview app like you inspect for the website. By following these steps you will get a better understanding of how you can inspect a webview using a chrome browser and how you can locate your desired elements.
Below is the link for your reference to inspect webViews and get locators.
Manisha is a Lead SDET at SpurQLabs with overall experience of 3.5 years in UI Test Automation, Mobile test Automation, Manual testing, database testing, API testing and CI/CD. Proven expertise in creating and maintaining test automation frameworks for Mobile, Web and Rest API in Java, C#, Python and JavaScript.
One day my colleague David was working on a task to migrate a repository from one platform to another while he was doing that the server crashed, the platform went down and all the data, code, and documentation available on the repository was lost. Have you ever imagined yourself in David’s Situation, What if this happens to you? Wondering what solution you can use instead of manual efforts?
You’re not alone.
We faced the same problem and found one of the best automation solutions that will work on all the platforms.
Problem:
We want to protect our source code repositories at any cost. It contains all of our code, documentation, and work history.
The real nightmare comes when you don’t have a backup. We all know that taking frequent backups manually is a tedious process.
So how can we do that through automation?
Solution:
There are many solutions to that. We have used this solution because it is based on bash script and works on all the platforms like Azure DevOps, Gitlab, and Bitbucket.
We are copying the Azure DevOps repository to GitHub. But as we said we can use this solution on every platform.
First, log in to your GitHub account and create a GitHub repository. (If you don’t have it already)
You have to generate a Personal access token at GitHub.
Settings -> Developer Settings -> Personal Access tokens
Generate and copy the token value. (refer to the following screenshot)
3. Navigate to your Azure repository. And create a pipeline there.
4. Add the following bash script task to the pipeline.
What will this script do?
This script will override the branch code of GitHub. In simple words, if you want to copy code from the feature branch of Azure to GitHub then:
In GitHub – If the feature branch is present, it will override the code.
In GitHub – if the feature branch is not present, then the branch will be created.
If your branch (in Azure) is master then no need to change but if your branch is main then you should replace the “master” with “main”.
Be Careful:
If you already have a repository (With Code) in GitHub, then instead of main or master use the feature branch in Azure. And then raised PR to the main branch.
And if you want to update code from the main branch from Azure to the main branch from GitHub then no worries. You are good to go. (It will override main branch code, if not there then will create a new one.).
You can trigger your pipeline according to your requirements.
If you want to schedule it on a daily, weekly, or monthly basis then you can use the “schedule”&”cron” options in the pipeline.
Below is the link for your reference to schedule the pipeline
By profession a DevOps Engineer having hands-on experience in GitHub, Azure DevOps, AWS, CICD, Docker, Kubernetis and Server monitoring tools like ELK stack and Grafana. On the side I like doing Performance Testing with Jmeter and Security Testing with BurpSuite and ZAP Proxy. I also happen to be a certified X-ray Expert.
Today, almost all mobile devices support biometric authentication, such as Touch ID/Fingerprint Sensors and Face ID. Using the Browser Stack Android/iOS testing platform, developers can test their mobile applications using biometric authentication. In Automating biometric authentication on iOS using BrowserStack users can be authenticated using biometrics.
Note – This feature is currently not available for Android devices.
My application uses biometric authentication when it relaunches (relaunching means that the user is logged in and the app is closed from the background). Let’s look at a practical example.
How to check biometric authentication:
You can check Biometric authentication in an App Automate session by following these steps:
A browser Stack Appium session can be enabled with Biometrics by using the following Browserstack Appium capability: BrowserStack.enable biometric:”true”
As shown below, this capability ensures that your app passes through Sensor Instrumentation.
By using the ‘before scenario’ context in the ‘environment.py’ file, this Python code creates the desired capability. As a result of using this capability, we get the following screen when it is executed.
How to interact with the Biometric authentication dialog:
Using the custom executor, you can manipulate the Automating biometric authentication on iOS using BrowserStack dialog box.
Following are the complete scenario and required steps with the page file code.
Scenario: User Login by biometric after app relaunch
Given User is on "Welcome" page
And User does Login with "Username" and "Password"
When User creates security pin for "Username"
# creates security step depends on application
And User closes app and relaunch the app
Then User clicks "Pass" on biometric alert screen
#Then User clicks "Fail" on biometric alert screen
Step definition file –
@then('I click "{option}" on biometric alert screen')
def step_impl(context,option):
context.signIn.clickon_pass(option)
Note: – There are two options here ‘Pass’ or ‘Fail’
The application opens when the user clicks ‘Pass’ on the authentication alert screen.
If you click “Fail” on the authentication alert screen, the application will request that you re-login with your forgotten pin or security pin instead of biometric information.
This feature supports native apps & apps built with cross-platform frameworks such as React Native, Flutter, etc. The BrowserStack Biometric feature supports Biometric APIs. only if the app uses one of the supported Biometric APIs. A biometric API can be used with the approval of the app development team on Android and iOS.
Conclusion:
The BrowserStack platform with Appium capabilities allows developers and testers to test mobile applications with Biometric Authentication.
Gajashree is working as SDET from last 2 years with us. Having experience in Web, Mobile, API Manual and Automation testing. Having hands-on experience in selenium, BDD with java, python & tools- Appium, BrowserStack as well as web designing.
This blog will explore how to automate office 365 login in cypress using Nightwatch.js. Currently, I’m working on Cypress automation for testing web applications.
First, let’s understand the problem area.
We needed to automate the login flow in an application using office 365’s IDP. When we launched the application through cypress, we landed on the office 365 login screen which was not possible to automate. We were not able to have control over the page through cypress. Cypress has some other techniques to automate this like SSO(single-sign-on) However, our clients were not able to share some secrets and also the Azure DevOps environment.
So far nothing worked for us, So now let’s come to the point.
In order to automate office 365 login in cypress using Nightwatch.js. I thought we could use other tools to get the JWT token that we can use to log into an application through Cypress.
Now, the question was which tools to be selected.
I selected Nightwach.js tools because it was easy to use with little configuration. We successfully automated office 365 login. Get the JWT token from local storage and write it in common utility files.
Again the question was how to trigger the Nightwatch.js script through cypress.
Cypress supports cy. exec command runs the Nightwatch.js script and then control comes back to cypress and the rest execution is done.
Now let us try the recipe, First install nightwatch.js with the following command, Copy
npm install nightwatch
And also need to install the chrome driver with the following command, Copy
The output is that a new JWT token is generated and that the JWT token is used to run cypress test cases.
Conclusion :
Different automation tools can be integrated with Cypress where Cypress lacks the ability to do so. In the previous version of Cypress, multi-domain origins were not supported, so we automated this scenario through Nightwatch.js.
By profession an Automation Test Engineer, Having 3+year experience in Manual and automation testing. Having hands-on experience in Cypress with JavaScript, NodeJS. Designed automation web framework in Cypress, Webdriver.io, Selenium with jest in JavaScript. He loves to explore and learn new tools and technologies.