Tuesday, August 24, 2010

Write to Excel Cell with specified Colour using vb script

The function below can be used to write data to an Excel sheet.
The ReqColourIndex can be between to 1 to 56


Function WriteToExcelSheet(FileName,SheetName,RowNum,ColNum,DataToWrite,ReqColourIndex)



Dim ExcelApp,ExcelBook,RtnValue
RtnValue = False

If (Utilities.FileExists(FileName)) Then
Set ExcelApp = Sys.OleObject("Excel.Application")
ExcelApp.DisplayAlerts = False
Set ExcelBook = ExcelApp.Workbooks.Open(FileName)
Set sheet = ExcelBook.Sheets(SheetName)
sheet.Cells(RowNum,ColNum) = DataToWrite
sheet.Cells(RowNum,ColNum).Font.ColorIndex = ReqColourIndex
Call ExcelBook.SaveAs(FileName)
ExcelBook.close()
Set ExcelBook = Nothing
Set ExcelApp = Nothing
RtnValue = True
Else
Log.Error(FileName &" does not exist")
End If

WriteExcelSheet = RtnValue

End Function


//Example


sub TestWriteExcelSheet
call writeExcelSheet("C:\1.xls","Sheet1",2,3,"Routing passed",32)
End sub

Test Complete script to drag and drop an object (Vb Script)

This script can be used to drag and drop an object from one screen to another screen without using the coordinates.Everyobject has Left,Top ,width, ScreenLeft ,ScreenTop properties.

These properties can be used to achieve the drag and drop .

This was written with the help of Jay , AutomatedQA while trying to move an object from one screen to another
.
Sub DragAndDropItems(ReqObjectToMove,DestControl)
Dim XPos ,YPos ,dX ,dY
LogFolder = Log.CreateFolder("Draging and dropping item ")
Log.PushLogFolder(LogFolder)


XPos = ReqObjectToMove.Left+ReqObjectToMove.Width/2
YPos = ReqObjectToMove.Top+ReqObjectToMove.Height/2


dX = DestControl.ScreenLeft - ReqObjectToMove.ScreenLeft
dY = DestControl.ScreenTop - ReqObjectToMove.ScreenTop


Call ReqObjectToMove.Drag(XPos, YPos, dX, dY)
Log.PopLogFolder


End Sub
 
If your object does not have a Drag method ,alternative method is to drag an object to the desired position is to use LLPlayer to simulate the drag operation.

Sunday, August 22, 2010

How Scrum is being followed ?

Is Scrum being followed the way it should be in Companies?
 Well , The one word answer to this question is NO...


What's being followed then?
 Indian Service providers have their own process and they do false promise to their customers that they will follow scrum alone during the development. But behind the screen , the companies do follow some other process along with scrum to keep documentation intact and they do not show it to the customers.


What is the result of doing so?
 Well the answer is the companies keep telling that they follow XXXX process and keep their business alive back home and they are indeed kicking the client  who follows scrum alone. The client wants to improve their productivity by following scrum . This is just going to be a dream and dream. Well in some sprint the client can see 100% work done and in some other sprint the result goes down to <40 %. Then the scrum smells something bad and jumps into the retrospective meeting , where the developer tells some lame reason for not completing the task and the scrum master believes it most of the time. This is done by the developer to protect his job ...If he says that he is asked to follow some other process along with scrum , he will be kicked out  or the manager will say some XXX XXXX reasons during appraisal meeting and curb out his promotion and salary hike ....



How is Scrum being followed?
 In some companies , I feel that scrum is being followed exactly the way it should be. The entire team sits during the start up meeting and plans the thing for the whole sprint. That's Good and that's how it should be done.



In some Companies the On Site Team and the Off Shore team manager/ Team leader sits and estimate the sprint work. The the Off Shore team leader assigns the activity to the team member . This is how its done when you follow a water fall model....This is again not a scrum model.



 In some companies it is still worse ... The On site/Client estimates the sprint work and send it to the off shore team . The off shore team has no other option other than just banging the key board to write the code and deliver....I feel the scrum model is again being killed here...



How can it be done?
 I feel that some part of the existing process can be mixed with scrum to keep records of what is being done. If a company tries to implement their entire process with scrum , then I guess the productivity will never go up and the client will have to keep filling water to a pot which has invisible holes right at the bottom from where profit is being drunk by the offshore team ...



Good luck ...



These are just my opinions based on my experience...


Team Effort