phil_hunter
11 years agoOccasional Contributor
TestComplete is selecting the wrong list item
Hi,
I'm relatively new and I havn't been able to find useful documentation on this, but when I run the automated test, TestComplete selects the wrong list item.
The list only appears when you click on a box, then the javascript shows the html elements (the view engine used is Razor with javascript
and ajax). When recording a test, I can choose any in the list (e.g I want to order a cellphone), but when I run the test, TestComplete always selects the last item in the list (I want to order Telephony). I think I have mapped the correct option/link:
Aliases.browser.pageIsServicePortal.panelBody.sectionContentWrapperMainContent.panel.panelRequestofferingcontent.panelRequestofferingcontent.panelRequestofferinginnercontent.linkServerRo.panelIWantToOrderACellphone
Can anyone tell me why TestComplete is choosing the wrong list item?
Regards,
Phil
- Create a new script routine, with "object spy" see the properties of the object you want to click, after that just adapt the code I'm giving below to your needs:
//function you can call everywhere
function clickContentTextVisibleOnScreen(text)
{
Aliases.browser.pageIsServicePortal.Find(new Array("contentText", "visibleOnScreen"), new Array(text, "True"), 500, true).Click();
}
//put you mouse cursor here and click the green "play" button on top of the editor
function main()
{
clickContentTextVisibleOnScreen("I want to order a cellphone");
}