### Start Recording Script Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/StartRecBehavior.sikuli/StartRecBehavior.html This script checks for a specific image on the screen, clicks it if found, and then exits. It's used to automate the initiation of a recording process. ```Python if not exists(![](HSNSTI3SIHCb.png)): exit(1) click(![](HSNSTI3SIHCb.png)) sleep(1) exit(0) ``` -------------------------------- ### Console Execution Command Example Source: https://github.com/pr-mex/vanessa-automation/blob/develop/docs/index.md This command demonstrates how to execute Vanessa Automation tests using a VAParams.json profile in a console environment. Ensure the paths to the 1C executable and the Vanessa Automation module are correct. ```bash %V83PATH% /Execute C:\vanessa-automation\vanessa-automation.epf /TESTMANAGER /C"StartFeaturePlayer;VAParams=C:\VAParams.json" ``` -------------------------------- ### Run EnjoyHint Tour Source: https://github.com/pr-mex/vanessa-automation/blob/develop/lib/VanessaInteractive/CommonTemplates/Web_script_js/Ext/Template.txt Initializes and runs an EnjoyHint tour using predefined sets. The EnjoyHint library is used for creating guided product tours. Ensure EnjoyHint and its configurations are properly set up before running. ```javascript let enjoyhint = new EnjoyHint(); enjoyhint.set(sets); enjoyjoyhint.run(); // $('.enjoyhint_close_btn').hide(); // setTimeout(() => (enjoyhint.stop()), 6000); } ``` -------------------------------- ### Get Label Element Source: https://github.com/pr-mex/vanessa-automation/blob/develop/lib/VanessaInteractive/CommonTemplates/Web_enjoyhint_min_js/Ext/Template.txt Creates and returns a jQuery object representing the label element with specified text and position. ```javascript c.getLabelElement = function(b) { return a("
", { class: "enjoy_hint_label", id: "enjoyhint_label" }).css({ top: b.y + "px", }) ``` -------------------------------- ### EnjoyHint Script Control Functions Source: https://github.com/pr-mex/vanessa-automation/blob/develop/lib/VanessaInteractive/CommonTemplates/Web_enjoyhint_min_js/Ext/Template.txt Provides functions to control the EnjoyHint script execution, including stopping, rerunning, starting, resuming, and setting the current step. ```javascript var t = function() { n++, s() } , u = function() { n--, s() } , v = function() { var b = m[n] , c = a(b.selector); y(b.event), c.off(w(b.event)), r() } , w = function(a, b) { return a + (b ? "custom" : "") + ".enjoy_hint" } , x = function(a, b) { o.on(w(a, !0), b) } , y = function(a) { o.off(w(a, !0)) }; window.addEventListener("resize", function() { null != d && o.enjoyhint("redo_events_near_rect", d[0].getBoundingClientRect()) }, !1), e.stop = function() { v() } , e.reRunScript = function(a) { n = a, s() } , e.runScript = function() { n = 0, l.onStart(), s() } , e.resumeScript = function() { s() } , e.setCurrentStep = function(a) { n = a } , e.getCurrentStep = function() { return n } , e.trigger = function(a) { switch (a) { case "next": t(); break; case "skip": v(); break; default: o.trigger(w(a, !0)) } } , e.setScript = function(a) { if (!(a instanceof Array) && a.length < 1) throw new Error("Configurations list isn't correct."); m = a } , e.set = function(a) { e.setScript(a) } , e.setSteps = function(a) { e.setScript(a) } , e.run = function() { ``` -------------------------------- ### EnjoyHint API: Showing and Hiding Elements Source: https://github.com/pr-mex/vanessa-automation/blob/develop/lib/VanessaInteractive/CommonTemplates/Web_enjoyhint_min_js/Ext/Template.txt Control the visibility of the tutorial overlay and its components using `show` and `hide` methods. Specific buttons like next, previous, and skip can also be individually shown or hidden. ```javascript show: function() { return this.each(function() { this.enjoyhint_obj.show() }), this }, hide: function() { return this.each(function() { this.enjoyhint_obj.hide() }), this }, hide_next: function() { return this.each(function() { this.enjoyhint_obj.hideNextBtn() }), this }, hide_prev: function() { return this.each(function() { this.enjoyhint_obj.hidePrevBtn() }), this }, show_prev: function() { return this.each(function() { this.enjoyhint_obj.showPrevBtn() }), this }, show_next: function() { return this.each(function() { this.enjoyhint_obj.showNextBtn() }), this }, hide_skip: function() { return this.each(function() { this.enjoyhint_obj.hideSkipBtn() }), this }, show_skip: function() { return this.each(function() { this.enjoyhint_obj.showSkipBtn() }), this } ``` -------------------------------- ### Set Maximum Time to Find Window Source: https://github.com/pr-mex/vanessa-automation/blob/develop/docs/JsonParams/JsonParamsEN.md Specifies the maximum duration Vanessa Automation will wait to find a window during a step. Example: `Then "WindowTitle" window is opened`. ```gherkin timetofindwindow ``` -------------------------------- ### Find and Click All Matches (Sikuli - Commented) Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/ClickCoordinates.sikuli/ClickCoordinates.html This commented-out section demonstrates how to find all occurrences of an image on the screen, iterate through them, print their locations, click each one, and capture a region around each match. This is useful for automating interactions with multiple identical UI elements. ```Sikuli #findAll("1492761928555.png") #mm = SCREEN.getLastMatches() #while mm.hasNext(): # loop as long there is a first and more matches # TekMatch = mm.next() # print "found: ", TekMatch # access the next match in the row # location = TekMatch.getTarget() # print "match",";",location.x,";",location.y # click(location) # sleep(1) # print mm.x # t1= capture(mm.getX(), mm.getY(), mm.getW(), mm.getH()) ``` -------------------------------- ### Wait and Click Image Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/SourceTree.sikuli/AutoClick.html This snippet demonstrates how to wait for a specific image to appear on the screen and then click it. Ensure the image file (e.g., DownloadSour.png) is accessible to the script. ```sikuli wait(![](DownloadSour.png)) click(![](DownloadSour.png)) ``` -------------------------------- ### Prevent Text Overwrite in Fields After Server Call Source: https://github.com/pr-mex/vanessa-automation/blob/develop/docs/JsonParams/JsonParamsEN.md Enables a mechanism to prevent user-entered text in form fields from being overwritten after a server call completes. Requires the VAExtension installed. ```gherkin DisableForFieldsAbilityToOverwriteTextWhenServerCall ``` -------------------------------- ### Rendering and Button Logic in EnjoyHint Source: https://github.com/pr-mex/vanessa-automation/blob/develop/lib/VanessaInteractive/CommonTemplates/Web_enjoyhint_min_js/Ext/Template.txt This snippet handles the rendering of tutorial elements, including labels and navigation buttons. It dynamically adjusts button positions based on window size and element visibility, and includes logic for rendering arrows and closing the tutorial. ```javascript } O = K + s / 2, P = b.center_y > L + t / 2 ? L + t : L, b.center_y < 0 ? N = 20 : b.center_y > window.innerHeight + 20 && (N = window.innerHeight - 20), b.center_y >= L && b.center_y <= L + t && (O = b.center_x > K ? K + s : K, P = b.center_y), c.renderLabel({ x: K, y: L, text: b.text }), setTimeout(function() { var a = c.$next_btn.width() + c.$skip_btn.width() + c.$prev_btn.width() + 30 , b = K - 100 , e = L + t + 40; a + K > M && (b = M >= O ? M + 20 : K + s / 2), (a + b > window.innerWidth || b < 0) && (b = 10, e = P < N ? L - 80 : L + t + 40); var f = b , g = e; window.innerWidth <= 640 ? (b = 10, e = 10, c.$next_btn.html("›"), c.$prev_btn.html("‹")) : (b = f, e = g, c.$next_btn.html(d.nextButton && d.nextButton.text ? d.nextButton.text : "Next"), c.$prev_btn.html(d.prevButton && d.prevButton.text ? d.prevButton.text : "Previous")), c.$prev_btn.css({ left: b, top: e }); var h = b + c.$prev_btn.width() + 10 , i = b + c.$prev_btn.width() + c.$next_btn.width() + 20; "hide" === c.nextBtn && (i = b + c.$prev_btn.width() + 10), "hide" === c.prevBtn && (h = b, i = b + c.$next_btn.width() + 10), c.$next_btn.css({ left: h, top: e }), c.$skip_btn.css({ left: i, top: e }) }, 0), c.$close_btn.css({ right: 10, top: 10 }), c.disableEventsNearRect({ top: h.top, bottom: h.bottom, left: h.left, right: h.right }), c.renderArrow({ x_from: O, y_from: P, x_to: M, y_to: N, by_top_side: Y }) } , c.clear = function() { c.ctx.clearRect(0, 0, 3e3, 2e3) } , this }) } ``` -------------------------------- ### Handle Dialog Closing Event Source: https://github.com/pr-mex/vanessa-automation/blob/develop/lib/VanessaInteractive/CommonTemplates/Web_enjoyhint_min_js/Ext/Template.txt Attaches a listener to the 'dialogClosing' event for a dialog element. When the dialog starts closing, it calls the stopFunction. This ensures that any ongoing interactive process is halted gracefully. ```javascript null != f && a(f).on("dialogClosing", function() { c.stopFunction() }) ``` -------------------------------- ### Calculate Element Positions for Web EnjoyHint Source: https://github.com/pr-mex/vanessa-automation/blob/develop/lib/VanessaInteractive/CommonTemplates/Web_enjoyhint_min_js/Ext/Template.txt Calculates various positions and dimensions for elements based on window size, element properties, and predefined areas. Use this for positioning tooltips or guides. ```javascript common_area: x * u, width: x, height: u }, { name: "right_bottom", common_area: x * v, width: x, height: v }, { name: "left_center", common_area: w * window.innerHeight, width: w, height: window.innerHeight }, { name: "left_top", common_area: w * u, width: w, height: u }, { name: "left_bottom", common_area: w * v, width: w, height: v }, { name: "center_top", common_area: window.innerWidth * u, width: window.innerWidth, height: u }, { name: "center_bottom", common_area: window.innerWidth * v, width: window.innerWidth, height: v }], D = s, E = window.innerHeight <= 670 ? A : A + 20, F = C.sort(function(a, b) { return a.common_area - b.common_area }), G = "oversized", H = 0; H < F.length; H++) { var I = F[H].name , J = F[H]; J.width > D && J.height > E && (G = I) } var K, L, M, N, O, P, Q = "circle" === b.shape ? 2 * b.radius : b.width ? b.width : 2 * b.radius, R = "circle" === b.shape ? 2 * b.radius : b.height ? b.height : 2 * b.radius, S = b.center_x + Q / 2 + 80, T = b.center_x - s - Q / 2 - 80, U = window.innerWidth / 2 - s / 2, V = b.center_y - B - t, W = b.center_y + B, X = window.innerHeight / 2 - E / 2 + 20, Y = "hor"; switch (G) { case "center_top": L = V, K = U, M = b.center_x, N = b.center_y - R / 2 - 20; break; case "center_bottom": L = W, K = U, M = b.center_x, N = b.center_y + R / 2 + 20; break; case "left_center": L = X, K = T, M = b.center_x - Q / 2 - 20, N = b.center_y, Y = "ver"; break; case "left_top": L = V, K = T, M = b.center_x - Q / 2, N = b.center_y - 20; break; case "left_bottom": L = W, K = T, M = b.center_x - Q / 2, N = b.center_y + 20, Y = "ver"; break; case "right_center": L = X, K = S, M = b.center_x + Q / 2 + 20, N = b.center_y, Y = "ver"; break; case "right_top": L = V, K = S, M = b.center_x + Q / 2, N = b.center_y - 20; break; case "right_bottom": L = W, K = S, M = b.center_x + Q / 2, N = b.center_y + 20, Y = "ver"; break; case "oversized": setTimeout(function() { a("#enjoyhint_arrpw_line").remove(), a(".enjoy_hint_label").css({ "border-radius": "20px", "-webkit-border-radius": "20px", "-moz-border-radius": "20px", "background-color": "#272A26", "-webkit-transition": "background-color ease-out 0.5s", "-moz-transition": "background-color ease-out 0.5s", "-o-transition": "background-color ease-out 0.5s", transition: "background-color ease-out 0.5s" }) }, 450), L = X, K = U ``` -------------------------------- ### EnjoyHint API: Rendering Custom Shapes Source: https://github.com/pr-mex/vanessa-automation/blob/develop/lib/VanessaInteractive/CommonTemplates/Web_enjoyhint_min_js/Ext/Template.txt Utilize `render_circle` and `render_label` to draw custom shapes and text labels on the tutorial overlay. These methods allow for flexible visual customization of tutorial steps. ```javascript render_circle: function(a, b, c) { return this.each(function() { this.enjoyhint_obj.renderCircle(a, b, c) }), this }, render_label: function(a, b, c) { return this.each(function() { this.enjoyhint_obj.renderLabel(a, b, c) }), this }, render_label_with_shape: function(a, b, d) { ``` -------------------------------- ### Click Folder and Exit Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/OpenDialogClickFolderSelect.sikuli/OpenDialogClick.html This snippet demonstrates how to click on a specific folder using a pattern and then exit the script. It's useful for automating file selection processes. ```sikuli click(Pattern(![](Flmnduana.png)).targetOffset(34,0)) exit(0) ``` -------------------------------- ### EnjoyHint Plugin Initialization and Method Calls Source: https://github.com/pr-mex/vanessa-automation/blob/develop/lib/VanessaInteractive/CommonTemplates/Web_enjoyhint_min_js/Ext/Template.txt Demonstrates how to initialize the EnjoyHint plugin and call its various methods using jQuery. This is the primary way to interact with the plugin's features. ```javascript return this.each(function() { c.stopFunction = b, this.enjoyhint_obj.renderLabelWithShape(a, d) }), this }, redo_events_near_rect: function(a) { c.disableEventsNearRect({ top: a.top, bottom: a.bottom, left: a.left, right: a.right }) }, clear: function() { return this.each(function() { this.enjoyhint_obj.clear() }), this }, close: function(a) { return this.each(function() { this.enjoyhint_obj.closePopdown() }), this } }; a.fn.enjoyhint = function(b) { return p[b] ? p[b].apply(this, Array.prototype.slice.call(arguments, 1)) : "object" != typeof b && b ? (a.error("Method " + b + " does not exist on $.numinput"), this) : p.init.apply(this, arguments) } ``` -------------------------------- ### EnjoyHint Base Styles Source: https://github.com/pr-mex/vanessa-automation/blob/develop/lib/VanessaInteractive/CommonTemplates/Web_enjoyhint_css/Ext/Template.txt Sets up the main EnjoyHint overlay container. It's fixed to cover the entire screen and has a high z-index to appear above other content. Pointer events are disabled by default. ```css .enjoyhint { position: fixed; width: 100%; height: 100%; top: 0; left: 0; z-index: 1010; pointer-events: none; overflow: hidden } ``` -------------------------------- ### Automate Atom IDE: Open File and Search Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/GoToProcedure.sikuli/VscIsOpen.html This Sikuli script automates opening a file in Atom and searching for 'Gherkin'. It relies on image recognition to locate UI elements and simulates mouse clicks and keyboard input. Ensure the specified image patterns are present and visible on the screen. ```Jython wait(Pattern(![](1464017836667.png)).similar(0.60),60) if not exists(Pattern(1464017836667.png)).similar(0.60)): exit(1) click(Pattern(![](1464017836667.png)).similar(0.60).targetOffset(18,2)) #type("n",KeyModifier.CTRL) wait(Pattern(![](115LIl1lliZn.png)).similar(0.60),60) click(Pattern(![](115LIl1lliZn.png)).similar(0.60)) wait(Pattern(![](Zufspnmpn2mx.png)).similar(0.60),30) click(Pattern(![](Zufspnmpn2mx.png)).similar(0.60)) sleep(1) paste("Gherkin") sleep(1) type(Key.ENTER) exit(0) ``` -------------------------------- ### Handle Keyboard Events for EnjoyHint Steps Source: https://github.com/pr-mex/vanessa-automation/blob/develop/lib/VanessaInteractive/CommonTemplates/Web_enjoyhint_min_js/Ext/Template.txt Attaches a listener for keyboard events to advance the EnjoyHint tour. Allows specifying a custom key code or using the default behavior. ```javascript else d.on(c, function(a) { f.keyCode && a.keyCode != f.keyCode || (n++, s()) }) ``` -------------------------------- ### Auto-Click Download Source Script Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/Git.sikuli/SourceTree.html This script automates clicking a 'Download Source' button if it appears on the screen within a 15-second timeout. It exits with 0 on success and 1 on failure. ```sikuli if exists(![](DownloadSour.png),15): click(![](DownloadSour.png)) exit(0) exit(1) ``` -------------------------------- ### Detect and Activate Atom Window with Sikuli Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/ChooseGherkin.sikuli/SwitchToConf.html This script repeatedly searches for a specific image (presumably representing the Atom window) on the screen. If found, it clicks the leftmost occurrence to activate the window. It includes a timeout to prevent infinite loops. ```Jython kol = 0 while True: FindIm = findAll(![](1465210805287.png)) ArrOfImage = list(FindIm) KolImages = len(ArrOfImage) id = -1 maxX = -1 print 'KolImages=' + str(KolImages) for n in range(0, KolImages): t = ArrOfImage[n] print 't.x=' + str(t.x) if t.x > maxX: maxX = t.x id = n if KolImages > 0: t = ArrOfImage[id] print 'click t.x=' + str(t.x) click(Location(t.x+5,t.y+5)) break sleep(1) kol = kol+1 if kol > 5: exit(1) exit(0) ``` -------------------------------- ### Handle Button Configurations in EnjoyHint Source: https://github.com/pr-mex/vanessa-automation/blob/develop/lib/VanessaInteractive/CommonTemplates/Web_enjoyhint_min_js/Ext/Template.txt Configures previous and skip buttons for the EnjoyHint tour. Sets button text and CSS classes based on provided configuration. ```javascript h.text(f.prevButton.text || "Previous"), e.prevUserClass = f.prevButton.className } if (f.skipButton) { var i = a(".enjoyhint_skip_btn"); i.addClass(f.skipButton.className || ""), i.text(f.skipButton.text || "Skip"), e.skipUserClass = f.skipButton.className ``` -------------------------------- ### Simulate HOME Key Press Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/TypeHome.sikuli/TypeHome.html This script simulates pressing the HOME key on the keyboard and then exits. It's useful for automating navigation to the beginning of a line or document. ```Sikuli type(Key.HOME) exit(0) ``` -------------------------------- ### Automate Opening a File with SikuliX Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/OpenFile.sikuli/OpenFile.html This script automates opening a file by interacting with the GUI. It requires the file path as a command-line argument. Ensure the 'OpenFile.sikuli' script and its associated image ('MdaainaHIFIH.png') are in the same directory. ```Python import sys path = sys.argv[1] click(Pattern("![](MdaainaHIFIH.png)).targetOffset(36,0)) sleep(1) paste(path ) sleep(1) type(Key.ENTER) exit(0) ``` -------------------------------- ### Click at Specified Coordinates (Sikuli) Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/ClickCoordinates.sikuli/ClickCoordinates.html This snippet takes two command-line arguments representing the X and Y coordinates, creates a Location object, and then clicks at that location on the screen. Ensure the script is run with valid integer arguments for coordinates. ```Sikuli location = Location(int(sys.argv[1]),int(sys.argv[2])) click(location) ``` -------------------------------- ### Press Win+Up and Exit Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/ClickFlagGenUF.sikuli/MoveActiveWindowFullScreen.html This script simulates pressing the Windows key and the Up arrow key, then exits the script. It's useful for actions like maximizing a window. ```Sikuli type(Key.UP, KeyModifier.WIN) sleep(1) exit(0) ``` -------------------------------- ### Check and Click Atom Window (Sikuli) Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/ClickFlagGenUF.sikuli/ClickGeneratorEPF.html This script checks for the presence of an image 'FenepampEPF.png'. If found, it clicks the image and exits successfully. If not found, it exits with an error code. ```sikuli if not exists(![](FenepampEPF.png)): exit(1) click(![](FenepampEPF.png)) sleep(1) exit(0) ``` -------------------------------- ### Open Dialog and Click Folder Script Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/OpenDialogClickFolder.sikuli/OpenDialogClickFolder.html This script uses Sikuli's image recognition to click on a folder. Ensure the 'Ilama.png' image is available and correctly represents the target folder. The script then exits. ```sikuli click(Pattern("![](Ilama.png)").targetOffset(23,0)) exit(0) ``` -------------------------------- ### EnjoyHint Initialization and Options Source: https://github.com/pr-mex/vanessa-automation/blob/develop/lib/VanessaInteractive/CommonTemplates/Web_enjoyhint_min_js/Ext/Template.txt Initializes the EnjoyHint object, setting default options and extending them with user-provided configurations. Manages class names for styling and DOM elements. ```javascript var r = { onNextClick: function() {}, onSkipClick: function() {}, onPrevClick: function() {}, animation_time: 800 }; this.enjoyhint_obj = {}, c = this.enjoyhint_obj, c.resetComponentStuff = function() { d = null, e = null, f = null, g = null, h = null, i = null, j = null, k = null, l = null, m = null, n = window.innerWidth, o = window.innerHeight } ; var s = a(this); c.options = a.extend(r, p), c.gcl = { chooser: "enjoyhint" }, c.cl = { enjoy_hint: "enjoyhint", hide: "enjoyhint_hide", disable_events_element: "enjoyhint_disable_events", btn: "enjoyhint_btn", skip_btn: "enjoyhint_skip_btn", close_btn: "enjoyhint_close_btn", next_btn: "enjoyhint_next_btn", previous_btn: "enjoyhint_prev_btn", main_canvas: "enjoyhint_canvas", main_svg: "enjoyhint_svg", svg_wrapper: "enjoyhint_svg_wrapper", svg_transparent: "enjoyhint_svg_transparent", kinetic_container: "kinetic_container" }, c.canvas_size = { w: 1.4 * a(window).width(), h: 1.4 * a(window).height() }, c.enjoyhint = a("
", { class: c.cl.enjoy_hint + " " + c.cl.svg_transparent }).appendTo(s), c.enjoyhint_svg_wrapper = a("
", { class: c.cl.svg_wrapper + " " + c.cl.svg_transparent }).appendTo(c.enjoyhint), c.$stage_container = a('
').appendTo(c.enjoyhint), c.$canvas = a("").appendTo(c.enjoyhint), c.$svg = a("").appendTo(c.enjoyhint_svg_wrapper); var t = a(q("defs")) , u = a(q("marker", { id: "arrowMarker", viewBox: "0 0 36 21", refX: "21", refY: "10", markerUnits: "strokeWidth", orient: "auto", markerWidth: "16", markerHeight: "12" })) , v = a(q("path", { style: "fill:none; stroke:rgb(255,255,255); stroke-width:2", d: "M0,0 c30,11 30,9 0,20", id: "poliline" })); t.append(u.append(v)).appendTo(c.$svg), c.kinetic_stage = new b.Stage({ container: c.cl.kinetic_container, width: c.canvas_size.w, height: c.canvas_size.h, scaleX: 1 }), c.layer = new b.Layer, c.rect = new b.Rect({ fill: p.fill, width: c.canvas_size.w, height: c.canvas_size.h }); ``` -------------------------------- ### Automate Feature File Loading with Sikuli Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/LoadingFeatureFileInBehavior.sikuli/LoadingFeatureFileInBehavior.html This script automates the process of loading a feature file. It clicks specific UI elements, inputs a file path provided as a command-line argument, and confirms the action. ```sikuli click(![](J93ar.png)) click(![](Barpysvm0Auy.png)) sleep(1) path2FeatureFile = sys.argv[1] paste(path2FeatureFile) sleep(3) type(Key.ENTER) exit(0) ``` -------------------------------- ### Click OK Button or Exit Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/IPressOkInQueryConstruct.sikuli/IPressOkInQueryConstruct.html This script checks for an 'OK' button image. If found, it clicks it. Otherwise, it exits with an error code. A successful execution concludes with an exit code of 0. ```sikuli if exists(![](OK-1.png)): click(![](OK-1.png)) else: exit(1) exit(0) ``` -------------------------------- ### Trigger Context Menu and Exit Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/ContextMenu.sikuli/ContextMenu.html This snippet demonstrates how to simulate pressing F10 with Shift to open a context menu and then exit the script. Use this for automated context menu interactions. ```sikuli type(Key.F10, KEY_SHIFT) exit(0) ``` -------------------------------- ### Window Resize Handler for EnjoyHint Source: https://github.com/pr-mex/vanessa-automation/blob/develop/lib/VanessaInteractive/CommonTemplates/Web_enjoyhint_min_js/Ext/Template.txt Sets up a debounced resize handler for the window. It recalculates element positions and dimensions, re-renders labels, and manages button visibility. If the target element is not visible, it stops the tour. ```javascript var D; a(window).on("resize", function() { function d() { var b = a(c.stepData.enjoyHintElementSelector).get(0).getBoundingClientRect(); c.stepData.center_x = b.left + b.width / 2, c.stepData.center_y = b.top + b.height / 2, c.stepData.width = b.width + 11, c.stepData.height = b.height + 11, c.renderLabelWithShape(c.stepData, c.customBtnProps), a(".enjoyhint_next_btn").css("visibility", "visible"), a(".enjoyhint_prev_btn").css("visibility", "visible"), a(".enjoyhint_skip_btn").css("visibility", "visible") } if (clearTimeout(D), a(".enjoyhint_next_btn").css("visibility", "hidden"), a(".enjoyhint_prev_btn").css("visibility", "hidden"), a(".enjoyhint_skip_btn").css("visibility", "hidden"), a(".enjoy_hint_label").remove(), a("#enjoyhint_arrpw_line").remove(), !a(c.stepData.enjoyHintElementSelector).is(":visible")) return c.stopFunction(), void a(window).off("resize"); var e = a(c.stepData.enjoyHintElementSelector)[0].getBoundingClientRect(); c.shape.attrs.center_x = Math.round(e.left + e.width / 2), c.shape.attrs.center_y = Math.round(e.top + e.height / 2), c.shape.attrs.width = e.width + 11, c.shape.attrs.height = e.height + 11, D = setTimeout(function() { ``` -------------------------------- ### Populate Voice Selection and Initialize Handlers Source: https://github.com/pr-mex/vanessa-automation/blob/develop/VanessaAutomation/Templates/CSS_3D_Сarousel/Ext/Template.txt Populates a select element with available voices and sets up event handlers for the speech synthesis object and UI controls. It finds a specific default voice and initializes interaction handlers. ```javascript populateVoices(myVoices); function populateVoices(voices) { voices.forEach((voice, index) => { select.options[index] = new Option(voice.name, index); }); const defaultVoiceIndex = voices.findIndex( (voice) => voice.name === "Google русский" ); select.selectedIndex = defaultVoiceIndex; initializeHandlers(); } ``` -------------------------------- ### Automate Feature Loading with Sikuli Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/FeatureLoadMany.sikuli/FeatureLoadMany.html This script simulates user interactions to load features. It clicks on a specified image element and then hovers over another, with pauses in between. Ensure the image files are accessible to Sikuli. ```sikuli click(![](Sarnvzsm.png)) sleep(1.5) hover(![](iarpvambqmai.png)) sleep(1.5) exit(0) ``` -------------------------------- ### Initialize Speech Synthesis Event Handlers Source: https://github.com/pr-mex/vanessa-automation/blob/develop/VanessaAutomation/Templates/CSS_3D_Сarousel/Ext/Template.txt Sets up event listeners for the `utterThis` speech synthesis object, including `onstart` and `onend` events. It also configures a change handler for a wrapper element that manages UI updates. ```javascript function initializeHandlers() { utterThis.onstart = () => { playback = true; }; utterThis.onend = () => { playback = false; playStopChange(); }; // utterThis.onerror = (err) => console.error(err); // utterThis.onpause = () => console.log("Paused"); // utterThis.onresume = () => console.log("Resumed"); wrapper.onchange = ({ target }) => { if (target.type !== "range") return; handleChange(target); }; } ``` -------------------------------- ### Perform Click Actions with Sikuli Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/OpenBehavior.sikuli/Desktop.html Use the 'click' command to simulate a left mouse click on a specified image. Ensure the image is visible on the screen. ```sikuli click(![](Screenshot_1.png)) ``` ```sikuli click(![](Screenshot_3.png)) ``` ```sikuli click(![](Screenshot_4.png)) ``` -------------------------------- ### Click on Image using Sikuli Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/ClickOnPicture.sikuli/ClickOnPicture.html This script takes an image path as a command-line argument and uses Sikuli's click function to interact with the image on the screen. Ensure the image file exists at the specified path. ```Python PictureToClick = sys.argv[1] click(PictureToClick) ``` -------------------------------- ### Close Configuration Window Script Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/CloseConfigurator.sikuli/Sikuli.html This script automates closing a configuration window. It clicks an image, waits, and then uses keyboard navigation (DOWN, RIGHT, ENTER) to confirm closure. Ensure the image '1462546926131.png' is present and correctly identified by Sikuli. ```sikuli click(![](1462546926131.png)) sleep(1) type(Key.DOWN) sleep(1) type(Key.RIGHT) sleep(1) type(Key.DOWN) sleep(1) type(Key.ENTER) sleep(1) ``` -------------------------------- ### Open Behavior Path Script Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/OpenBehavior.sikuli/OpenBehavior.html This script automates opening a specified behavior path. It uses keyboard shortcuts to trigger an 'open file' dialog, pastes the provided path, and confirms the action. Ensure the path is correctly formatted. ```Python sleep(5) type('o', KeyModifier.CTRL) sleep(1) path2VanessaBehavoir = sys.argv[1] paste(path2VanessaBehavoir) sleep(2) type(Key.ENTER) exit(0) ``` -------------------------------- ### Check and Open File in Atom Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/SwitchToConf.sikuli/AtomIsOpen.html This script snippet checks if a specific Atom window pattern exists. If it does, it proceeds to open a file and set its syntax. ```sikuli if not exists(Pattern(![](1463230028949.png)).similar(0.80)): exit(1) click(Pattern(![](1463230028949.png)).similar(0.80).targetOffset(10,0)) type("n",KeyModifier.CTRL) click(![](Edit.png)) wait(![](SelectGramma.png),30) click(![](SelectGramma.png)) paste("Gherkin-ru") type(Key.ENTER) exit(0) ``` -------------------------------- ### Sikuli Script for Context Menu Interaction Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/ClickContextMenuVisualStudioCode.sikuli/ClickContextMenuVisualStudioCode.html This script hovers over a specified image element and then clicks it, simulating user interaction to open a context menu in Visual Studio Code. It's useful for automating tasks that require context menu access. ```sikuli hover(![](1532879285882.png)) click(![](1532879285882.png)) exit(0) ``` -------------------------------- ### Load Feature Scenario Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/RunScenarios.sikuli/RunScenarios.html This script clicks on a specific UI element identified by a pattern and then pauses execution. It's used for automating the loading of a feature in a GUI. ```sikuli click(Pattern(![](BbHDJlHHTbCL.png)).similar(0.80)) sleep(1.5) exit(0) ``` -------------------------------- ### Sikuli Script to Type Text from File Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/TypeText.sikuli/TypeText.html This script reads a file line by line and types each line into the active application. It interprets '#enter' as a command to press the Enter key. Ensure the file path is passed as a command-line argument. ```Jython import sys.argv #paste(unicode(sys.argv[1],'utf-8')) #sleep(1) #print sys.argv[0] file = open(sys.argv[1], 'r') while True: line = file.readline() if not line: break stroka = unicode(line, 'utf-8') if stroka == '#enter': type(Key.ENTER) else: paste(stroka) #App.setClipboard(stroka) #rightClick(Env.getMouseLocation()) #sleep(0.5) #click("Bcrasmu.png") sleep(0.5) sleep(1) exit(0) ``` -------------------------------- ### Sikuli Script: Click Context Menu Open Feature Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/ClickContextMenuOpenFeatureInTextEditor.sikuli/ClickContextMenuOpenFeatureInTextEditor.html This script automates the process of interacting with a context menu in a text editor. It first hovers over a specified element (likely a menu item or button) and then clicks it, presumably to open a feature or dialog. The script exits with a status code of 0 upon successful completion. ```sikuli hover(![](1532879519618.png)) click(![](1532879519618.png)) exit(0) ``` -------------------------------- ### Click 'Add' Button with Sikuli Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/ClickButtonDobavit.sikuli/ClickButtonDobavit.html This script checks for the existence of an image representing the 'Add' button. If found, it clicks the button and pauses briefly before exiting. If not found, it exits with an error. ```sikuli if not exists(![](HOBBBVITI.png)): exit(1) click(![](HOBBBVITI.png)) sleep(1) exit(0) ``` -------------------------------- ### Press End and Enter Keys Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/CtrlPlus.sikuli/PressEndEnter.html Use this script to simulate pressing the End key followed by the Enter key. A short pause is included before the script exits. ```Sikuli type(Key.END) type(Key.ENTER) sleep(0.5) exit(0) ``` -------------------------------- ### Navigate and Execute Sikuli Script Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/GoToEndOfModule.sikuli/GoToEndOfModule.html This script simulates pressing Ctrl+END to go to the end of a module, followed by pressing ENTER to execute a command. It then exits. ```sikuli type(Key.END,KeyModifier.CTRL) sleep(0.5) type(Key.ENTER) sleep(0.5) exit(0) ``` -------------------------------- ### Click Service Tab Script Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/ClickServiceTab.sikuli/ClickServiceTab.html This script waits for one second, clicks an image named 'Cepsuc.png', and then exits. Ensure the 'Cepsuc.png' image is available in the same directory or path accessible by Sikuli. ```sikuli sleep(1) click(![](Cepsuc.png)) exit(0) ``` -------------------------------- ### Close Configuration Window Script Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/CloseConfigurator.sikuli/GoToFormModule.html This script checks for the existence of a specific UI element (represented by an image) and clicks it if found. If the element is not found, the script exits with an error code. A 1-second delay is included after clicking. ```Python if not exists(Pattern(![](EIMoaunb.png)).similar(0.60)): exit(1) click(Pattern(![](EIMoaunb.png)).similar(0.60)) sleep(1) exit(0) ``` -------------------------------- ### Click Pattern and Exit Script Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/OpenDialogClickFolderSelect.sikuli/OpenDialogClickFolder.html This snippet demonstrates how to use Sikuli's pattern matching to locate and click an element, followed by exiting the script. Ensure the 'Ilama.png' image is correctly placed and recognized by Sikuli. ```sikuli click(Pattern("![](Ilama.png))".targetOffset(23,0)) exit(0) ``` -------------------------------- ### Click Tab and Exit Script Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/GoToTabScenarioRun.sikuli/GoToTabScenarioRun.html This snippet demonstrates how to click on a visual element representing a tab using Sikuli's image recognition and then terminate the script. Ensure the image file '1532879384495.png' is available in the script's directory. ```Jython click(![](1532879384495.png)) exit(0) ``` -------------------------------- ### Move Active Window Left with Sikuli Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/ClickFlagGenUF.sikuli/MoveActiveWindowLeft.html Use this script to simulate pressing the Windows key and the Left arrow key to move the active window to the left side of the screen. A short delay follows to ensure the action is registered. ```Jython type(Key.LEFT, KeyModifier.WIN) sleep(1) exit(0) ``` -------------------------------- ### Find and Click Form Element (Sikuli) Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/GoToFormModule.sikuli/GoToFormModule.html This script finds all occurrences of a given image pattern on the screen, converts them to a list, and then clicks the first found instance. It exits with an error code if no instances are found. ```Sikuli FindIm = findAll(Pattern(![](EIMoaunb.png)).similar(0.50)) ArrOfImage = list(FindIm) KolImages = len(ArrOfImage) if KolImages == 0: exit(1) t = ArrOfImage[0] click(Location(t.x+5,t.y+5)) sleep(1) exit(0) ``` -------------------------------- ### Sikuli Script to Type ESC, END, ENTER, HOME Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/TypeESC_END_ENTER_HOME.sikuli/TypeESC_END_ENTER_HOME.html This script simulates pressing the ESC, END, ENTER, and HOME keys sequentially. It requires the SikuliX automation tool to run. ```sikuli type(Key.ESC) type(Key.END) type(Key.ENTER) type(Key.HOME) exit(0) ``` -------------------------------- ### Find and Iterate 1C Window Coordinates with Sikuli Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/GetAll1CWindowsCoordinates.sikuli/GetAll1CWindowsCoordinates.html This script finds all occurrences of a specified image (presumably a 1C window) on the screen and prints the X and Y coordinates of each match. It uses a while loop to process all found matches. ```Jython findAll(![](1492761928555.png)) mm = SCREEN.getLastMatches() while mm.hasNext(): # loop as long there is a first and more matches TekMatch = mm.next() # print "found: ", TekMatch # access the next match in the row location = TekMatch.getTarget() print "match",";",location.x,";",location.y # click(location) # sleep(1) # print mm.x # t1= capture(mm.getX(), mm.getY(), mm.getW(), mm.getH()) ``` -------------------------------- ### Sikuli Script for Query Execution Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/CallQueryConstructWithResult.sikuli/CallQueryConstructWithResult.html This script automates clicking through a series of images to initiate a query construct. It includes checks for the existence of each image before clicking and exits with an error code if an image is not found. The script concludes by exiting with a success code. ```Sikuli if exists(![](Texcr.png)): click(![](Texcr.png)) else: exit(1) sleep(1) if exists(![](OIlCTDplTODS.png)): click(![](OIlCTDplTODS.png)) else: exit(1) if exists(![](1474556643856.png)): click(![](1474556643856.png)) else: exit(1) exit(0) ``` -------------------------------- ### Check and Activate Atom Window (Sikuli) Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/ClickFlagGenUF.sikuli/ClickFlagGenUF.html This script checks for the presence of a specific visual element associated with the Atom editor. If the element is found, it clicks on it to bring the Atom window to the foreground and then exits successfully. If the element is not found, the script exits with an error code. ```sikuli if not exists(Pattern(![](_H9DMDOB8TbV.png)).targetOffset(-131,0)): exit(1) click(Pattern(![](_H9DMDOB8TbV.png)).targetOffset(-131,0)) sleep(1) exit(0) ``` -------------------------------- ### Check if Atom is Open with Sikuli Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/ClickFlagGenUF.sikuli/CtrlF.html Use this script to simulate pressing Ctrl+F to open the find dialog in Atom, then exit. This is a common method to check if an application is responsive or open. ```Jython type('f', KeyModifier.CTRL) sleep(1) exit(0) ``` -------------------------------- ### Sikuli Script: Navigate to Conditions Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/IGoToLeftSideOfConditions.sikuli/IGoToLeftSideOfConditions.html Use this script to automate clicking an image if it's present on the screen. Exits with an error if the target image is not found. ```sikuli if exists(![](Hons.png)): click(![](Hons.png)) else: exit(1) exit(0) ``` -------------------------------- ### Sikuli Script to Open Feature File Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/LoadingFeatureFileInBehavior.sikuli/OpenFeatureFileInBehavior.html This script uses Sikuli to navigate and open a specified feature file. It requires the file path as a command-line argument. Ensure Sikuli is set up to recognize the UI elements. ```sikuli click(![](J93ar.png)) click(![](Barpysvm0Auy.png)) sleep(1) path2FeatureFile = sys.argv[1] paste(path2FeatureFile) sleep(3) type(Key.ENTER) sleep(1) exit(0) ``` -------------------------------- ### Find and Click Image in Sikuli Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/ChooseGherkin.sikuli/SwitchToTestClient.html This script repeatedly searches for an image ('HF.png') on the screen. It clicks the first instance found based on its x-coordinate and exits. If the image is not found after 5 attempts, the script exits with an error. ```Jython kol = 0 while True: FindIm = findAll(![](HF.png)) ArrOfImage = list(FindIm) KolImages = len(ArrOfImage) id = -1 maxX = -1 print 'KolImages=' + str(KolImages) for n in range(0, KolImages): t = ArrOfImage[n] print 't.x=' + str(t.x) if t.x > maxX: maxX = t.x id = n if KolImages > 0: t = ArrOfImage[id] print 'click t.x=' + str(t.x) click(Location(t.x+5,t.y+5)) break sleep(1) kol = kol+1 if kol > 5: exit(1) exit(0) ``` -------------------------------- ### Find and Click Image in Sikuli Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/MoveActiveWindowFullScreen.sikuli/SwitchToTestClient.html This script repeatedly searches for an image ('HF.png') on the screen. If found, it clicks on the last detected instance. It includes a loop with a maximum iteration count to prevent infinite execution. ```Jython kol = 0 while True: FindIm = findAll(![](HF.png)) ArrOfImage = list(FindIm) KolImages = len(ArrOfImage) print 'KolImages='+ str(KolImages) for n in range(0, KolImages): t = ArrOfImage[n] print 't.x='+ str(t.x) if KolImages > 0: t = ArrOfImage[KolImages-1] print 'click t.x='+ str(t.x) click(Location(t.x+5,t.y+5)) break sleep(1) kol = kol+1 if kol > 5: exit(1) exit(0) ``` -------------------------------- ### Detect and Click Atom Window with Sikuli Source: https://github.com/pr-mex/vanessa-automation/blob/develop/tools/Sikuli/ClickFlagGenUF.sikuli/SwitchToTestClient.html This script repeatedly searches for an image on the screen. If found, it clicks on the last detected instance and terminates successfully. If the image is not found after several attempts, it exits with an error code. ```Python kol = 0 while True: FindIm = findAll(![](HF.png)) ArrOfImage = list(FindIm) KolImages = len(ArrOfImage) print 'KolImages=' + str(KolImages) for n in range(0, KolImages): t = ArrOfImage[n] print 't.x=' + str(t.x) if KolImages > 0: t = ArrOfImage[KolImages-1] print 'click t.x=' + str(t.x) click(Location(t.x+5,t.y+5)) break sleep(1) kol = kol+1 if kol > 5: exit(1) exit(0) ```