Micro Focus QTP (UFT) Forums
How to Use Split Function using the Following Example? - 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: How to Use Split Function using the Following Example? (/Thread-How-to-Use-Split-Function-using-the-Following-Example)



How to Use Split Function using the Following Example? - subramanianmsc2007 - 02-21-2011

Hi,

I am using QTP with VBscript. And i have used the following Code like that,

Code:
Browser("Browser").Navigate "......."
Dim Str1
str1="WebButton"
msgbox str1
Dim str2
str2="Reset"
msgbox str2
Dim res
res=str1 & "(" & str2 & ")"
Browser("Browser").Page("OpenSSO (Login)").res.Click

If i run that script, it shown error as "Object does not support property or method".How to avoid this type of error using split function.

Please do the needful.

Thanks in Advance,
Subramanian.M


RE: How to Use Split Function using the Following Example? - tarun - 02-21-2011

Try this code

Code:
Dim sStatement
sStatement = "Browser("Browser").Page("OpenSSO(Login)")"
sStatement = sStatement & res & ".Click"

Execute sStatement



RE: How to Use Split Function using the Following Example? - basanth27 - 02-23-2011

What does msgbox res=str1 & "(" & str2 & ")" display?
Secondly what do you mean by avoiding this type of error using split?