You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownewRuntimeException(String.format("Control [%s] root element NULL. Has control been located on the page (IE. SetControl(...)?",getMapping().getFriendlyName()));
28
-
}
29
-
else {
32
+
thrownewRuntimeException(String.format("Control [%s] root element NULL. Has control been located on the page (IE. SetControl(...)?", getMapping().getFriendlyName()));
if (newControl == null) thrownewRuntimeException("newControl Null!");
93
+
94
+
StopWatchtimeWaited = StopWatch.createStarted();
95
+
96
+
try {
97
+
Logger.WriteLine(Logger.LogLevels.TestInformation, "Setting on Control [%s] from Parent [%s]",
98
+
newControl.getMapping() == null ? "No mapping logic!" : newControl.getMapping().getFriendlyName(),
99
+
parentControl == null ? "No parent Control - So Top Level control" : parentControl.getMapping() == null ? "No mapping logic!" : parentControl.getMapping().getFriendlyName());
100
+
101
+
//
102
+
// Check if ParentControl has become stale (has been redrawn). If so, refresh it (force a new findElement on it). Note that this
103
+
// will effectively ripple up to the top level
104
+
//
105
+
if (parentControl != null && parentControl.isStale()) {
106
+
Logger.WriteLine(Logger.LogLevels.TestInformation, "Parent control is stale. Refreshing");
newControl.setParentControl(parentControl); // This may be null. So, new control is top level....
129
+
130
+
//
131
+
// THIS IS WHERE THE CACHE CONTROL WILL BE DONE.... No NEED FOR MVP. WE ARE SOOOO AGILE! lol
132
+
// For now, we will just assume Cache Miss
133
+
//
134
+
newControl.controlBeingSet(true);
135
+
136
+
returnnewControl;
137
+
} catch (Exceptione) {
138
+
Logger.WriteLine(Logger.LogLevels.Error, "Error setting on control: %s", e.getMessage());
139
+
thrownewRuntimeException(String.format("Error setting on control: %s", e.getMessage()));
140
+
}
141
+
}
142
+
143
+
//
144
+
// All Controls must implement a ControlBeingSet. This is called when the Control is set upon (IE. Find logic applied and bound to a Selenium element). It really
145
+
// will become useful when caching is implemented. It is used by a Control to do stuff when located in the Dom - IE. A dropdown control may click on it whenever
Logger.WriteLine(Logger.LogLevels.TestDebug,"Error thrown getting attribute [%s] from [%s]. Assume does not have attribute: %s",getFriendlyName(),e.getMessage());
0 commit comments