Contributions
Using regexp in FindAllChildren
I want to be able to detect all the objects with the following ClrFullClassName property: DevExpress.XtraEditors.TextEdit DevExpress.XtraEditors.LookUpEdit If i search for them separately, not using the regexp, TestComplete is able to get it. But I want my objects to be in just one array so I use regexp so I can get both and store in one array objects = parent.FindAllChildren("ClrFullClassName","regexp: DevExpress\.XtraEditors\.(Text|LookUp)Edit",2) If I use this regexp, i cant get anything.Solved1.1KViews0likes2CommentsRe: Serial port communication
Hi Alex, The error was permission denied. Anyways, I solved this problem by just issuing a command on window cmd line to write character to a certain portby defining the following in my scripts. def connectDevice(): cmd = "echo d > COM7" os.system(cmd) # Delay 10s Delay(10000) return Thanks for the reply.2.2KViews2likes0CommentsRe: Serial port communication
Hi, I am trying to send data to a COM port and found the following solution in TestComplete website https://support.smartbear.com/testcomplete/docs/scripting/working-with/com-ports.html I used the following solution as described in the web page (Python). However, when I run my test it gave an errorPermission denied. Any idea on how to solve this error? def TestCOMPort(): ForWriting = 2; TriStateFalse = 0; fso = Sys.OleObject['Scripting.FileSystemObject'] f = fso.OpenTextFile("COM1:", ForWriting, False, TriStateFalse) # Write data to the port f.Write("A") f.Write(" ") f.Write("\x1B") f.Close()2.2KViews0likes2CommentsRe: How to check if a menuItem is visible?
Hi Maria, Thanks for your reply. I have tried to spy the object and when I do, it does give me the Visible property. However, it also gives me a different way to access the object. Not through the WPFmenu.Items[] field but through a PopupRoot. I have also tried to FindAllChildren of this PopupRoot window but it cant return me the correct menuItems.1.8KViews0likes1CommentHow to check if a menuItem is visible?
I am currently testing a WPF application and getting all menus and submenus. However, when I use the WPFmenu.Items property, it is giving me all submenus which are not visible on the actual GUI. Is there a way to check whether a menuItem is visible? I have checked for Enabled property and it doesn't work as I expect it to. # menuItem - TestComplete MenuItem Object # menuObj - User-defined class rssMenu def getSubMenuRecursive(menuItem,menuObj): # If a menu, has a submenu get the number of submenus if (menuItem.SubMenu != None): subMenuCount = menuItem.SubMenu.Count # else return, there is nothing to recurse else: subMenuCount = 0 # Recurse to find all the linked subMenus for i in range(subMenuCount): subMenuItem = menuItem.SubMenu.Items[i] if (subMenuItem.Enabled == True): subMenuItemObj = rssMenu(subMenuItem,menuObj) # I want a submenu to be added to menuObj.submenu[] only when it is visible on the application if (isVisible(subMenuItem) == True): subMenuItemObj = getSubMenuRecursive(subMenuItem,subMenuItemObj) menuObj.addSubMenu(subMenuItemObj) return menuObj --------------------------------- # User-defined rssMenu class rssMenu(): def __init__(self,obj = None,parent = None): self.name = obj.Caption self.parent = parent self.subMenu = [] def addSubMenu(self,obj): self.subMenu.append(obj) return1.8KViews0likes3Comments