Micro Focus QTP (UFT) Forums

Full Version: type mis match
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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"
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





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...