Contributions
Clicking an a tag in the same div as a span containing desired text.
Hey all, Our org is fairly new to testcomplete, and I have a feeling someone's already nailed down an elegant solution to this type of problem. I'm working on building out some regression tests for a form page using Python scripts, and we have several multi-select input elements on this page. Select an item from a dropdown, and it will appear in a list below, along with a link to delete said item: The quick and dirty version of the html for the list of items is: <div id="container-for-item-list"> <div id="container-for-first-item-in-list"> <a href="javascript.removeItem(1);">X</a> <span> Item 1</span> </div> <div id="container-for-second-item-in-list"> <a href="javascript.removeItem(7);">X</a> <span> Item 7</span> </div> </div> What I am hoping to do is create a function that will locate the span containing the text "Item 1", and then click on the <a> tag within the same div, deleting that item. At this point, I'm able to find the span containing the text I want, but am uncertain how to then access and click on the adjacent <a> tag. Any help you have to offer would be greatly appreciated!Solved1.6KViews0likes3CommentsExecution Plan: running script that accepts python list as a parameter?
I'm working on testing a page that has a select multiple element (seeHTML select multiple Attribute (w3schools.com)), and I wrote up a little Python script to accept any number of locations in a python list, then ctrl+click to select every item in the list. I separated the first click to deal with a persistence issue we had between tests. def TestScript(business_name: string, locations:list): ... for index, location in enumerate(locations): if not index: (selector).ClickItem(location) else: (selector).ClickItem(location, skCtrl) ... I can call this function in another script, and successfully pass in all the string values I want, but what I'm wondering is this: is it possible to run this script in an execution plan, or as part of a keyword test? I can't see a way to supply a list parameter, so I'm kinda stumped... If it's not possible, is there a workaround to speak of?Solved807Views0likes2Comments