Friday, May 11, 2018

Git Hub basics- Source control tool

Hey Folks,

Few updates on Source Control tool, which I recently learn, would like to share with you.

GitHub (originally known as Logical Awesome LLC)[3] is a web-based hosting service for version control using git. It is mostly used for computer code. It offers all of the distributed version control and source code management (SCM) functionality of Git as well as adding its own features. It provides access control and several collaboration features such as bug tracking, feature requests, task management, and wikis for every project (Reference taken from Wikipedia)
Repository-A repository is usually used to organize a single project. Repositories can contain folders and files, images, videos, spreadsheets, and data sets – anything your project needs. You can create public and private repository
Branch-
Branching is the way to work on different versions of a repository at one time.
By default your repository has one branch named master which is considered to be the definitive branch. We use branches to experiment and make edits before committing them to master.
Basic Git Commands
  1. git init- create new local repository
  2. git status-List the files you've changed and those you still need to add or commit
  3. git push origin master- Send changes to the master branch of your remote repository
  4. git commit -m "Commit message"-Commit changes to head (but not yet to the remote repository):
  5. git commit -a- Commit any files you've added with git add, and also commit any files you've changed since then
Steps
1. Login through git url
2. Start Project 
3. Create project and follow link
4. Install git on local machine
5. Create folder on c:
6. Type cmd on url and write git command
7. Change environment variable to your account and path %git_home%\bin
8. Again go to c: folder and write command cmd and git
9. Clone the project to url with ‘ git clone https://githubprojectpath/hit Project.git”
10. Enter username and password
11. Copy your local code to clone folder and follow git basic commands

Regards,
Trupti

Wednesday, November 1, 2017

Test Automation Estimation guidelines

Hi,

I found good article on below page.

https://www.stepinforum.org/Test_Automation/TA_finaltalk/PDFs/Papers/TEST%20AUTOMATION%20EFFORT%20ESTIMATION.pdf

Regards,
Trupti

Tuesday, October 31, 2017

Key design activities and component for framework

Folks,

Following are key design activities for create robust automation framework

1. Define standard project folder hierarchy
2. Define standard configuration and launcher script.
3. Design standard format for automation component
4. Define reusable modules to reduce development and maintenance cost
5. Define layered architecture of reusable modules
6. Design standard flow control module
7. Design standard data storage, loading, sharing mechanism
8. Define standard reporting mechanism
9. Design standard error or exception handling mechanism

Components
1. Controller
2. Reusable component
3. Event Handler
4. Reporter

Regards, Trupti 

Read, write and delete a key from windows system registry

Dim owshell, skeypath, Skeyval, skeytype
Skeypath= "hkey_current_user\mycustomekey\mycustomedata\myvalue"
Skeyval="this is UFT made registry"
Skeytype="reg_sz"

Set owshell= createobject("wscript.shell")
Owshell.RegWrite skeypath,Skeyval ,skeytype

Skeyval = owshell .RegRead(skeyPath)
Print Skeyval

Owshell .RegDelete skeypath
 'To run application
SApp="notepad.exe"
Owshell .run sApp
Set owshell = nothing

Delete Cookies

Cookies are files containing data that is used by websites to remember user preferences and other relevant information ,such as authentication credentials. In some cases, we may need to delete cookies in order to do following.
1. Test if a site detects that the cookies are missing
2. Test if a site responds accordingly to the browser's configuration for example it prompt for approval, and then stores the selection
3. Test if a site responds according to application requirements for example, prompts for login if an authentication cookie is missing.

Simple way to achieve cookie deletion as follow.

To delete all cookie
Webutil.deletecookies()

To delete specific cookie from a domain
Webutil.deletecookie(domain,cookie)

Monday, October 30, 2017

File Rename, invalid extension and modify file data using UFT

'Invalid file extension
Public Function fnFileInvalidExtn(strfolderSourcePath,strfolderdestnPath,strFile)
   
        Set FSO=CreateObject("Scripting.FileSystemObject")
        strfolderSourcePath_mod=strfolderSourcePath&"\"&strFile
        strTestFileName1=Split (strFile,".")
        strTestFileNameFir=strTestFileName1(0)
        strTestFileName_extn_chg=strTestFileNameFir&"."&"d"
        strfolderdestnPath_mod=strfolderdestnPath&"\"&strTestFileName_extn_chg
        FileEx=FSO.FileExists(strfolderSourcePath_mod)
   
        If FileEx=True Then
            FSO.MoveFile strfolderSourcePath_mod,strfolderdestnPath_mod
            Call fnDoneResult("File Extension changed is Sucessful","File is renamed to " & strfolderdestnPath)    
        else
            Call fnFailResult("File Extension changed is UnSucessful ","Unable to renamed file to " & strfolderdestnPath)
        End If
        fnFileInvalidExtn=strTestFileName_extn_chg
                               
End Function

'File Rename

Public Function fnFileRename(strfolderSourcePath,strfolderdestnPath,strFile)
        Set FSO=CreateObject("Scripting.FileSystemObject")
        strfolderSourcePath_mod=strfolderSourcePath&"\"&strFile
        strTestFileNamemsg=Split (strFile,".")
        strTestFileNameFir=strTestFileNamemsg(0)
        strNewTestFileName=Left(strTestFileNameFir,5)&"_"&"Data"& "_" & year(Date) & Right("00" & Month(Date),2) & Right("00" & Day(Date),2) & Right("00" & Hour(Time),2) & Right("00" & Minute(Time),2)  & Right("00" & Second(Time),2) & ".dat"
        strfolderdestnPath_mod=strfolderdestnPath&"\"&strNewTestFileName
        FileEx=FSO.FileExists(strfolderSourcePath_mod)
   
    If FileEx=True Then  
        FSO.MoveFile strfolderSourcePath_mod,strfolderdestnPath_mod
        Call fnDoneResult("File Rename is Sucessful","File is renamed to " & strfolderdestnPath)    
      else
        Call fnFailResult("File Rename is UnSucessful ","Unable to renamed file to " & strfolderdestnPath)
    End If
fnFileRename=strNewTestFileName  
End Function

'Function to modify the file data
Public Function fnModifyFile(strFilePath,strOrignalString, strmodifiedString)
Const ForReading = 1
Const ForWriting = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strFilePath, ForReading)
strText = objFile.ReadAll
objFile.Close
strNewText = Replace(strText, strOrignalString, strmodifiedString)
Set objFile = objFSO.OpenTextFile(strFilePath, ForWriting)
objFile.WriteLine strNewText
objFile.Close
End Function

Cute FTP connect, disconnect and file upload

'function to connect cute FTP
public function fnConnectCuteFTP(strHost,strUploadUserID,strUploadPwd)
Dim Flag
If Window("regexpwndtitle:=Globalscape","regexpwndclass:=Afx:").Exist Then
       Window("regexpwndtitle:=Globalscape","regexpwndclass:=Afx:").Close
    End If
Systemutil.Run "C:\Program Files (x86)\Globalscape\CuteFTP\cuteftppro.exe"
Wait (5)
Window("regexpwndtitle:=Globalscape","regexpwndclass:=Afx:").Dialog("regexpwndclass:=#32770","regexpwndtitle:=Tip of the Day").WinButton("regexpwndclass:=Button","regexpwndtitle:=&Close").Click
Wait(1)
Window("regexpwndtitle:=Globalscape","regexpwndclass:=Afx:").WinEdit("regexpwndclass:=Edit","attached text:=Host:").Type trim(strHost)
Wait(1)
Window("regexpwndtitle:=Globalscape","regexpwndclass:=Afx:").WinEdit("nativeclass:=Edit","attached text:=Username:").Set trim(strUploadUserID)
Wait(1)
Window("regexpwndtitle:=Globalscape","regexpwndclass:=Afx:").WinEdit("nativeclass:=Edit","attached text:=Password:").Set trim(strUploadPwd)
Wait(1)
Window("regexpwndtitle:=Globalscape","regexpwndclass:=Afx:").WinToolbar("regexpwndclass:=ToolbarWindow32","regexpwndtitle:=Quick Connect").Press 1
Wait (5)
If Window("regexpwndclass:=#32770","regexpwndtitle:=File Transfer Log").Exist Then
       Window("regexpwndclass:=#32770","regexpwndtitle:=File Transfer Log").Close
       Call fnFailResult("CuteFTP Connection Failure ","Unable to connect to CuteFTP")
Flag=False      
    Else
       Call fnDoneResult("CuteFTP Connection Sucessful ","CuteFTP connection is sucessful")
Flag=True      
    End If
    fnConnectCuteFTP=Flag
End function

Public function fnDisconnectCuteFTP()
If Window("regexpwndtitle:=Globalscape","regexpwndclass:=Afx:").Exist Then
       Window("regexpwndtitle:=Globalscape","regexpwndclass:=Afx:").Close
Call fnDoneResult("CuteFTP DisConnection","CuteFTP Disconnected sucessful")      
    Else
Call fnFailResult("CuteFTP is not launched","Unable to close as CuteFTP is not launched")  
    End If

End function

Public Function fnCuteFTPFileUpload(strFileSourcePath,strTestFileName)
Window("regexpwndtitle:=Globalscape","regexpwndclass:=Afx:").WinEdit("regexpwndclass:=Edit","window id:=132").Set trim(strFileSourcePath)
Window("regexpwndtitle:=Globalscape","regexpwndclass:=Afx:").WinEdit("regexpwndclass:=Edit","window id:=132").Type micReturn
Count=Window("regexpwndtitle:=Globalscape","regexpwndclass:=Afx:").WinListView("regexpwndclass:=SysListView32","window id:=1200").GetItemsCount
For i = 0 To Count
        FileName=Window("regexpwndtitle:=Globalscape","regexpwndclass:=Afx:").WinListView("regexpwndclass:=SysListView32","window id:=1200").GetItem(i)
        If FileName=trim(strTestFileName) Then
           Window("regexpwndtitle:=Globalscape","regexpwndclass:=Afx:").WinListView("regexpwndclass:=SysListView32","window id:=1200").Activate i
           Exit For
        End If
Next
Call fnDoneResult("CuteFTP Fileupload done","CuteFTP File upload sucessful")
End Function