raheem


{ City } chennai
< Country > india
* Profession * it
User No # 123724
Total Questions Posted # 3
Total Answers Posted # 16

Total Answers Posted for My Questions # 2
Total Views for My Questions # 3066

Users Marked my Answers as Correct # 18
Users Marked my Answers as Wrong # 2
Questions / { raheem }
Questions Answers Category Views Company eMail

Explain Descriptive Programming Types with Examples?

QTP 915

Write the code for,In the page screen we have total 10 Links,out of these I have to click 9th link

QTP 855

Write code for ,We have a web table with rows and columns like EmpID EName Action 1 ABC Edit Delete 2 XYZ Edit Delete 3 PQR Edit Delete In the above Table the last column has two links we have to click first link based up on EmpID =2

2 QTP 1296




Answers / { raheem }

Question { NIIT, 8407 }

how can we handle exceptional handling in qtp


Answer

We can handle exceptions siuing below ways
1.On Error Resume Next - Skip the Error and continue the next stpes of execution
2. Recovery Scenarios
Select Resources > Recovery Scenario Manager. Create new Scenario > Specify the Trigger Event > Specify the Recovery Operation > Specify Post-recovery test run options
3. Conditional Statements ( If, ElseIf,Else,Do,While,...)
4.Synchronization Methods (Wait,WaitProperty,Sync,Exist)

Is This Answer Correct ?    1 Yes 0 No

Question { Satyam, 1849 }

Have you worked with QC?


Answer

Yes

Is This Answer Correct ?    1 Yes 0 No


Question { Synechron, 8119 }

how to retrieve the xml file data through qtp. can anybody
send script for this..


Answer

Set oXML = CreateObject("Microsoft.XMLDOM")
XMLFilePath = "C:Book.xml"
oXML.Load (XMLFilePath)
Set BooksNameNode = oXML.SelectNodes("*//book/name/text()") 'Selecting all name nodes under book node
For i = 0 To (BooksNameNode.Length - 1)
BookName = BooksNameNode(i).NodeValue
MsgBox BookName
Next

Is This Answer Correct ?    1 Yes 0 No

Question { 4724 }

how do u get lib files into scripting files?


Answer

1. Open test Go to File menu -> Settings -> Resources ->
Associate function libraries -> Click on '+' button ->give
Function library file path -> Apply -> Ok

2.ExecuteFile ("Path with FIleName")
3. LoadFunctionLibrary("Path with FIleName")

Is This Answer Correct ?    1 Yes 0 No

Question { DST Global Solutions, 8626 }

how can we call an external library file in QTP apart from
using the Executefile statement..?? is there any other way
we can call the external library file in QTP..??


Answer

LoadFunctionLibrary "LibraryNameWithPath"

Is This Answer Correct ?    1 Yes 0 No

Question { 1771 }

Hi i have a webtable which is having 7 columns and 6 rows
of data in that table of 4th and 5 th column each row is
partiotioned into 3 sub rows i want to verify in each
partitioned rows of corresponding row for ex values will be
like this 0 / 1 ,26/28.if it is 0/1 i want to skip only if
any num/num greater than 1 i want to click.


Answer

RC = Browser("BrowserName").Page("PageName").WEbTable("TableName").RowCount
For iLoop = 1 to RC
Set Link1 = Browser("BrowserName").Page("PageName").WEbTable("TableName").ChildItem(iLoop,4,"ClassName",0)
Set Link2 = Browser("BrowserName").Page("PageName").WEbTable("TableName").ChildItem(iLoop,4,"ClassName",1)
Set Link3 = Browser("BrowserName").Page("PageName").WEbTable("TableName").ChildItem(iLoop,4,"ClassName",2)
If Cint(Link1.GetRoproperty("value")) and Cint(Link2.GetRoproperty("value")) > 1 Then
Link3.Click
End If

Next

Is This Answer Correct ?    1 Yes 0 No

Question { Aspire, 5042 }

how to reverse a string with out using string or predefined
function,ex:string is " i love india". the output should be
like this "i evol aidni"


Answer

str=" i love india"

StrSpl = Split(str," ")

For j = 0 to Ubound(StrSpl)

result1 = result1 & " " & ReverseStr1(StrSpl(j))
Next

msgbox result1

Function ReverseStr1(Str1)
For i = 1 to Len(Str1)
ReverseStr1 = mid(Str1,i,1) & ReverseStr1
Next
End Function

Is This Answer Correct ?    1 Yes 0 No

Question { 56872 }

write a vb script to calculate factorial of a number?


Answer

n = 12345
f =1
for i =1 to len(n)
f = f* i
next
msgbox f

Is This Answer Correct ?    1 Yes 2 No

Question { Aspire, 8257 }

int a=4857 i need output as 7584.without using any inbuild
function?


Answer

a = 4857

Do while ( a>0 )
num = a mod 10
a = a / 10
output = output & num
loop
print output

Is This Answer Correct ?    1 Yes 0 No

Question { 3187 }

hai friends i already ask this question but when i post the
question the alignment goes wrong .....my question is we
have a WEB TABLE ....assume that web table having 3 row's
and 3 column here in 2nd row 3rd column having VISIT
FACEBOOK link...now i want to check the VISIT FACEBOOK link
is available or not ..if it's there i want to click the link
...then how to find the web table row or column count
....don't write the excel or data table script here friends
.....consider that it's a WEB TABLE do a favour ...thank's


Answer

Set OWT = Browser(" ").Page(" " ).WebTable( " ")
CC = OWT.ColumnCount
GetRNum = OWT.GetRowWithCellText("VISIT FACEBOOK")
For j =1 to CC step 1
If OWT.GetCelldata(GetRNum,j) = "VISIT FACEBOOK" Then
GetCNum = j
Exit for
End If
Next
Set Link1 = OWT.ChildItem(GetRNum,GetCNum,"Link",0)
Link1.Click


(or)
Set OWT = Browser(" ").Page(" " ).WebTable( " ")
RC = OWT.RowCount
CC = OWT.ColumnCount (1)
For i =1 to RC
For j= i to CC
If OWT.GetCellData(i,j) = "VISIT FACEBOOK" Then
GetRNum = i
GetCNum = j
Exit for
Exit for
End If
Next
Next
Set Link1 = OWT.ChildItem(GetRNum,GetCNum,"Link",0)
Link1.Click

Is This Answer Correct ?    1 Yes 0 No

Question { 9010 }

If there are some browsers opened and I don't how many browsers are open, Now I want to close all the browsers that I don't know how many are opened.
What would be Descriptive programming for this in QTP using VB Script..???
Please send your answers.


Answer

Set odesc=description.Create
odesc("micclass").value="Browser"
Set BrowCol=Desktop.ChildObjects(odesc)
For i = 0 To BrowCol.Count-1
BrowCol(i).Close
Next

Is This Answer Correct ?    3 Yes 0 No

Question { 9010 }

If there are some browsers opened and I don't how many browsers are open, Now I want to close all the browsers that I don't know how many are opened.
What would be Descriptive programming for this in QTP using VB Script..???
Please send your answers.


Answer

While Browser("creationtime:=0").Exist(0)

Browser("creationtime:=0").Close

Wend

Is This Answer Correct ?    1 Yes 0 No

Question { Cigniti Technologies, 3494 }

In Webtable New rows getting added, we have select the name as Sandeep ,If name column is sandeep then need to check the checkbox ,we don't know the rows and columns ,Can anyone please tell me the answer.


Answer

RC = Browser("Browser").Page("Page").WebTable("html tag:=TABLE").RowCount
RC = Browser("Browser").Page("Page").WebTable("html tag:=TABLE").ColumnCount(1)

RN = RC = Browser("Browser").Page("Page").WebTable("html tag:=TABLE").GetRowWithCellText("Sandeep")

For j = 1 to CC
If Browser("Browser").Page("Page").WebTable("html tag:=TABLE").GetCellData(RN,j) = "Sanddeep" Then
CN = j
End If
Next
Set OExpBox = Browser("Browser").Page("Page").WebTable("html tag:=TABLE").ChildItem(RN,CN,"WebCheckBox",0)
OExpBox.Click

Is This Answer Correct ?    1 Yes 0 No

Question { 1296 }

Write code for ,We have a web table with rows and columns like
EmpID EName Action
1 ABC Edit Delete
2 XYZ Edit Delete
3 PQR Edit Delete

In the above Table the last column has two links we have to click first link based up on EmpID =2


Answer

RC = Browser("Browser name").Page("Pagename").webTable("TableName").RowCount
CC = Browser("Browser name").Page("Pagename").webTable("TableName").ColumnCount(1)
for iLoop = 1 to RC
If Browser("Browser name").Page("Pagename").webTable("TableName").GetCellData(iLoop,1) = 2 Then
Rnum = iLoop
Exit for
End if
Next
for jLoop = 1 to CC
If Browser("Browser name").Page("Pagename").webTable("TableName").GetCellData(1,jLoop) = "Action" Then
Cnum = jLoop
Exit for
End if
Next
Set ReqLink =Browser("Browser name").Page("Pagename").webTable("TableName").childItem(Rnum,Cnum,"Link",0)
ReqLink.Click

Is This Answer Correct ?    1 Yes 0 No

Question { 1296 }

Write code for ,We have a web table with rows and columns like
EmpID EName Action
1 ABC Edit Delete
2 XYZ Edit Delete
3 PQR Edit Delete

In the above Table the last column has two links we have to click first link based up on EmpID =2


Answer

RC = Browser("Browser name").Page("Pagename").webTable("TableName").RowCount
CC = Browser("Browser name").Page("Pagename").webTable("TableName").ColumnCount(1)

Rnum = Browser("Browser name").Page("Pagename").webTable("TableName").GetRowWithCellText(2)
for jLoop = 1 to CC
If Browser("Browser name").Page("Pagename").webTable("TableName").GetCellData(1,jLoop) = "Action" Then
Cnum = jLoop
Exit for
End if
Next
Set ReqLink =Browser("Browser name").Page("Pagename").webTable("TableName").childItem(Rnum,Cnum,"Link",0)
ReqLink.Click

Is This Answer Correct ?    1 Yes 0 No

 [1]   2    Next