Thursday, April 29, 2021

Automating the MS Dynamics CRM 365 testing and its Challenges with UFT and Test Complete Tools.

Automating the MS Dynamics CRM 365 testing and its Challenges with UFT and Test Complete Tools:

* Automating MS Dynamics CRM testing with Test Complete
https://www.youtube.com/watch?v=TqdhtgUum_Q
* Automation the CRM Dialogs and Workflows.
* Challenges - Object recognition
Problem : Silverlight, Ajax, flash/ Flex and HTML5 objects

Solution : TC's Smart name mapping can read the Silverlight,
ajax, Flash/Flex as well as HTML 5 Objects.


* ii Challenger - Large volumes of data
~ Problem CRM deals with large volume of data which need lot of maintenance activities
Solution : TC provide "Data generator" Options which supports
~ Database tables and queries
~ Excel files
~ CSV files



* Automation Testing of Dynamics 365 CRM using UFT Demo
* Automation the CRM Dialogs and Workflows.



* We can automate the MS dynamic crm365 with the default add-ins of Uft. Since it is a cloud web app. With few silverlight components and activeX objects in Crm?
I think you are right regarding the uft add-ins. I never did a full project on Ms Dynamics. But I have done a POC on it and not the most easy product to talk to me. You will need to build some custom functions for maybe the menu items and maybe some of the list objects for UFT to work. So just record playback is not going to work very well
Customer wanting to use UFT against Microsoft Dynamics. There is a side menu on the left that you have to cease properly as a web menu class but they are typically challenging to work with. Sometimes you may have to just use a click on a web element instead of navigating the menu Tree on the left.

* Where did you do this pic inside Citrix server, you have both uft and Ms dynamic 365 or you have your UFT installed inside the Ms dynamic 365 cloud server?
Yea, The browser is on your machine. The application is instead on the cloud.

* When it comes to Citrix both the application and browser are on the Citrix machine even though you see the browser on your local. That's why UFT will not recognize it.



* Automation Testing of Dynamics 365 CRM using Selenium Demo
https://www.youtube.com/watch?v=kjNpi1DG8zo


* CRM Application Cases | Login Case in Crm | Qtp Interview question
https://www.youtube.com/watch?v=EpU4hIDsEhw



Q1 What is MS Dynamic CRM?
Microsoft Dynamics CRM is a customer relationship management software developed by Microsoft. It is one of the popular CRM tools available in the market to enhance the customer relationship of any organization. Microsoft Dynamics CRM’s major features mainly focus on marketing, sales and customer service segments. The XRM platform of Microsoft Dynamics would allow multiple types of customization to this software.


q2 What is a plug-in?
A plugin is defined as a custom business logic that can be installed in Microsoft Dynamics CRM to make customizations or to enhance the standard behavior of the platform. Plugins help in handling various events and each plugin executes a specific event. In general, the Plug-ins are written in VB or C# can run an asynchronous or synchronous mode.


q3. What is workflow?
The main role of workflows is to automate the various simple and complex functionalities in CRM. There are two ways to create CRM functionalities: one is using out-of-the-box functionalities and the other is for automating complex functionalities by writing custom workflows using .NET code. Workflow processes can be run either in real-time or background.

In general, Workflows can be triggered based on specific events or conditions or events being done by the users. The Windows Workflow Foundation is internally used in CRM to implement workflows.


q4. Difference between WorkFlow and Dialogues?
Workflow refers to the Asynchronous process and requires no user input. It is a background process. Whereas dialogue works based on the asynchronous process and a user needs to give input.



q5 What is email router in MS D CRM?
E-mail router is a software application and creates an interface between Microsoft Dynamics CRM deployment and the organization’s messaging system. This component is needed to install and configure in the supported environment. After completion of the installation and configuration process of the E-mail, Router transfers the incoming emails to the Microsoft Dynamics platform and sends the outgoing message created by various users and systems.

Note : As an automation test we do automate the email status not the email subject and content and email in the inbox for now. Which is also automatable.


q6 List all components can be added to a solution?
Below mentioned is the list of components that can be added to a Solutions:

Article Template
Chart
Contract Template
Email Template
Entity Relationship
Field Security Profile
Mail Merge Template
Option Set
Process
SDK Message Processing Step
Service Endpoint
Web Resource
Business Rule
Connection Role
Dashboard
Entity
Field
Form
Message
Plug-in Assembly
Report
Security Role
Site Map


Q7 What is meant by managed properties?
Managed properties will help you in identifying the components of the managed solutions that can be customized. If you wish to apply managed properties then you need to include an entity using a managed solution and download it into another environment. These settings will give the power to Solution makers to restrict or impose restrictions on the users to make customizations. If you wish to set managed properties for an entity all you need to do is select the entity from the menu bar and click on the Managed Properties.


Q8.What are all new components that can be created from a solutions?
Following are the list of new components that can be collected from a solution:

Entity
Web Resources
Dashboards
Connection Roles
Templates (Mail merge, Email, contract, and Article)
Option sets
Processes
Reports
Security Roles
Field security profiles


Q9. What is a publisher in MS CRM?
In MS CRM each solution has a publisher. The publisher component works closely with data sources to track modifications over a specific time period. The Microsoft dynamics comes with a default publisher named with “Default Publisher for”. You can also have a chance to create a customized publisher for a solution.


Can MS Dynamics CRM 365 be automated through HPSoftware #QTP?

Yes, it is possible using QTP.

Recently I have automated Create account functionality in Microsoft Dynamic CRM using UFT (QTP 12) with default ad ins.


Why work with Syncfusion?
-------------------------
At Syncfusion, our mission is to produce world-class software components that enable developers to produce quality software for the most demanding environments. Our 100% C# components for Windows Forms, ASP.NET, ASP.NET MVC, Back Office, Silverlight, Business Intelligence, and WPF applications empower you to “deliver innovation with ease.”

Each of our products has a unique and useful feature set that developers find to be an indispensable part of their programming arsenal. Working with Syncfusion, you can quickly and easily add cutting-edge functionality and the very latest look and feel to your .NET applications. Using Syncfusion’s components also takes the grunt work out of the development cycle, freeing you to focus on the core business logic of your applications.

Built with the future in mind - Our products are geared toward long life-cycle applications and are architected to meet the highest standards for flexibility and long-term maintainability.
First-rate technical support - Our team’s 24x5 availability and online, phone, and forum-based support ensure you’ll get the answer you need, when you need it.
Full source code - We believe in empowering developers with source code; ours is written to be redistributed and shipped in a tightly integrated manner-use our components in debug mode at the “flick of a switch.”
Quicker resolution of support issues - With a source license installed, the complete call stack is available to your engineers and our support personnel. This can lead to a substantially better understanding of any issues that arise.
Better understanding of code/sequence, leading to fewer errors - Our components are designed to be extensible. Understanding the actual code flow when extending or plugging functionality into our components is valuable; with a source license, you can step directly into our code from within the IDE, just as you would your own code.
Access to debugging information, leading to improved productivity - When working with our components, you have access to debugging information, as afforded by the source code edition-invaluable in improving overall productivity.
Straightforward, flexible licensing - Syncfusion components are licensed on a per-developer basis with no royalties, run-times, or server-deployment fees. Each licensed developer may install on multiple personal machines at work and home.
A viable base for standardization - The wide range of solid products in our suites allows our customers to reduce their dependence on multiple vendors and streamline component use. For more information, go to the Standardization page.


* About Silverlight :
---------------------
Microsoft Silverlight is a deprecated application framework designed for writing and running rich web applications, similar to Adobe's own runtime, Adobe Flash. A plugin for Silverlight is still available for a very small number of browsers. It is a Freeware, Which work on Operating system: Microsoft Windows, macOS, and Symbian OS


10 Things You Should Know About Microsoft's Silverlight :
---------------------------------------------------------
1. Silverlight Avoids Cross-Browser/OS Issues

For most development teams, developing a website that will work identically with the popular browsers of the day (including Internet Explorer, Firefox, Safari and Opera) is a difficult proposition. The problem is not simply the necessity for multiple code implementations but also exponentially large testing sets. As a developer creates matrices of browser versions and operating systems, the number of test beds needed becomes enormous.


2. Silverlight 1.1 Is the Real Story
The recent Release Candidate of Silverlight 1.0 has many organizations considering whether they should start working with Silverlight. While Silverlight 1.0 has many important and interesting features, in reality most Silverlight adoption hangs on its anticipated 1.1 release.


3. Silverlight Uses Technologies Your Developers Already Know
Silverlight is built with existing Microsoft technologies: a mix of Windows Presentation Framework-like XAML (XML application markup language), JavaScript and .NET technologies.

The version of Silverlight you choose to introduce to a new project will likely depend on your development team's skill set. If your development team primarily does heavy ASP.NET server-side development (mostly C# and VB.NET), you should wait until Silverlight 1.1 is available. If your team is adept at client-side languages like JavaScript, Silverlight 1.0 is a great platform to introduce.

4. Silverlight UI Is just Markup...Like HTML

XAML is the Silverlight's Lingua Franca for user interface design.

5. Silverlight and Ajax Technologies Are Complementary

The Web is evolving. When the Web was new, back in the 1990s, everyone warned that developers should move as much as possible to the server so the application could scale. While this works well technically, it hampered the user experience. Now Ajax is all the rage. Simply put, Ajax writes code directly in the browser to enable better user interaction. The canonical example of this is Google maps (or Microsoft's Live maps, if you prefer).

6. Silverlight Allows Developers and Designers to Work Together
The Web has forced development teams to think more about design and aesthetics. Responsive user experience and intuitive interfaces have become the norm instead of the exception. This happens, usually, by involving artistic and user experience skills in application development. Today, that is accomplished by employing artists to come up with the design for a website.

For Silverlight, the primary design tool is Expression Blend, which allows creation of XAML in a way that is comfortable and familiar to designers. Using Blend is like Adobe Illustrator or Photoshop.

7. Silverlight Deliverables Are Not Atomic
Silverlight is delivered to a Web browser in pieces. This means the code is in one or more packages (JavaScript files, assemblies, etc.), the design is delivered as one or more packages (as XAML files), and other assets are separately delivered (including images, fonts and video). First-time Silverlight developers who are familiar with Flash's single-file deliverable may consider this a detraction to the Silverlight platform.

8. Silverlight Is New

As of this writing, Silverlight 1.0 is in a Release Candidate state and Silverlight 1.1 is in Alpha Release.

9. Silverlight XAML versus WPF XAML

It is easy to tout XAML as a great benefit because Microsoft's Windows Presentation Foundation (WPF) also uses XAML. Unfortunately, these benefits are not as compelling as it may seem, for two solid reasons: low WPF adoption and the differences between WPF XAML and Silverlight XAML.

10. Silverlight Is a Great Way to Learn XAML
Developers trying to learn XAML and to come up to speed on the technology will appreciate Silverlight as a way to create clear and concise code.


Ref: https://www.cio.com/article/2438290/10-things-you-should-know-about-microsoft-s-silverlight.html

~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* 

Dictionary Object in UFT \QTP \ Vbscript :

-----------------------------------------

‘Dictionary Object‘ in UFT/QTP. Note that, this is not something very QTP specific. Dictionary object was developed by Microsoft and is part of VB Scripting.


What is Dictionary Object? 

In Dictionary object is similar to a typical array. The difference between a dictionary object and an array is that there is a unique key associated with every item of dictionary object. This unique key can help you in calling that item as and whenever required.


What is the syntax and how can we use dictionary object?

Shown below is a typical script.


Dim dict ' Create a variable.

Set dict = CreateObject("Scripting.Dictionary")

dict.Add "Company", "HP" ' Adding keys and corresponding items.

dict.Add "Tool", "QuickTest Pro"

dict.Add "Website", "LearnQTP"

dict.Add "Country", "India"

dict is an object of class Scripting.Dictionary.


Company-HP

Tool-QuickTest Pro

Website-LearnQTP

Country-India

are key-item pairs that were added using Add method on dict object.


Other methods available for dictionary object are Exists Method, Items Method, Keys Method, Remove Method, RemoveAll Method


Using Exists Method to check whether the key Country exists?

If dict.Exists("Country") Then

msg = "Specified key exists."

Else

msg = "Specified key doesn't exist."

End If

Using Items and Keys method to retrieve ALL items and keys respectively from inside dictionary object.

i = dict.Items ' Get the items.

k = dict.Keys ' Get the keys.

For x = 0 To dict.Count-1 ' Iterate the array.

msgbox  i(x) & " :" & k(x)

Next

Using Remove method to remove Website – Learn QTP pair from the object.

dict.Remove("Website")

Using Remove all method to clear the dictionary


dict.RemoveAll ' Clear the dictionary.


* Count the number of occurrences of a character in a given string

How will you count the total number of occurrences of all characters in a given string?

So, if a string is Meenakshisundharam Manikam. The output should be M2 e2 n3 a5 k2 s2 h2 i2 u1 d1 r1 m2 1

Here is the solution using Dictionary approach


Dim InputStr, Str

'Input String Dynamic

'InputStr = InputBox("Enter a Input String for finding the number of Occurrence / Duplicate Characters in VB Script")


'Input String Static 

InputStr = "Meenakshisundharam Manikam"

'InputStr = "MeeNNNaaaaKKKKKssssssHHHHHHHiiiiiiii"

Str = InputStr


Call  FnCount(Str)


Function FnCount(Str)


Dim InputStr1, InputStr2, objDic, ChkDup, Cnt, i, d

Set d = CreateObject("Scripting.Dictionary")

For i = 1 to Len(Str)

temp = 0

'Check if the key already exists

If d.Exists(mid(Str,i,1)) Then

temp = d.Item(mid(Str,i,1)) 'Assign item to temp

temp = CInt(temp) + 1 'Since temp is string convert to integer

d.Item(mid(Str,i,1)) = temp 'Update the key

else

d.Add mid(Str,i,1), 1 'if key doesn't exist, add it

End If

Next


sCharacters = d.Keys ' Get the keys.

iOccurrence = d.Items ' Get the items.

For x = 0 To d.Count-1 ' Iterate the array.

'msgbox  sCharacters(x) & " :" & iOccurrence(x)

InputStr1 = sCharacters(x)&iOccurrence(x) &" "

InputStr2 = InputStr2 + InputStr1

Next

MsgBox InputStr2

End Function


Refer to : https://www.learnqtp.com/dictionary-object-qtp-use/

* What are the places where it can be used?

When you want to share data between different actions in a test, dictionary object can be used. To do this you should create a reserved test object for the Dictionary object. Here is a process to set up a reserved dictionary object. [Source]


Open Window’s registry by opening a Run window and entering regedit.

Navigate to HKEY_CURRENT_USERSoftwareMercury InteractiveQuickTest ProfessionalMicTestReservedObjects.

Create a new key (folder) named GlobalDictionary by right-clicking on the ReservedObjects key and selecting New -> Key.

Under the new key, create a String value named ProgID by right-clicking on GlobalDictionary and selecting New -> String Value.

Assign “Scripting.Dictionary” to the new ProgID string value by right-clicking on ProgID and selecting “Modify.”

If QTP window is already open you need to close and restart it.

Now to check whether dictionary object was installed successfully in registry, simple write GlobalDictionary. (don’t forget the dot) and you should see a drop-down containing all methods and properties associated with dictionary object.



GlobalDictionary : Methods are :

                   + Add

     - CompareMode

- Count 

                   + Exits

   + Item

     - Items

   + Key

     - keys

  - Remove 

  - RemoveAll                      

* Difference between dictionary and array in QTP

Here is the difference between Array and dictionary in QTP.

Below comparison illustrates when we should use array and dictionary.

-----------------------------------------------------------------------------------------------------------------------------------------------

Array Dictionary

-----------------------------------------------------------------------------------------------------------------------------------------------

1 We can have dynamic array We do not have concept called dynamic Dictionary.

2 Before use of array we must set the size of array      We do not need to set the size of dictionary.

3 Before adding extra element into dynamic array,           We do not need to write any statement to add extra element. We just use add method.

We have to use redim  statement

4 We do not have any method to release the memory, We can remove the element that is not required any longer.

if particular element is not required

-----------------------------------------------------------------------------------------------------------------------------------------------


* Dictionary object has many in built functions that help us add, remove, access the elements by unique key. 

That is why we must use dictionary over array.


~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* ~*~*~* 




Friday, April 23, 2021

Simple Solution 1 & 2 for finding the number of Characters Occurrence using VB Script

Simple Solution 1 & 2 for finding the number of Characters Occurrence using VB Script :

Please find the TWO solution Vbs Scripts hereby attached as text and  its result screenshot and details below.


' Simple Solution 1
CountStringSimple Solution 1.Vbs
We are using Dictionary object and  we provide the Static or Dynamic input as "Meenakshisundharam Manikam"
our 'Output : M2e2n3a5k2s2h2i2u1d1r1m2 1
Execution result as below: 
image.png

' Simple Solution 2

CountStringSimple Solution 2.Vbs
We are using Dictionary object and  we provide the Static or Dynamic input as "Meenakshisundharam Manikam"
our 'Output : M2e2n3a5k2s2h2i2u1d1r1m2 1

Execution result as below: 
image.png


Code 1: 
'Simple Solution 1
'############################################## Main Script Starts ###################################################
'# Script Name:-         Finding the number of Occurrence              #
'# Script Description:- Script is to find the number of Occurrence / Duplicate Characters using VB Script.    #
'# Input Parameters:-     Given String      #
'# Output Parameters:-     Ouput String          #
'# Script date:-           04222021            #
'# Script Modification date:-  04222021            #
'# Author:-               Sundar Manikam          #
'#####################################################################################################################

Dim InputStr
'Input String Dynamic
'InputStr = InputBox("Enter a Input String for finding the number of Occurrence / Duplicate Characters in VB Script")

'Input String Static
InputStr = "Meenakshisundharam Manikam"
'InputStr = "MeeNNNaaaaKKKKKssssssHHHHHHHiiiiiiii"


Call FunSimpleCount(InputStr)

'Output : M2e2n3a5k2s2h2i2u1d1r1m2 1
'Output : M1e2N3a4K5s6H7i8


'############################################## Main Script Starts Ends ##############################################






'############################################## Function Starts ######################################################
'# Function Name:-         FnCountSimple                #
'# Function Description:- Function for finding the number of Occurrence / Duplicate Characters using VB Script.#
'# Input Parameters:-     Given String      #
'# Output Parameters:-     Output String            #
'# Function date:-           04222021            #
'# Function Modification date:- 04222021            #
'# Author :-                     Sundar Manikam      #
'#####################################################################################################################
Function FunSimpleCount(InputStr)

Dim InputStr1, InputStr2, ChkDup,Cnt, i

Do While Len(InputStr) > 0

 ChkDup=Left(InputStr,1)
 Cnt = Len(InputStr) - Len(Replace(InputStr,ChkDup,""))
 InputStr = Replace(InputStr,ChkDup,"")
 InputStr1 = ChkDup&Cnt&" "
 InputStr2 = InputStr2 + InputStr1

Loop

MsgBox InputStr2

End Function


'############################################## Function Ends ######################################################

'Code 2 :
'Simple Solution 2
'############################################## Main Script Starts ###################################################
'# Script Name:-         Finding the number of Occurrence              #
'# Script Description:- Script is to find the number of Occurrence / Duplicate Characters using VB Script.    #
'# Input Parameters:-     Given String      #
'# Output Parameters:-     Ouput String          #
'# Script date:-           04222021            #
'# Script  Modification  date:-  04222021            #
'# Author:-                    Sundar Manikam      #
'#####################################################################################################################

Dim InputStr
'Input String Dynamic
'InputStr = InputBox("Enter a Input String for finding the number of Occurrence / Duplicate Characters in VB Script")

'Input String Static
InputStr = "Meenakshisundharam Manikam"
'InputStr = "MeeNNNaaaaKKKKKssssssHHHHHHHiiiiiiii"

Call  FnCount(InputStr)

'Output : M2e2n3a5k2s2h2i2u1d1r1m2 1
'Output : M1e2N3a4K5s6H7i8

'############################################## Main Script Starts Ends ##############################################






'############################################## Function Starts ######################################################
'# Function Name:-         FnCount                  #
'# Function Description:- Function for finding the number of Occurrence / Duplicate Characters using VB Script.#
'# Input Parameters:-     Given String      #
'# Output Parameters:-     Dictionary object      #
'# Function date:-           04222021            #
'# Function Modification date:- 04222021            #
'# Author:-                     Sundar Manikam      #
'#####################################################################################################################

Function FnCount(InputStr)

Dim InputStr1,InputStr2, objDic, ChkDup,Cnt, i
Set objDic = CreateObject("Scripting.Dictionary")

For i = 1 to Len(InputStr)
temp = 0
'Check if the key already exists
If objDic.Exists(mid(InputStr,i,1)) Then
temp = objDic.Item(mid(InputStr,i,1)) 'Assign item to temp
temp = CInt(temp) + 1 'Since temp is string convert to integer
objDic.Item(mid(InputStr,i,1)) = temp 'Update the key
else
objDic.Add mid(InputStr,i,1), 1 'if key doesn't exist, add it
End If
Next

'Print key-value pairs
sCharacters = objDic.Keys ' Get the keys.
iOccurrence = objDic.Items ' Get the items.
For x = 0 To objDic.Count-1 ' Iterate the array.
'msgbox  sCharacters(x) & " :" & iOccurrence(x)
InputStr1 = sCharacters(x)&iOccurrence(x) &" "
InputStr2 = InputStr2 + InputStr1
Next

MsgBox InputStr2

End Function

'############################################## Function Ends ######################################################


Thursday, April 15, 2021

How to write Classes in UFT and Build the Testing Framework. ( Developer Driven Framework)

How to write Classes in UFT and Build the Testing Framework. ( Developer Driven Framework) :

Class Code example

 This part goes in functional library

'-------------------------------------------------

Class mytestclass


Function func1()

  'code here

End Function


Function func2(x1, x2)

  'code here

            Msgbox (x1 & X2)

End Function


End Class

'--------------------------------------------------------



' This part goes in test action

'--------------------------------------

Set cobj = New mytestclass


cobj.func1


cobj.func2 (var1, var2)

'------------------------------------


How to write the Regfunction UFT Framework

How to write the Regfunction UFT Framework :

'*** CommonFunction Starts **************************************************************************************************************

'****************************************************************************************************************************************

' Common Subroutines/Functions contained in this library include:

'

' RegisterUserFunc:

'~~~~~~~~~~~~~~~~~~

' #1 NavigateBrowser   ~~~ Navigates to the given URL 

' #2 Delete_Browser_Cookies   ~~~ Deletes browser cookies for Chrome and IE

' #3 CloseBrowserTabOptional ~~~ Closes the given browser if input is positive (IsTrue)

'

' Functions: 

'~~~~~~~~~~~

' #1 OpenBrowser   ~~~ Opens the given browser to "about:blank"

' #2 SetBrowserZoomTo100          ~~~ Sets the browser zoom level to 100% to alleviate object recognition issues

' #3 CloseAllBrowsers   ~~~ Closes all the open browsers

' #3 CloseBrowserTab              ~~~ Closes a specified browser tab

'

'****************************************************************************************************************************************


'****************************************************************************************************************************************

' Function/Subroutine Name: OpenBrowser

'

' Revision history:

'   Description                                                           Change Code  Date        Author         

'   ---------------------------------------------------------------------------------  --------    --------------------

'   Opens the given browser to "about:blank"                                02/02/2019  Sundar Manikam

' Delete browser cookies if Environment("DeleteBrowserCookies") = True  CC01         02/01/2020  Sundar Manikam

' Assigne the Environment("BrowserName") ot standard values   CC02    09/26/2021  Sundar Manikam

'****************************************************************************************************************************************

'

'@Description Open the given browser


Sub OpenBrowser (browserName)

If browserName = "" Then

'ReportEvent "criticalfail", "No Browser designated. Please designate one of the following browsers:", "IE" & vbcrlf & "Chrome" & vbcrlf & "Firefox"

Exit Sub

End If

'WriteLogLine "OpenBrowser",browserName

Select Case Lcase(browserName)

Case "ie", "internet explorer", "iexplore.exe"

browserName = "iexplore.exe"

Environment("BrowserName") = "ie" 'CC02

Case "chrome", "chrome.exe", "ch"

browserName = "chrome.exe"

Environment("BrowserName") = "chrome" 'CC02

Case "firefox", "ff", "firefox.exe"

browserName = "firefox.exe"

Environment("BrowserName") = "firefox" 'CC02

Case "incognito"

Environment("BrowserName") = "incognito"

Case Else

browserName = "iexplore.exe"

Environment("BrowserName") = "ie" 'CC02

End Select

'Close all open browsers except ALM

CloseAllBrowsers()

If Environment("BrowserName") = "incognito" Then

Systemutil.Run  "chrome.exe", " -incognito about:blank", "", "", 3

Else

SystemUtil.Run browserName,"about:blank", "", "", 3

End If

'CC01 - Delete cookies if Environment("DeleteBrowserCookies") = True

If IsTrue(Environment("DeleteBrowserCookies")) Then

Environment("DeleteBrowserCookies") = False 'Reset Environment("DeleteBrowserCookies") = False

Browser("Creationtime:=0").Sync

Browser("Creationtime:=0").DeleteCookies "yes" 'delete cookies

'WebUtil.DeleteCookies

'OpenBrowser Browsername

End If

'Browser("Creationtime:=0").Sync

browserVersion = Browser("Creationtime:=0").GetROProperty("Version")

Environment("browserVersion") = browserVersion

Reportevent micDone, "Open Browser " & browserVersion, "Open Browser " & browserVersion

'ReportEvent micDone, "Browser Version: " & browserVersion, "Browser Version: " & browserVersion

'WriteLogLine "OpenBrowser","Browser Version: " & browserVersion


End Sub

'

'****************************************************************************************************************************************




'****************************************************************************************************************************************

' Function/sub-routine name: SetBrowserZoomTo100

'

' Revision history:

'   Description                                                                   Date          Author         

'   ----------------------------------------------------------------------------  --------      --------------------

' Called from the OpenBrowser function

'   Original Code                                                                 02/02/2019    Sundar Manikam

'   modified to clarify code and use common sendkeys Function                     01/02/2020    Sundar Manikam 

' Added condition for chrome and ff to set browser to 100% CC01   03/29/2020 Sundar Manikam

' Added condition for IE to set browser to 100% CC02   04/05/2020 Sundar Manikam

'*************************************************************************************************************************************

'

'@Description Sets browser zoom level to 100% for IE, Chrome, or Firefox. 


Sub setBrowserZoomTo100 ()


    Exit Sub

    'WriteLogLine "setBrowserZoomTo100",""

    If Environment("BrowserName") <> "ie" Then

    ctrlKey       = "^"

    zoomLevel_100 = "0"

    If Browser("micclass:=Browser").Exist(3) Then    

        SendKey ctrlKey & zoomLevel_100

    End If

ElseIf Environment("BrowserName") = "ie" Then

'Open the options list and check that "Zoom (100%)" is present, if not then reopen and select it

Browser("CreationTime:=0").Sync

Browser("CreationTime:=0").WinToolbar("Text:=Favorites and Tools Bar","nativeclass:=ToolbarWindow32").Press "Tools"

wait 1

If Browser("CreationTime:=0").WinMenu("menuobjtype:=3").GetItemProperty("<Item 3>", "Label") <> "Zoom (100%)" Then

Browser("CreationTime:=0").WinToolbar("Text:=Favorites and Tools Bar","nativeclass:=ToolbarWindow32").Press "Tools"

Browser("CreationTime:=0").WinMenu("menuobjtype:=3").Select "<Item 3>;100%"

End If

End If


End Sub ' SetBrowserZoomTo100 ()

'

'****************************************************************************************************************************************



'****************************************************************************************************************************************

' Function/Subroutine Name: NavigateBrowser


' Revision history:

'   Description                                                                   Date        Author         

'   ----------------------------------------------------------------------------  --------    --------------------

'   Navigates to the given URL                                 02/02/2019  Sundar Manikam

' Added step Sendkey "{TAB}" to get focus off the address field CC01   05/24/2020  Sundar Manikam

' Added call to Function setBrowserZoomTo100   3/29/2021   Sundar Manikam

'****************************************************************************************************************************************

'

'@Description Navigates to the given URL

Sub NavigateBrowser (objBrowser, URL)

If URL = "" Then

Exit Sub

End If

'WriteLogLine "NavigateBrowser",URL

On Error Resume Next

objBrowser.Navigate URL

Sendkey "{TAB}" 'CC01

If Err.Number <> 0 Then

ReportEvent micFail, "Navigating to " & URL & " Failed", Err.Description

Else

ReportEvent micDone, "Browser Navigation", URL

End If

setBrowserZoomTo100

End Sub


RegisterUserFunc "Browser", "Navigate", "NavigateBrowser"

'

'****************************************************************************************************************************************



'****************************************************************************************************************************************

' Function/Subroutine Name: DeleteBrowserCookies


' Revision history:

'   Description                                        Change #                   Date        Author         

'   ----------------------------------------------------------------------------  --------    --------------------

'   Deletes browser cookies for Chrome and IE               12/21/2020  Sundar Manikam

' added VBS code to delete IE cookies CC01   01/12/2021  Sundar Manikam

' 'Verify the Delete Browsing History window appears  CC02   01/28/2021  Sundar Manikam

' and activate it

'****************************************************************************************************************************************

'

'@Description Deletes browser cookies for Chrome and IE


Sub Delete_Browser_Cookies(objBrowser, YesNo)

If Not IsTrue(YesNo) Then

Exit Sub

End If

WebUtil.DeleteCookies 

'WriteLogLine "Delete_Browser_Cookies",YesNo

' browserType = objBrowser.GetROProperty("application version")

'

' objBrowser.highlight 'Make sure browser is in the foreground

' objBrowser.ClearCache

' 'Delete Chrome Cookies

' If InStr(1, browserType, "Chrome") > 0 Then

'

' Set oDelCookies = CreateObject("WScript.Shell")

' oDelCookies.SendKeys "^+{DELETE}" '^ for Ctrl key, + for Shift key

' wait 2

' oDelCookies.SendKeys "{TAB 8}" 'You need to tab 8 times to reach ClearBrowsingData button

' wait 1

' oDelCookies.SendKeys "{ENTER}"

' Set oDelCookies = Nothing

'

' ReportEvent micDone, "Deleted Chrome browser cookies", "Deleted Chrome browser cookies"

'

' CloseBrowserTab "Settings"

'

' 'CC01 - Delete IE Cookies

' ElseIf InStr(1, browserType, "internet") > 0 Then 

'

' Set oDelCookies = CreateObject("WScript.Shell")

' oDelCookies.SendKeys "^+{DELETE}" '^ for Ctrl key, + for Shift key

' wait 2

'

' 'CC02 - Verify the Delete Browsing History window appears and activate it

' If Not Browser("CreationTime:=0").Dialog("text:=Delete Browsing History","nativeclass:=#32770").exist(1) then

' ReportEvent micWarning, "Internet Options Failed to Appear", "Internet Options Failed to Appear"

' Exit Sub

' End If

'

' Browser("CreationTime:=0").Dialog("text:=Delete Browsing History","nativeclass:=#32770").Activate

'

' oDelCookies.SendKeys "+{TAB}"

' wait 2

' oDelCookies.SendKeys "{ENTER}"

' wait 2

'

'' Set WshShell = CreateObject("WScript.Shell") 'CC01

'' WshShell.run "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8"

''

'' 'To clear browsing cookies

'' WshShell.run "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255"'2"

' ReportEvent micDone, "Deleted Internet Explorer browser cookies", "Deleted Internet Explorer browser cookies"

' End If

'

' 'wait for cookies to be deleted

' Wait 5

End Sub


RegisterUserFunc "Browser", "DeleteCookies", "Delete_Browser_Cookies"

'

'****************************************************************************************************************************************



'****************************************************************************************************************************************

' Function/Subroutine Name: CloseAllBrowsers

'

'

' Revision history:

'   Description                                                                   Date        Author         

'   ----------------------------------------------------------------------------  --------    --------------------

'   Original Code                                                                 01/02/2019  Sundar Manikam

'   modified code to improve readability including variable names, fixed memory   02/02/2020  Sundar Manikam 

'     leaks, and changed reporting status to micInfo

' Added calls to HandleRandomErrors (False) CC01   06/22/2021  Sundar Manikam

'

'*************************************************************************************************************************************

'

'@Description Closes all instances of Internet Explorer


Function CloseAllBrowsers ()

    

    'WriteLogLine "CloseAllBrowsers",""

    

    ReportEvent micDone, "Closing All Browsers", "Closing All Browsers, except ALM (Application Lifecycle Management)"

    

    On Error Resume Next

    

    '-----------------------------------------------------------

    'Close the Browser Windows

    '-----------------------------------------------------------


    set browserDesc = Description.Create()

    

    browserDesc("micclass").Value = "Browser"

    

    set browsers = Desktop.ChildObjects(browserDesc)

    

    browsersCount = browsers.Count

    

    for i = 0 to browsersCount - 1

    

        sBrowserName = browsers(i).GetROProperty("Name")

        sBrowserTitle = browsers(i).GetROProperty("Title")

        'strCompleteBrowserName = browsers(i).GetROProperty("application version")

        

        If sBrowserName <> "" or sBrowserTitle <> "" Then

        

            isNotALMBrowser = (Instr(1, sBrowserName, "HP ALM") = 0)

            

            If isNotALMBrowser Then'Not(IsEmpty(sBrowserName)) Or Not(IsEmpty(sBrowserTitle)) And isNotALMBrowser then

            

                msg = "Close Browser " & sBrowserName

                

                ReportEvent micDone, msg, msg

                

               'browsers(i).highlight ' for dev/debugging

               'WriteLogLine "CloseAllBrowsers",sBrowserName & " " & sBrowserTitle

                browsers(i).Close

                

                Wait 2

                

                'CC01

                HandleRandomErrors (False)

                

                If Instr(1, sBrowserName, "Object reference not set to an instance of an object") > 0 Then

                    On Error GoTo 0

                    

                    set browserDesc = nothing

                    set browsers    = nothing

                    

                    Exit Function

                    

                End If ' Instr(1,sBrowserName,"Object reference not set to an instance of an object") > 0 Then

            End if ' Not(IsEmpty(sBrowserName)) And isNotALMBrowser then

        End If ' sBrowserName <> "" Then

        

    Next ' for i = 0 to browsersCount - 1


    set browserDesc = nothing

    set browsers    = nothing


    '-----------------------------------------------------------

    'Close the Browser Windows not recognized as Web Browsers

    '-----------------------------------------------------------


    Set windowDesc = Description.Create()

    

    windowDesc("micclass").Value    = "Window"

    windowDesc("nativeclass").Value = "IEFrame"

    


    set windows = Desktop.ChildObjects(windowDesc)

    

    browsersCount = windows.Count

    

    for i = 0 to browsersCount - 1

    

        sBrowserName = windows(i).GetROProperty("text")

    

        If sBrowserName <> "" Then

        

            If Not(IsEmpty(sBrowserName)) then

            

                isNotALMBrowser = (Instr(1, sBrowserName, "ALM") = 0)

                

                If isNotALMBrowser Then

                

                    ReportEvent micDone, "Close Browser", sBrowserName

                    windows(i).Close

                    'CC01

                    HandleRandomErrors (False)

                    

                End If ' isNotALMBrowser Then

            End If '  Not(IsEmpty(sBrowserName)) then

        End If ' sBrowserName <> "" Then

        

    Next 'for i = 0 to browsersCount - 1

    

    Set windowDesc = nothing

    

    On Error GoTo 0

    

End Function ' CloseAllBrowsers ()

'

'****************************************************************************************************************************************



'****************************************************************************************************************************************

' Function/Subroutine Name: CloseBrowserTab

'

' Revision history:

'   Description                                                                   Date        Author         

'   ----------------------------------------------------------------------------  --------    --------------------

'   Original Code                                                                 01/02/2019  Sundar Manikam

'   modified code to improve readability including variable names, fixed memory   02/02/2020  Sundar Manikam 

'     leaks, and changed reporting status to micInfo

'

'****************************************************************************************************************************************

'

'@Description Closes a specified instance of Internet Explorer based on the browser tab name.


Function CloseBrowserTab (browserTabName)


    If browserTabName = "" Then

        Exit Function

    End If

    

    'WriteLogLine "CloseBrowserTab",browserTabName

    

    set browserDesc = Description.Create()

    

    browserDesc("micclass").Value = "Browser"

    

    set browsers = Desktop.ChildObjects(browserDesc)

    

    browsersCount = browsers.Count

    

    for i = 0 to browsersCount - 1

    

        sBrowserName = browsers(i).GetROProperty("name")

        

        browserFound = Instr(sBrowserName, browserTabName)

        

        If browserFound Then

        

            msg = "Close Browser " & sBrowserName

                

            ReportEvent micInfo, msg, msg

            

            browsers(i).highlight

            browsers(i).Close

        else

            msg = "Browser """ & browserTabName & """ Not found."

            

            ReportEvent micWarning, msg, msg

        

        End If '  browserFound Then

    Next ' for i = 0 to browsersCount - 1

    

    set browserDesc = nothing

    set browsers    = nothing

    

End Function ' CloseBrowserTab (pBrowserName)

'

'****************************************************************************************************************************************



'****************************************************************************************************************************************

' Function/Subroutine Name: CloseBrowserTabOptional

'

' Revision history:

'   Description                                                                   Date        Author         

'   ----------------------------------------------------------------------------  ----------  --------------------

'   Optionally closes the browser based on input of YesNo                         01/02/2021  Sundar Manikam

'

'****************************************************************************************************************************************

'

'@Description Closes the browser based on input of YesNo.


Function CloseBrowserTabOptional (objBrowser,YesNo)


    If Not IsTrue(YesNo) Then

        Exit Function

    End If

    

    'WriteLogLine "CloseBrowserTabOptional",YesNo

    

    browserName = objBrowser.ToString

    

    If Not ObjectExist(objBrowser) Then

    ReportEvent micFail, browserName & " does not exist", browserName & " does not exist"

    Exit Function

    End If

    

    On Error Resume Next

    ObjBrowser.Close

    

    If Err.Number <> 0 Then

    ReportEvent micFail, "Failed to close the " & browserName,"Failed to close the " & browserName

    Else

    ReportEvent micDone, "Closed the " & browserName, "Closed the " & browserName

    End If

    

    On Error GoTo 0

    

End Function ' CloseBrowserTabOptional  (objBrowser,YesNo)


RegisterUserFunc "Browser", "CloseOptional", "CloseBrowserTabOptional"

'

'

'*** CommonFunction Ends ****************************************************************************************************************

'

'

'****************************************************************************************************************************************

'****************************************************************************************************************************************




1. Main Script Calls:

'~~~~~~~~~~~~~~~~~~~~


'*** Main Script Starts *****************************************************************************************************************

' Script History :

'****************************************************************************************************************************************

'

RunAction "UI Login [UI Login]", oneIteration

RunAction "Verify Account Overview [Verify Account Overview]", oneIteration

RunAction "Edit Account [Edit Account]", allIterations

'

'*** Main Script Ends *******************************************************************************************************************



2. Action Script Name: UI Login:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

'*** Action Script Starts ***************************************************************************************************************

'****************************************************************************************************************************************

' Action Name: UI Login '### NJPower Me Login

' Action Summary: Invokes the browser, enters the url for the NJPower customer website (https://sit.NJPower.me), 

'

' Action Details:

'   Invokes a browser

' navigates to the url

' selects a region (optional)

' Logs in (optional)

'

' Initial Condition: the NJPower.me website is closed

'

' End Condition: The NJPower.me website is open and optionally logged into

'

'  

' Revision history:

'   Description                                                               CC#  Date      Author         

'   ------------------------------------------------------------------------------- --------  --------------------

'   Original Code                                                                  01/02/19  Sundar Manikam

' Handle the Continue to Site link   CC01 02/28/19  Sundar Manikam

' 'Only select the region if it is different than the one already selected  CC02 03/12/19  Sundar Manikam

' Get the Environment from the UI Environment.xml file   CC03 04/04/19 Sundar Manikam

'   If login page already exist skip launch browser   CC05 05/08/19 Sundar Manikam

' Report the browser and environment the test is running in   CC06 05/12/19 Sundar Manikam

' Added Case "PAT" URL = "https://pat.NJPower.us/content/"     06/19/19 Sundar Manikam

'****************************************************************************************************************************************


'************ CC03 Get the Environment from the UI Environment.xml file *****************


'Begin CC04

'UI_Env = ImportRunTimeData("UI Environment","Environment")

'Environment("BrowserName") = ImportRunTimeData("UI Environment","BrowserName")


strLocalHostConfig = ImportRunTimeDataNew(testEnv, browserName)

StrSplit = Split(strLocalHostConfig, " ", -1, 1)

strTestEnv = StrSplit(0)

strBrowserName = StrSplit(1)


'Import the data file if environment is SIT

If LCase(strTestEnv) = "SIT" Then

Datatable.Import "\\nu.com\data\SharedData\Merger_Temp\Common\Projects\_Standards and Process\Automation\CommonUftAssets\SharedTestData\UI Input Data\" & strTestEnv & "\" & Environment("TestName") & ".xls"

End If


If Err.Number <> 0 Then

reportevent "criticalfail", "Error importing data file. Check the path and file name", Err.Description

End If


'CC06 - Report the browser and environment this test is running in

ReportEvent micInfo, "Execution Browser: " & strBrowserName, strBrowserName

ReportEvent micInfo, "Execution Environment: " & strTestEnv, strTestEnv


execute(getActionParameters ()) 


' Only execute the action if there is data in the local data table for the current iteration

If Not runThisAction Then

    ExitAction

End If


'--------------------------------------------------------------------------------------------------


msgHeader = "Begin Action: " & Environment("ActionName")

msgDetail = RowInformation


ReportEvent micInfo, msgHeader, msgDetail


'--------------------------------------------------------------------------------------------------

' Action/test/business process specific statements

'--------------------------------------------------------------------------------------------------



'If UI_Env <> "" Then

'Select Case LCase(UI_Env)

Select Case LCase(strTestEnv)

Case "tst"

URL = "https://tst.NJPower.xyz/"

Case "uat"

URL = "https://uat.NJPower.us/"

Case "SIT"

URL = "https://SIT.NJPower.me/content/"

Case "PAT"

URL = "https://pat.NJPower.us/content/"

Case Else

'ReportEvent "criticalfail", "Environment " & UI_Env & " Not Acceptable", "Possible Environments: TST, UAT, SIT Please check the MoveIn Environment xml file."

ReportEvent "criticalfail", "Environment " & strTestEnv & " Not Acceptable", "Possible Environments: TST, UAT, SIT Please check the UI Environment xml file."

End Select

'End If


'If BrowserName <> "" Then

' OpenBrowser Environment("BrowserName")

'End If

'End CC04



'CC05

If IsTrue(LoginPageAlreadyExist) Then

Browser("MyHome Origin").Page("MyHome Origin").WebEdit("User ID").Set UserID

Wait 1

Browser("MyHome Origin").Page("MyHome Origin").WebEdit("Password").Set Password

Browser("MyHome Origin").Page("MyHome Origin").WebButton("Log In").ClickOptional ClickLoginBtn

Else


OpenBrowser strBrowserName

Browser("MyHome Origin").Navigate URL

'Account for the SiteFinity page appears

If Browser("MyHome Origin").Page("MyHome Origin").Link("Continue").Exist(3) Then

If Browser("MyHome Origin").Page("MyHome Origin").Link("Continue").GetROProperty("visible") Then

Browser("MyHome Origin").Page("MyHome Origin").Link("Continue").Click

End If

End If

If Browser("MyHome Origin").Page("MyHome Origin").Link("Continue to Site").Exist(4) Then

Browser("MyHome Origin").Page("MyHome Origin").Link("Continue to Site").Click

End If

' verify the NJPower Login page loads

Browser("MyHome Origin").Page("MyHome Origin").Image("NJPower").VerifyPageExist PageNameDescription

'Select the region if it is already selected

If Region <> "" Then

regionSelectionVisible = Browser("MyHome Origin").Page("MyHome Origin").WebElement("select your region below").GetROProperty("visible")

If Not regionSelectionVisible Then

'CC02 - Only select the region if it is different than the one already selected

curRegion = Browser("MyHome Origin").Page("MyHome Origin").WebElement("CurrentServiceArea").GetROProperty("innertext")

If LCase(curRegion) <> LCase(Region) Then

Browser("MyHome Origin").Page("MyHome Origin").WebElement("CurrentServiceArea").Click

Browser("MyHome Origin").Page("MyHome Origin").WebElement("select your region below").WaitProperty "Visible",True,"30000"

End If

End If

End If

If Browser("MyHome Origin").Page("MyHome Origin").WebElement("select your region below").GetROProperty("visible") Then

Browser("MyHome Origin").Page("MyHome Origin").ClickLink Region

End If

'Respond "NO" to the Survey question

If Browser("MyHome Origin").Page("MyHome Origin").Image("invitation1").Exist (3) Then

Browser("MyHome Origin").Page("MyHome Origin").WebArea("no").ClickOptional Window("Internet Explorer").WinObject("Internet Explorer_Server"), "click"

End If

'CC01 - Handle the Continue to Site link

If Browser("MyHome Origin").Page("MyHome Origin").Link("Continue to Site").Exist(1) Then

Browser("MyHome Origin").Page("MyHome Origin").Link("Continue to Site").Click

End If 

Browser("MyHome Origin").Page("MyHome Origin").WebEdit("User ID").Set UserID

Wait 1

Browser("MyHome Origin").Page("MyHome Origin").WebEdit("Password").Set Password

Browser("MyHome Origin").Page("MyHome Origin").WebButton("Log In").ClickOptional ClickLoginBtn


End If



Browser("MyHome Origin").Page("MyHome Origin").VerifyMessages ExpMessages


If VerifyGoPaperless="" Then

If Browser("MyHome Origin").Page("MyHome Origin").WebElement("GoPaperless_Close").Exist(1) Then

Browser("MyHome Origin").Page("MyHome Origin").WebElement("GoPaperless_Close").click

End If

End If


Browser("MyHome Origin").Page("MyHome Origin").WebMenu("WebMenu").Select MenuItemSelect '"My Account"

Browser("MyHome Origin").Page("MyHome Origin").ClickLink LinkToClick


Browser("MyHome Origin").Page("MyHome Origin").VerifyMessages ExpMessages2



'*** Action Script Ends *****************************************************************************************************************


'****************************************************************************************************************************************

Convert Visual Basic Classes to DLL then Call them in UFT and Build the Testing Framework. ( Developer Driven Framework)

Convert Visual Basic Classes to DLL then Call them in UFT and Build the Testing Framework. ( Developer Driven Framework) :

 1. Convert all Classes to  DLL files in VB and  

2. Just call those DLL files in UFT/QTP and Build the Testing Framework  In  TestPlan and Test Suites in ALM Test Lab.


Sample as below :
 ~~~~~~~ * ~~~~~~~ * ~~~~~~~ * ~~~~~~~ * ~~~~~~~ * ~~~~~~~ * ~~~~~~~ *
1. We need to create DLL files in VB :
DLL files are dynamic-linked library files written and controlled with VB.
DLLs make sharing, storing, and saving your code simple.

~~~~~~~ * ~~~~~~~ * ~~~~~~~ * ~~~~~~~ * ~~~~~~~ * ~~~~~~~ * ~~~~~~~ *

2. How can the functions inside DLL be called from QTP?
This part is actually simple and a two step process…

Declare the method using Extern.Declare
Example
Extern.Declare micHwnd, “FindWindow”, “user32.dll”, “FindWindowA”, micString, micString
where:

micHwnd -the data type of value returned by method
FindWindow -the user supplied procedure name. You can set it to anything as long as it’s a valid syntax.
user32.dll -the DLL from where you wish to call the method
FindWindowA -The actual method name inside the DLL
Last two are the data types of the arguments that will be passed to the procedure
Call the method
Example:

Extern.FindWindow(“Notepad”, vbNullString)
To show the above process in action, here is an example to change the title of the Notepad window by calling the user32.dll

'Declare FindWindow method
 Extern.Declare micHwnd, "FindWindow", "user32.dll", "FindWindowA", micString, micString
 
 'Declare SetWindowText method
 Extern.Declare micLong, "SetWindowText", "user32.dll", "SetWindowTextA", micHwnd, micString
 
 'Get HWND of the Notepad window
 hwnd = Extern.FindWindow("Notepad", vbNullString)
 
 If hwnd = 0 then
 MsgBox "Notepad window not found"
 End if
 
 'Change the title of the notepad window
 res = Extern.SetWindowText(hwnd, "LearnQTP.com")
 
 Simple copy-paste the code above in your QTP ‘Expert View’. Open a blank notepad window. Run this code. You will now see that the name has changed from Untitled-Notepad to LearnQTP.com

3.  My Hybrid Framework Structure :
image.png