Micro Focus QTP (UFT) Forums
Object Required Error - 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: Object Required Error (/Thread-Object-Required-Error--6311)



Object Required Error - rohit330 - 05-07-2012

Hi All

I am getting "Object Required Error" while running my script. code is


Code:
option Explicit
Dim VarA
Dim VarB

Browser("Obj1").Page("obj2").login 'Login Page code
Browser("Ob1").Page("obj3").Link() 'Clicking one link
VarA = ....GetRoProperty("obj4") ' There is a webelement which will be a log count (Text like "Log count: 4  "
'There is two spaces after 4. Total can reach upto three digit. ie once it is 999, it i reset to 1. Thing is when it is three digits then also two spaces will be there.

I need to get this count. So i have taken the whole text to a VarA using GetROProperty
Now i have used VarB = VarA.Remove(0,12) So that i can get number 4 in VarB. But at this point while running, error is coming like "Object Required: "Log count: ". How i can proceed? I tried using substring function also but same error. Actually initially i used Right(VarA, 3) but since i have spaces after count and count is having three number places, i couldnt use that.. Right was not giving me any error..

Any suggestions on how to progress on this?

Thanks in advance