Micro Focus QTP (UFT) Forums
type mis match - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: type mis match (/Thread-type-mis-match)



type mis match - vishnu - 01-13-2012

Hi Friends I am new to qtp pleze help me out,
i have created a function lirary and associated it to a test
when i am calling a function in in the test its working properly but when i am calling a function in function library ( the function which is placed in Test )
it was giving a type mismatch error how to solve it...

Ex:
*** test***********
Code:
login
function create(buttion1)
buttion1.click
end function
******in fun lib****************
Code:
Function login
create(obj_buttion)
End function
*************************

That is the code, calling a fun from lib to test is possible or not..
when i try this i was getting a "type mismatch error"


RE: type mis match - Ankesh - 01-13-2012

This error comes when you have not defined the function.

Yes, you can call a function from library in your test.

As i can see you are using two functions.. but one of them is defined in test and the other one in your library.

******in fun lib****************
Function login
create(obj_buttion)
End function
*************************

In your library you are trying to use the function Create, which is defined in your test. Hence you are getting the type mismatch error.

Please place both the functions in your library and then use them.

Regards,
Ankesh








RE: type mis match - vishnu - 01-14-2012

Thank You...Mr.Ankesh
as You said "place both the functions in your library and then use them"
But i Want to place that function in test for the need of clicking the button which i want for the next scenario so i can use the lib again...