Forum Discussion
6 Replies
- RavikSuper ContributorHi, you can get variable value from one file unit to another file by using "USEUNIT" write in file2 'USEUNIT file1 Sub file2Test : : : End Sub This may help you. (Define variable as global)
- kktsenthilOccasional Contributor
hi,
i followed your input but its not getting the value.
i used as 'USEUNIT File2 in vbscript anyother way is there to achieve this?
- LageContributor
Hi kktsenthil
Rabik is right. this is the approach.
Create scripts: File1 and File2.
File1:
function function_return_value function_return_value = "some_value_in_file1" end function
File2:
'USEUNIT File1 sub subs_cannot_retur_values thisValue = File1.function_return_value() Log.Message(thisValue) end sub
Functions can return values.
Subs cannot return values.
Hope this example helps you
Regards,
Lage
- kktsenthilOccasional Contributor
File1
function function_return_value
Dim page
set page =Aliases.browser.pageB.frameDetail.formAspnetform.paneltest.Panel("testGridDiv").Table("ASGrid")
function_return_value = pageend function
'USEUNIT File1
sub testing()
Dim Addprops,Addvalue,idstrtagname, idstrtagnameAddprops = Array("contentText", "tagName")
Addvalues = Array("Add value", "SPAN")
idstrtagname = File1.function_return_value()idstrtagname.Find(Addprops, Addvalues, 1000,true).click
log.Message idstrtagname
end subwhen i run file1 i was getting an error message as 'Object doesn't support this property or method'
guide me on this.
if i want to pass a object from one file to another file how can i do please guide me friends..
- RavikSuper ContributorHI, I thing in your code - idstrtagname.Find(Addprops, Addvalues, 1000,true).click Statement is wrong, I thought that it should like- Set onjName = idstrtagname.Find(Addprops, Addvalues, 1000,true) objName.Click This may work for you.
Related Content
- 9 months agolodecesa
- 13 years agojyothi_priya
- 4 years agonedbacan
Recent Discussions
- 2 days agovladd1