kpinnisetti
13 years agoContributor
ClickItem Not working
I have a script with this: Unable to find the object ClickItem("Admin"). How do I get TC 9 to recognize this control? I read the help topic. Thanks.
Hi,
You code does not explain what your are trying to do...
Anyway, you have to make sure TC does understand where it is located in its processing in order to complete actions to execute otherwise you'll always get errors:
In your code the 'Aliases' referes to what, a page a form?
but my point of view is this:
As it's a web application (posting and receiving page aka forms) you have to:
obtain the page object(1) in first and get the focus to it (2) and look for the objectToFind(3) and get its focus (4) And perform the action(5):
(1) Set browser = Aliases.browser
(2) Set page = browser.Page("*") '* Is for the current page in focus instead of navigating to a specific page using session And/or cookies parameters...
(3) Set ddListBox = page.NativeWebObject.Find(propN,propValKey)
(4) Call ddListBox.focus()
(5) ddListBox.ClickItem strVal
If you want to process using a form make sure TC understand what you are looking to use as objectSSSS:
The form is related to the page mapped when recording your test or the one (page) mapped manually.
You can use the spy to get the form associated to the page and ask TC to show it in the object browser.
In the Object browser of you project, you will find the mapped browser with the associate application(web page/application address) with its ASP form.
(Refer to TC documentation on 'Mapping' subject to see how it works)
So after you get the ref to the form of the application page, then you can set its focus on and then search for the dropDownListBox you are looking for.
Set form = Aliases.browser.{nameOfTheApplicationPage}.{nameOfTheAspNetFormReferencingThePage}
Hope all this help...
Regards,