I am checking a checkbox using below code. Is there any problem with it? I am getting error as " Object doesn't support this property or method: 'gobjMLXBrowser.WebCheckBox(...).checked' "
gobjMLXBrowser.WebCheckBox("name:=SaveLoginID").ch ecked = True
The statement should be like this:
Set chkBox = gobMLXBrowser.WebCheckBox("name:=SaveLoginID").Obj ect
chkBox.Checked = true
Senior QA Engineer,
Virtusa India Pvt Ltd,
Try the below code:
gobjMLXBrowser.WebCheckBox("name:=SaveLoginID").ch ecked = 1
Thanks for solution.
I summed up 2 statements in a single as following.
gobjMLXBrowser.WebCheckBox("name:=SaveLoginID").ob ject.checked = False
why is that i have to use object before using checked property?
When you are using the Object.checked it accesses the internal methods and properties of the Visual Basic object. And also one more thing is that this code can be executed only on IE browser.
can we write some standard code where it can take care of entering data into all kinds of controls & is not QTP dependant code? something which can work in DOM framework.
You are certainly using QTP 9.0 or newer. This is a known 'regression' in those versions. To bypass your problem, use type method. Instead of using .checked=True, write .Type " " (there is a blank space between the two quotes.
Keep me informed if you still have problems.
I use obj.WebCheckBox("AA").Set "ON" & Set "OFF" to set check boxes in QTP 9.2
This will not solve my problem. i am trying to create function which can be according to Document Object Model framework.
How come you want to use a DOM solution only?