Inspecting Webview App Element using Chrome Extension

Inspecting Webview App Element using Chrome Extension

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.

http://www.qaautomationsimplified.com/android/android-automation-how-to-inspect-webviews-and-get-locators/

Conclusion:

According to my experience, this is the most effective and easier way to inspect WebView elements using the chrome browser.

Read more blogs here

How to set an automatic backup of your source code repository?

How to set an automatic backup of your source code repository?

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.

  1. First, log in to your GitHub account and create a GitHub repository. (If you don’t have it already)
  2. 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)

C:\Users\Uddhav\Desktop\Blogs\A2G\Untitled.png

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:

  1. In GitHub – If the feature branch is present, it will override the code.
  2. In GitHub – if the feature branch is not present, then the branch will be created.
bash: |
git push -- \
Prune //ghp_iYwH9mwvmWVAFCD@github.com/SpurQLabs/SpurQLabsProject \
+refs/remotes/origin/master:refs/heads/master +refs/tags/:refs/tags/
displayName: 'Copy to GitHub'
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
Note:

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

https://docs.microsoft.com/en-us/azure/devops/pipelines/process/scheduled-triggers?view=azure-devops&tabs=yaml

Run your pipeline.

  And Done and Dusted..!

#Azure-pipeline.yml for reference

#Azure-pipeline.yml for reference
trigger:
- DemoSync #your feature Branch, Run this pipeline from your feature branch.
pool:
  vmImage: ubuntu-latest
steps:
- checkout: self
- bash: |
    git push --prune https://ghp_cbvnn@github.com/SpurQLabs/SpurQLabsProject \
    +refs/remotes/origin/DemoSync:refs/heads/DemoSync +refs/tags/*:refs/tags/*
  displayName: 'Copy to GitHub'
  condition: eq(variables['Build.SourceBranch'], 'refs/heads/DemoSync')

Conclusion

This is how the source code is migrated from azure repositories to GitHub repositories automatically after every check-in/PR merge.

As mentioned above, you can schedule it daily, Weekly, or monthly.

Read more blogs here