Monday, August 29, 2011

20 Essential Addons for Fire fox

Hey guys,

If you are using fire fox as your testing browser, then you must have these 20 essential firefox addons.I found this article, once I wondering for some information. Hope you will also like it.

http://www.testinggeek.com/twenty-essential-firefox-addons-for-testing

Thanks,
Trupti

QTP: Working with Web Table

Hey folks,

Please find below code for working with Web table to get row count,  column count and fetch records from the web table.
URL=http://www.google.com/
Systemutil.Run "iexplore.exe",URL
browsernm=".*Google.*"
Pagenm=".*Google.*"
Set CurrObj=Browser("name:="&browsernm).Page("title:="&Pagenm)
wait(5)
CurrObj.WebEdit("name:=q","html tag:=input").Set "Web table in qtp"
CurrObj.WebButton("name:=Google Search").Click

'to find the row count from web table
wtblrowcnt=CurrObj.WebTable("name:=nav_logo14").rowcount
msgbox wtblrowcnt

'To find the column count from web table
wtblcolcnt=CurrObj.WebTable("name:=nav_logo14").columncount(1) 'column count argument is row number
msgbox wtblcolcnt

'To fetch the data from particular cell
celldata= CurrObj.WebTable("name:=nav_logo14").getcelldata(1,1)
msgbox celldata

'Get the row number for defined text
RowNumber = Browser("").Page("").WebTable("").GetRowWithCellText("Trupti")

'CellText works as same as GetCellData method
 Browser("").Page("").WebTable("index:=0").CellText(1,1) 


'CellTextbyContext returns the text within a cell delimited by a character. We can retrieve the text before '(or) after the delimiter using this method.
 ' Consider a cell having the text “Jethva;Trupti”. Here “;’ is the delimiter
 Browser("").Page("").WebTable("index:=0").CellTextByContext(1,1,"",";")  

'TextCellExist method checks whether a text exists in a cell or not. It returns true, if the input text exists 'in the cell, else it returns false. Rather than using GetCellData method and then comparing the result with 'the input text, we can achieve it using this simple method.
  Browser("").Page("").WebTable("index:=0").TextCellExist(1,1,"Trupti") 



Thanks,
Trupti

Wednesday, August 10, 2011

Excel Cell's format change to "Text" using QTP

Hi,

Hope this will help you for changing cell's format to "Text" using QTP. In excel we can do it using right click on cell and change the format of general to text. Same thing using QTP, we can do it as follows.

objXL.Columns(x).ColumnWidth = 20

objXL.ActiveSheet.Range("A:A").NumberFormat = "@"

Replace “A:A” with your

Thanks,
Trupti