Problem calling method of custom qt object with QMetaObject::invokeMethod
Hi Everyone, I am testing a Qt application with Test Complete, my context is : Application compiled with Qt 5.9.5 + MSVC 2015 64 bit Test Complete 12.50 with VBScript language In this example case, my application is only a QWidget with a QPushButton. When clicking on this button, a custon menu appears. This menu is a class CMenu, derived from QMenu CMenu is declared in object mapping under Qt Controls > Menu in Test Complete project properties (default and current) My need is : access some data of my CMenu. These data are in a QList<QString> private member of my CMenu class. So, I declared a public accessor in my class to get one item of my list by its index in the list. ... class CMenu : public QMenu { Q_OBJECT private: QList<QString> m_lstTestNames; public: ... Q_INVOKABLE QString getTestName(int index) const; ... }; ... QString CMenu::getTestName(int index) const { return this->m_lstTestNames.at(index); } It works fine, in the object browser of Test Complete, I found my object and this method Sys.Process("proto_cmenu").QtObject("CMenu", "", 1).getTestName Description : Function getTestName(Param1 as Integer) as Object Now I want to use this method in my test script. So, first I open my application and I click on the push button to display my menu, and then call my method like below for example(it's the line 46 of my script) : Log.Message "Test Name 0 = " & Sys.Process("proto_cmenu").QtObject("CMenu", "", 1).getTestName(0) My problem is : I got the following error : VBScript runtime error. Erreur non spécifiée Error location: Unit: "FELIX\FLX_TST_007\Script\MAIN" Line: 46 Column: 2. With the following message just above in the log : Debug String: QMetaObject::invokeMethod: No such method CMenu::getTestName(getTestName) Candidates are: getTestName(int) I don't understand this message, as you see above, I called my function with an integer in my script, why does it talk me about "CMenu::getTestName(getTestName)" ? Can someone give me some help to go through this problem ?1.5KViews0likes2CommentsIs there a repository of custom rules teams have implemented for standardization of their API?
One of the features of SwaggerHub we find most valuable is the ability to edit/lint the API specs. There is a rich set of rules already, but we are finding we are wanting to add our own rules that apply to our design and code generation standards. I'm finding the jsonpath and regex rules to be very complicated beyond simple exists and matching specs. For example, we don't want designers to add 'termsOfService' node. We also want a warning where for Java Integers, the types field must be 'integer' not 'number' with a format of 'int32'. This rule is getting very complicated. I was wondering if there is a repository or library of custom rules in the community that organizations have create for their own needs and are willing to share. This would be a community extension of what SmartBear already provides. More examples would also make it a bit easier to learn jsonpath and regex and make it easier to create new custom rules .804Views0likes1Comment