Forum Discussion
Novari-QA wrote:
Correct that seems to have done it.
My next question, is why isn't other classes able to see these functions? The Code below works. However when exporting the class to another, it doesn't know what UserPrefs isvar Header = undefined; var Main = { UserPrefs: function() { Header.menuMain.HoverMouse(); return Header.menuMain_UserPrefs; } } function foo() { Header = Aliases.browsers.pageDashboard_PhysOffice; Main.UserPrefs().Click(); }
Navigation.cs
var Menu = require("Menu"); function foo() { Menu.Header = Aliases.browser.pageDashboard_PhysOffice; Menu.Main.UserPrefs().Click(); }
We have a header at the top of almost every page, I am trying to make a common class which all pages can reference when trying to navigate.
Menu.Parent.Child.Click(); is what I am trying to create. Then I would create a single class which handles Navigation.
It depends upon how you are doing the modules.export and the requires calls. I have a "toy" project that I use to explore creating custom JavaScript classes and have them called across code units and, when implementing such a thing in TestComplete, there were some "hoops" I needed to jump through to get it to work properly.
Could you share the entire code units, complete with the exports calls and such?
Certainly
Foo function works, where abc function do not.
Related Content
Recent Discussions
- 13 hours agojstaehlin
- 2 days agoAivanitskiy