Micro Focus QTP (UFT) Forums
Qtp script not working in function - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: Qtp script not working in function (/Thread-Qtp-script-not-working-in-function)



Qtp script not working in function - zeeshanyshaikh - 10-31-2012

Hello,

From past 2 days i m getting strange behavior from qtp.
Can you guyz please help me out!!! Sad

I have two functions which in function file and i am calling functionA from functionB within that file.

Working of Functions:

Code:
Function FuncA(Services_name)
   Dim abc, row_count
    row_count = Browser("Browser").Page("Page").WebTable("Account Name").GetRowWithCellText(Services_name)
    MsgBox row_count
    set abc = Browser("Browser").Page("Page").WebTable("Account Name").ChildItem(row_count,1,"WebCheckBox",0)
    abc.click
End Function

Code:
Function FuncB(abc, xyz)
call FuncA("service1")
call FuncA("service2")
call FuncA("service3")
.....
...
...
..
..
End Function


Its a CRM Project, FuncA is used for adding services by clicking on provided services. so FuncB will call FuncA, check the checkbox for the provided services and the services will get added.
My problem is when i call FuncA from FuncB, it enters into the function but it gives row count is -1(service1 is present at second row)

And if i call same function from the test it works fine showing row count as 2.
Please if any one having solution for this then u can share with me...

Thanks & Regards
Zeeshan Shaikh.


RE: Qtp script not working in function - Parke - 01-16-2013

Try changing the abc.click to abc.set "ON"
You are wanting to activate or turn on a webcheckbox

hth