HP QTP 10: Web-app testing - SomeObj.FireEvent("OnCLick") works, SomeObj.Object.FireEvent("OnCLick") doesn't
- by Vitaliy
Hi all!
I have rich web app btuil with ExtJS. It has multi-select list control (created with JS+CSS).
I want to click on some item in that list using HP QuickTest Pro 10 with Internet Explorer 6. I added that item into Object repository and found that following code works - selects some item:
Browser("blah").Page("blah").WebElement("SomeElem").Click
next code also works:
Browser("blah").Page("blah").WebElement("SomeElem").FireEvent("onMouseDown")
Browser("blah").Page("blah").WebElement("SomeElem").FireEvent("onMouseUp")
Browser("blah").Page("blah").WebElement("SomeElem").FireEvent("onClick")
But I want to select several items using shift+click method. I don't know to do that :(
So I have a few questions:
How can perform click with mouse on several web elements with Shift key pressed?
I tried to do that using CreateEventObject + shiftKey set to true, but the method (perform fireEvent on DOM object, not object from Object repository) doesn't work:
Browser("blah").Page("blah").WebElement("SomeElem").Object.FireEvent("onClick")
What the difference between WebElement("Element").FireEvent("OnClick") and WebElement("Element").Object.FireEvent("OnClick") ?
Plsease, help someone, because I fought with that problem a lot, but had no result.
Thanks!