{"id":22360369,"url":"https://github.com/sergueik/swet","last_synced_at":"2025-07-30T13:31:50.209Z","repository":{"id":25754054,"uuid":"87974868","full_name":"sergueik/SWET","owner":"sergueik","description":"Selenium WebDriver Page Test  / workflow recorder (successor to SWD recorder)","archived":false,"fork":false,"pushed_at":"2024-01-28T01:12:18.000Z","size":3647,"stargazers_count":38,"open_issues_count":3,"forks_count":14,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-01-28T02:26:02.630Z","etag":null,"topics":["ide","recording","selenium","swt"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sergueik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-04-11T20:08:42.000Z","updated_at":"2024-01-28T02:26:04.393Z","dependencies_parsed_at":"2023-01-14T03:21:05.894Z","dependency_job_id":"65f1b2cf-d470-4386-a0e8-ee9189d67eeb","html_url":"https://github.com/sergueik/SWET","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sergueik/SWET","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergueik%2FSWET","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergueik%2FSWET/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergueik%2FSWET/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergueik%2FSWET/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sergueik","download_url":"https://codeload.github.com/sergueik/SWET/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergueik%2FSWET/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267875489,"owners_count":24158780,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ide","recording","selenium","swt"],"created_at":"2024-12-04T16:16:02.836Z","updated_at":"2025-07-30T13:31:49.738Z","avatar_url":"https://github.com/sergueik.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿### Info\r\n\r\n\u003cimg src=\"https://github.com/sergueik/SWET/blob/master/src/main/resources/images/document_wrench_color.png\" alt=\"drawing\" width=\"62\"/\u003e __Selenium WebDriver Elementor Toolkit__  ( __SWET__  = light , in Russian) is a OS-independent successor to the\r\n[Selenium WebDriver Page Recorder](https://github.com/dzharii/swd-recorder) (__SWD__) by Dmytro Zharii and author.\r\n__SWET__ is using [Eclipse Standard Widget Toolkit](https://www.eclipse.org/swt/) with third party [Opal](https://github.com/lcaron/opal) widget library'\r\nfor user interface (instead of Microsoft .Net Windows Forms) and the [Jtwig](http://jtwig.org/documentation/reference) template engine instead of [ASP.Net Razor](https://en.wikipedia.org/wiki/ASP.NET_Razor) for code generation. NOTE: the Jtwig template engine project is no longer maintained,the source is still available for cloning at [Jtwig Project github repository](https://github.com/jtwig/jtwig)\r\nThat is just one of the available template exngines - note, __jtwig__ supports the original [PHP Twig](http://twig.sensiolabs.org/doc/2.x/)\r\nsyntax as well.\r\n\r\n__SWET__ also allows generating the __keyword driven framework__ flow and saving it into an Excel spreadsheet.\r\nThis is a work in progress, since each keyword driven framework has its own list of *keywords* , currenlty __SWET__ supports the\r\n[SKDF](https://github.com/sergueik/SKDF) framework developed by the author.\r\n\r\n\r\n__SWET__ was tested to work on 32 or 64 bit Windows, Mac or Linux platforms.\r\n__SWET__ is currently beta quality: one can record, load and save sessions, update individual Page Element information,\r\nconvert session to a code fragment in Java or C# language, or an Excel file with a Keyword Driven Framework workflow.\r\nThe __SWET__ project was originally written to offer similar functionality as __SWD__, but significantly less [MVC](https://www.codeproject.com/Articles/383153/The-Model-View-Controller-MVC-Pattern-with-Csharp)-heavyy and also\r\nbreaking its dependency on Windows Forms libraries, after an attempt to replace Windows Forms with [XWT](https://github.com/mono/xwt) was made failed with conclysion that XWT look and feel of the time,\r\ndid not seem equivalent. Eventually the full functionality of __SWD__ is to be achieved, also __SWET__ might become an [Eclipse plugin](http://www.vogella.com/tutorials/EclipsePlugin/article.html).\r\n\r\nThe __SWET__ application is being developed in Ecipse with [SWT Designer/Window Builder](http://www.vogella.com/tutorials/EclipseWindowBuilder/article.html) plugin,\r\non Ubuntu 16.04 and Windows. The [javaFx](http://www.java2s.com/Tutorials/Java/JavaFX/) port os __SWET__ is in the works.\r\n\r\nFor Mac / Safari testing, the [Sierra Final 10.12](https://techsviewer.com/install-macos-sierra-virtualbox-windows/) Virtual Box by TechReviews is being used.\r\nNaturally, Apple only licenses OS X for use on their hardware, therefore the fact the author has been using able to boot Sierra and test the code to successfully compile and run\r\ndoes not imply he officialy asks anyone do the same, it simply proves the code being robust enough and very likely will run on a real Mac out of gitgub.\r\nCurrently, recording page elements in __SWET__ with Safari browser is somewhat flaky but possible.\r\n\r\nThe Virtualbox images are setup for Selenium 3.x testing (work in progress).\r\n\r\n![OSX Example](https://github.com/sergueik/SWET/blob/master/screenshots/capture1.png)\r\n\r\n![Ubuntu Example](https://github.com/sergueik/SWET/blob/master/screenshots/capture2.png)\r\n\r\n![Windows Example](https://github.com/sergueik/SWET/blob/master/screenshots/capture3.png)\r\n\r\n### Usage\r\n\r\nIn order to use __SWET__ one will need to compile the application jar from the source - it is not difficult.\r\nContinue reading for info on how to get the dev environment setup.\r\n\r\n### Prerequisites\r\nThe project can be compiled and run from Eclipse or standalone, through the launcher script. The single executable jar is not being packages by default due to its size - anyone is free to\r\ntry on one's own risk.\r\n\r\n\r\nTo build the project outside of Eclipse, JDK 1.8 or later and Maven need to be installed and added to the `PATH`.\r\nThere launcher  scripts is  explained below.\r\n\r\nAs the time goes on, the following reusable parts of the __SWET__ project became stanalone ones and have been eitherpublished to maven central or need to be cloned and installed locally using maven:\r\n\r\n* [jProtractor](https://github.com/sergueik/jProtractor)\r\n* [SKDF](https://github.com/sergueik/SKDF)\r\n* [jUnitParams dataproviders](https://github.com/sergueik/junit-dataproviders)\r\n\r\nTo skip smoke testing of those projects use the command\r\n```cmd\r\nmvn -Dmaven.test.skip=true install\r\n```\r\nto have them available in `~/.m2/repositories`. Eventually all of these prjects would go to maven central.\r\n\r\nIn the checked-in sample runner scripts, the JDK and Maven is expected to be installed under `c:\\java\\` on Windows,\r\nor into the path\r\n`/Library/Java/JavaVirtualMachines/jdk$JAVA_VERSION.jdk/Contents/Home`(which is the default location) on the Mac,\r\nand made available on Linux with [`alternatives`](https://www.linuxquestions.org/linux/answers/Applications_GUI_Multimedia/LINUX_ALTERNATIVES_HOWTO).\r\n\r\nAll project dependencies are pulled by Maven.\r\n\r\n#### Updating the platform-specific information in the `pom.xml`\r\n\r\nThere are profiles in the project `pom.xml` which make selection of the platform-specific `swt.jar` dependency automatic:\r\n\r\n```xml\r\n    \u003cprofile\u003e\r\n      \u003cid\u003ewindows64\u003c/id\u003e\r\n      \u003cactivation\u003e\r\n        \u003cos\u003e\r\n          \u003cfamily\u003edos\u003c/family\u003e\r\n          \u003carch\u003eamd64\u003c/arch\u003e\r\n        \u003c/os\u003e\r\n      \u003c/activation\u003e\r\n      \u003cproperties\u003e\r\n        \u003ceclipse.swt.artifactId\u003eorg.eclipse.swt.win32.win32.x86_64\u003c/eclipse.swt.artifactId\u003e\r\n        \u003cbuild_os\u003ewin64\u003c/build_os\u003e\r\n      \u003c/properties\u003e\r\n    \u003c/profile\u003e\r\n    \u003cprofile\u003e\r\n      \u003cid\u003emac64\u003c/id\u003e\r\n      \u003cactivation\u003e\r\n        \u003cos\u003e\r\n          \u003cfamily\u003emac\u003c/family\u003e\r\n          \u003carch\u003ex86_64\u003c/arch\u003e\r\n        \u003c/os\u003e\r\n      \u003c/activation\u003e\r\n      \u003cproperties\u003e\r\n        \u003cbuild_os\u003emac64\u003c/build_os\u003e\r\n        \u003ceclipse.swt.artifactId\u003eorg.eclipse.swt.cocoa.macosx.x86_64\u003c/eclipse.swt.artifactId\u003e\r\n      \u003c/properties\u003e\r\n    \u003c/profile\u003e\r\n    \u003cprofile\u003e\r\n      \u003cid\u003eunix32\u003c/id\u003e\r\n      \u003cactivation\u003e\r\n        \u003cos\u003e\r\n          \u003cfamily\u003eunix\u003c/family\u003e\r\n          \u003carch\u003ei386\u003c/arch\u003e\r\n        \u003c/os\u003e\r\n      \u003c/activation\u003e\r\n      \u003cproperties\u003e\r\n        \u003cbuild_os\u003eunix32\u003c/build_os\u003e\r\n        \u003cselenium.version\u003e2.53.1\u003c/selenium.version\u003e\r\n        \u003ceclipse.swt.artifactId\u003eorg.eclipse.swt.gtk.linux.x86\u003c/eclipse.swt.artifactId\u003e\r\n      \u003c/properties\u003e\r\n    \u003c/profile\u003e\r\n    \u003cprofile\u003e\r\n      \u003cid\u003eunix64\u003c/id\u003e\r\n      \u003cactivation\u003e\r\n        \u003cos\u003e\r\n          \u003cfamily\u003eunix\u003c/family\u003e\r\n          \u003carch\u003eamd64\u003c/arch\u003e\r\n        \u003c/os\u003e\r\n      \u003c/activation\u003e\r\n      \u003cproperties\u003e\r\n        \u003cbuild_os\u003eunix64\u003c/build_os\u003e\r\n        \u003ceclipse.swt.artifactId\u003eorg.eclipse.swt.gtk.linux.x86_64\u003c/eclipse.swt.artifactId\u003e\r\n      \u003c/properties\u003e\r\n    \u003c/profile\u003e\r\n```\r\nThe correct profile is likely be selected automatically. If this does not work for some reason, one will need to copy the relevant\r\n`artifactId` property definition into the\r\n```xml\r\n  \u003cproperties\u003e\r\n    \u003ceclipse.swt.version\u003e4.3\u003c/eclipse.swt.version\u003e\r\n    \u003ceclipse.swt.artifactId\u003eorg.eclipse.swt.win32.win32.x86_64\u003c/eclipse.swt.artifactId\u003e\r\n  \u003c/properties\u003e\r\n  \u003cdependencies\u003e\r\n    \u003cdependency\u003e\r\n\t\t\t\u003cgroupId\u003eorg.eclipse.swt\u003c/groupId\u003e\r\n\t\t\t\u003cartifactId\u003e${eclipse.swt.artifactId}\u003c/artifactId\u003e\r\n      \u003cversion\u003e${eclipse.swt.version}\u003c/version\u003e\r\n\t\t\u003c/dependency\u003e\r\n    ...\r\n```\r\n\r\nDue to some problem with JVM loader, all these platform-dependent jars cannot be included simultaneously.\r\nOne alternative is to package the spring-boot style uber-jar file as explained in\r\n[Multiplatform SWT](https://github.com/jendap/multiplatform-swt) project.\r\nUnfortulately it is not very practical: the resulting bare-bones `multiplatform-swt-loader.jar` file is almost 10 Mb\r\nand with all Selenium JSON POI and TWIG dependencies the size of __SWET__ jar exceeds 30 Mb.\r\nThe conversion to javaFx is currently underway.\r\nTherefore,  we recommend to rely on maven profile facility to pick the required dependency and\r\nto modify the `pom.xml` and use runner scripts to compile it as explained below.\r\n\r\n#### Runner Scripts\r\nAfter the project is cloned or downloaded from from github, one will find the following `run.*` scripts helpful to compile and start the application:\r\nOn Windows, use either Powershell script\r\n```powershell\r\n. .\\run.ps1\r\n```\r\nor a batch file\r\n```cmd\r\nrun.cmd\r\n```\r\nOn Unix or a Mac, launcher is a bash script\r\n```bash\r\n./run.sh\r\n```\r\n\r\n### Debugging and adding Features\r\n\r\nThe __SWET__ application is a Gimp style multi dialog desktop app. Practically every class (SWT or console) in the project directory can be started standalone with the help of the \r\nlauncher script(s) `run.cmd`, `run.ps1` in Windows OS and `run.sh` in OSX or Linux os like e.g.:\r\n\r\n```cmd\r\nrun.cmd ComplexFormEx\r\n```\r\ncompiles the app and launches the specific class' `main` method which most of the classes already provide:\r\n```java\r\n@SuppressWarnings(\"unused\")\r\npublic static void main(String[] arg) {\r\n  ComplexFormEx o = new ComplexFormEx(null, null);\r\n  o.render();\r\n}\r\n```\r\n![Running and debugging Form Example](https://github.com/sergueik/SWET/blob/master/screenshots/capture_run_complexformex.png)\r\n\r\n##\r\nThe script has ability to also download the dependency jar(s), if there are ones not hosted on Maven Central repository ( *this is no longer necessary* ),\r\nthen to compile and package the project using maven\r\nand run the application main class from the `target` directory jar and libraries.\r\n\r\nThe script configuration needs to be updated with the actual paths to Java and Maven:\r\n```powershell\r\n$MAVEN_VERSION = '3.3.9'\r\n$JAVA_VERSION = '1.8.0_101'\r\n$env:JAVA_HOME = \"c:\\java\\jdk${JAVA_VERSION}\"\r\n$env:M2_HOME = \"c:\\java\\apache-maven-${MAVEN_VERSION}\"\r\n$env:M2 = \"${env:M2_HOME}\\bin\"\r\n```\r\n\r\n```cmd\r\nif \"%JAVA_VERSION%\"==\"\" set JAVA_VERSION=1.8.0_101\r\nset JAVA_HOME=c:\\java\\jdk%JAVA_VERSION%\r\nif \"%MAVEN_VERSION%\"==\"\" set MAVEN_VERSION=3.3.9\r\nset M2_HOME=c:\\java\\apache-maven-%MAVEN_VERSION%\r\n```\r\n\r\n```bash\r\nJAVA_VERSION='1.8.0_121'\r\nMAVEN_VERSION='3.3.9'\r\n```\r\n\r\nAfter the project compiled once, it can be run the jar through the command (assuming java is in the `PATH`):\r\n```cmd\r\njava.exe -cp target\\swet-0.0.5-SNAPSHOT.jar;target\\lib\\* com.github.sergueik.swet.SimpleToolBarEx\r\n```\r\nor\r\n\r\n```bash\r\njava.exe -cp target/swet-0.0.5-SNAPSHOT.jar:target/lib/* com.github.sergueik.swet.SimpleToolBarEx\r\n```\r\n- without changing to the source, there is little reason to recompile it every time. Adding the `META-INF/MANIFEST.MF`\r\nis a work in progress.\r\n\r\nPaths to the browsers and browser drivers are read from the `src/main.resources/application.properties` file\r\n```java\r\n# username / password not currently used - reserved for Sauce Labs or browserStack\r\nusername: username\r\npassword: password\r\n# no quotes should be put around paths. Trailing whitespace is ok\r\n# use the following syntax for environment variables: ${USERPROFILE}\\\\desktop\\\\chromedriver.exe\r\nchromeDriverPath: ${USERPROFILE}\\\\desktop\\\\chromedriver.exe\r\n# chromeDriverPath: ${HOME}/Downloads/chromedriver\r\ngeckoDriverPath: c:/java/selenium/geckodriver.exe\r\nfirefoxBrowserPath: C:/Program Files (x86)/Mozilla Firefox/firefox.exe\r\n# firefoxBrowserPath: /Applications/Firefox.app/Contents/MacOS/firefox\r\ngeckoDriverPath: c:/java/selenium/geckodriver.exe\r\n# geckoDriverPath: ${HOME}/Downloads/geckodriver\r\nieDriverPath: c:/java/selenium/IEDriverServer.exe\r\nedgeDriverPath: C:/Program Files (x86)/Microsoft Web Driver/MicrosoftWebDriver.exe\r\n```\r\nEventually other common formats: YAML, JSON, POI or Java properties file - will be supported.\r\n\r\n\r\n### Recording the page elements with SWET.\r\n\r\n#### Toolbar Buttons\r\n\r\n![launch](https://github.com/sergueik/SWET/blob/master/src/main/resources/images/launch_32.png)\r\nlaunches the browser\r\n\r\n![launch](https://github.com/sergueik/SWET/blob/master/src/main/resources/images/find_32.png)\r\ninjects the [SWD Element Searcher script](https://github.com/sergueik/SWET/blob/master/src/main/resources/ElementSearch.js)\r\ninto the page, then starts polling the page waiting for user to select some element via ![SWD Mouse Action](https://github.com/sergueik/SWET/blob/master/screenshots/ctrl_right_button_bw_32.png) CTRL + right click and to fill and submit the form:\r\n![SWD Table](https://github.com/sergueik/SWET/blob/master/screenshots/swd_table.png)\r\n\r\nThe Java reads back the result once it available and adds a breadcrump button:\r\n![breadcumps](https://github.com/sergueik/SWET/blob/master/screenshots/breadcumps.png)\r\n\r\nThe breadcrump button opens the form dialog with the details of the element:\r\n![form](https://github.com/sergueik/SWET/blob/master/screenshots/form.png)\r\n\r\nThe save and load buttons\r\n![flowchart](https://github.com/sergueik/SWET/blob/master/src/main/resources/images/save_32.png)\r\n![flowchart](https://github.com/sergueik/SWET/blob/master/src/main/resources/images/open_32.png)\r\nsave  and restore the test session in YAML format.\r\n![flowchart](https://github.com/sergueik/SWET/blob/master/screenshots/open_sesssion.png)\r\n\r\nThe code generation button\r\n![flowchart](https://github.com/sergueik/SWET/blob/master/src/main/resources/images/codegen_32.png)\r\n\r\nstarts code generation using [Jtwig](http://jtwig.org/) tempate and `elementData` hash and opens result in a separate dialog:\r\n![codegen](https://github.com/sergueik/SWET/blob/master/screenshots/codegen.png)\r\n\r\nThe flow export toolbar buton ![flowchart](https://github.com/sergueik/SWET/blob/master/src/main/resources/images/excel_gen_32.png)\r\nconverts SWET recording into a Keyword Driven Framework flow that can be later saved in the Excel file.\r\nThere exist a big number of Keyword-Driven Frameworks with Selenium, e.g. [sergueik/skdf](https://github.com/sergueik/skdf). These allow storing the test flow in e.g. Excel file in a format:\r\n![icon](https://github.com/sergueik/SWET/blob/master/screenshots/table_editor_view.png)\r\nThe actual keyword (like *clickButton*, *getText* , *verifyAttr*  or something else) of the step is not known during the recording, and has to be filled using this form.\r\nThe rest of the columns gets read from the saved recording.\r\nIt is possible to save the resul as Excel file:\r\n![icon](https://github.com/sergueik/SWET/blob/master/screenshots/exported_flow.png)\r\n\r\nThe preferences button\r\n![preferences](https://github.com/sergueik/SWET/blob/master/src/main/resources/images/gear_36.png)\r\nopens the configuration dialog\r\n![config](https://github.com/sergueik/SWET/blob/master/screenshots/config.png)\r\nCurrently the browser and template selection are configurable, one also can set the base URL.\r\n\r\nCurrently project is hardcoded to start using Chrome browser on Windows, Safari on Mac and Firefox on the rest of platforms.\r\nAlternative  browser can be selected during the session, but this preference is not saved.\r\nSaving / loading the session configuration from the YAML configuration file is a work in progress.\r\n\r\n#### Operation\r\nBoth __SWD__ and __SWET__ inject certain Javascript code `ElementSearch.js` into the page, that the user may interact with with the ![SWD Mouse Action](https://github.com/sergueik/SWET/blob/master/screenshots/ctrl_right_button_bw_32.png) CTRL key + mouse right-click.\r\nAfter injecting the script the IDE waits polling for the speficic\r\n`document.swdpr_command` object to be created on that page. This object is created  by the `ElementSearch.js`\r\nafter user selects the specific element on the page, fills the form defining the *name* of that element\r\nand confirms the selection by clicking the 'Add Element' button.\r\nThe `document.swdpr_command` object received by SWD application will contain the following properties of the selected element:\r\n\r\n* Legacy \"indexed\" xpath, that looks like `/div[1]/div[1]/table[1]/tbody[1]/tr[1]/td[1]/a[1]/img[1]` - all node attributes are ignored, sibling counts are evaluated.\r\n* Attribute-extended xpath that looks like `//a[@href=\"/script/answers\"]/img[@src=\"https://codeproject.net/images/question.png\" and @alt = 'post an article' ]`\r\n* Firebug-style css selector, that look like `ul.nav-links li.nav-links__item div.central.featured.logo-wrapper \u003e img.central.featured-logo` every classes node has all class attributes attached.\r\n* Element text (translated under the hood into XPath `[contains()]` expression).\r\n* Input for Angular Protractor-specific locators `repeater`, `binding`, `model`, `repeaterRow` etc. (WIP)\r\n* Element ID (when available)\r\n* Element tag name, which is often helpful together with element's text content in constructing element  locators like\r\n```c#\r\nIWebElement element = driver.FindElements(By.TagName(\"{{TAG_NAME}}\")).First(o =\u003e String.Compare(\"{{TEXT}}\", o.Text, StringComparison.InvariantCulture) == 0);\r\n```\r\nor\r\n```java\r\nWebElement element = driver.findElement(\r\nBy.xpath(\"//{{TAG_NAME}}[contains(normalize-space(text()), '{{TEXT}}')]\")\r\n```\r\nor\r\n```java\r\nWebElement element = driver.findElements(  By.tagName(\"{{ {{TAG_NAME}} }}\"\r\n            .stream().filter(o -\u003e o.getText().contains(\"{{ TEXT }}\") ).findFirst();\r\n```\r\n#### Automation of Locator Shortening\r\nAuto-generated locators often become unnecessarily long, e.g. for the facebook logo one may get:\r\n```css\r\ndiv#blueBarDOMInspector \u003e div._53jh \u003e div.loggedout_menubar_container \u003e\r\ndiv.clearfix.loggedout_menubar \u003e div.lfloat._ohe \u003e\r\nh1 \u003e a \u003e i.fb_logo.img.sp_Mlxwn39jCAE.sx_896ebb\r\n```\r\nCurrently __SWET__ has no algorythm for shortening such locators.\r\nAdding a smart locator trimmers is a work in progress.\r\n\r\n### Dependencies Versions\r\n\r\nAs typical with Selenium, the __SWET__ application only run smoothly  with certain Selenium jar version and it's compatible\r\nversion of browser driver and browser itself is used.\r\nThe __SWET__ application master branch is being developed with\r\n\r\n|                      |              |\r\n|----------------------|--------------|\r\n| SELENIUM_VERSION     | __3.5.1__    |\r\n| FIREFOX_VERSION      | __45.0.1__   |\r\n| CHROME_VERSION       | __61.0.X__   |\r\n| CHROMEDRIVER_VERSION | __2.32__     |\r\n\r\nand\r\n\r\n|                      |              |\r\n|----------------------|--------------|\r\n| SELENIUM_VERSION     | __2.53.1__   |\r\n| FIREFOX_VERSION      | __45.0.1__   |\r\n| CHROME_VERSION       | __56.0.X__   |\r\n| CHROMEDRIVER_VERSION | __2.29__     |\r\n\r\n\r\nSome of partially supported version combinations are listed below. Some versions of Selenium ( __3.0.1__ or __3.3.1__ ) have been found unstable.\r\n\r\n|                      |              |\r\n|----------------------|--------------|\r\n| SELENIUM_VERSION     | __3.2.0__    |\r\n| FIREFOX_VERSION      | __52.0__ (32 bit)     |\r\n| GECKODRIVER_VERSION  | __0.14__ (32 bit)    |\r\n| CHROME_VERSION       | __57.0.X__   |\r\n| CHROMEDRIVER_VERSION | __2.29__     |\r\n\r\nBranches selenium_301 and selenium_3x created until this code is stable in the original project location (`https://github.com/sergueik/selenium_java/tree/master/swd_recorder`).\r\nStabilizing against the most recent builds of Selenium is a work in progress.\r\n\r\nOne can download virtually every old build of Firefox from\r\nhttps://ftp.mozilla.org/pub/firefox/releases, and selected old builds of Chrome from\r\nhttp://www.slimjetbrowser.com/chrome/, for other browsers the download locations vary.\r\n\r\nThis is why it may be worthwhile setting up Virtual Box e.g. [selenium-fluxbox](https://github.com/sergueik/selenium-fluxbox) to run the appliation with fixed downlevel browser versions.\r\n\r\n### Safari Testing\r\nIf you have Mac 10.12.X Sierra / Safari 10.X , then the Apple Safari driver would be installed automatically,\r\nbut it does not seems to work with Selenium __2.53__.\r\nFor earlier OS X releases, you have to downgrade the Selenium version in the `pom.xml` to __2.48__\r\nthen follow the [Running Selenium Tests in Safari Browser](http://toolsqa.com/selenium-webdriver/running-tests-in-safari-browser).\r\n\r\n### Code Templates\r\n\r\nThe code is generated using [jtwig](http://jtwig.org/) templates which look like\r\n```java\r\n{#\r\ntemplate: Basic Page Objects (Java)\r\n#}\r\nclass TestPage (Page) {\r\n  // {{ ElementText }}\r\n  {% if (ElementSelectedBy == 'ElementCssSelector') -%}\r\n  @FindBy( how = How.CSS, using = \"{{ ElementCssSelector }}\" )\r\n{% elseif (ElementSelectedBy == 'ElementXPath') -%}\r\n  @FindBy( how = How.XPATH, using = \"{{ ElementXPath }}\" )\r\n{% elseif (ElementSelectedBy == 'ElementId') -%}\r\n  @FindBy( how = How.ID, using =  \"{{ ElementId }}\" )\r\n{% endif -%}\r\n{% if (ElementVariable != '') -%}\r\n  private WebElement {{ ElementVariable }};\r\n{% else -%}\r\n  private WebElement element;\r\n{% endif -%}\r\n```\r\nAny language syntax can be supported. The comment\r\n```java\r\n{#\r\ntemplate: Name of the Template\r\n#}\r\n```\r\nis reserved for the name of the template, when creator is allowed to provide the path to template during session configuration -  every teplate file `template.twig` will be found and added to the formatter selection\r\n(one may need to reopen the configuration dialog to actually see the new templates). For the example above it will be shown as\r\n\r\n![Ubuntu Example](https://github.com/sergueik/SWET/blob/master/screenshots/config_browse.png)\r\n![Ubuntu Example](https://github.com/sergueik/SWET/blob/master/screenshots/config_browse_result.png)\r\n\r\n\r\n### Configuration, saving and loading\r\n\r\n__SWET__ may be saved the element locators in the YAML format, using [snakeyaml](https://bitbucket.org/asomov/snakeyaml). Example:\r\n```yaml\r\nversion: '1.0'\r\ncreated: '2017-02-21'\r\nseleniumVersion: '2.53.1'\r\n\r\n# Browser parameters\r\nbrowser:\r\n  name: firefox\r\n  platform: linux\r\n  version: '45.0.1'\r\n\r\n# Browser parameters\r\nbrowser:\r\n  name: chrome\r\n  platform: windows\r\n  version: '54.0.2840.71'\r\n  driverVersion: '2.24'\r\n  driverPath: 'c:/java/selenium/chromedriver.exe'\r\n\r\n# Selenium Browsers\r\nbrowsers:\r\n  - chrome\r\n  - firefox\r\n\r\n# Elements\r\nelements:\r\n  ce094429-d4bd-4eb0-83ab-6d10c563f456:\r\n    ElementCssSelector: div[id = \"page-body\"] \u003e div.main-container \u003e section.main-content \u003e div.main-content-right \u003e div.row.highlight \u003e section.card.titled \u003e section.project-info \u003e header \u003e h3 \u003e a\r\n    ElementCodeName: 'sourceforge project link'\r\n    Command: AddElement\r\n    Caller: addElement\r\n    ElementPageURL: https://sourceforge.net/\r\n    CommandId: ce094429-d4bd-4eb0-83ab-6d10c563f456\r\n    ElementStepNumber: 1\r\n    ElementSelectedBy: ElementXPath\r\n    ElementText: Staff Choice Outlook CalDav Synchronizer\r\n    ElementId: ''\r\n    ElementVariable: userSelectedVariableName\r\n    ElementXPath: id(\"page-body\")/div[1]/section[1]/div[2]/div[2]/section[1]/section[2]/header[1]/h3[1]/a[@href=\"/projects/outlookcaldavsynchronizer/?source=frontpage\u0026position=1\"]\r\n```\r\n### Custom Configuration\r\nThe __SWET__  configirarion file is in `src/main.resources/application.properties`:\r\n```java\r\nusername: username\r\npassword: password\r\n# no quotes around paths. Trailing whitespace is ok\r\n# use the following syntax for environment variables: ${USERPROFILE}\\\\desktop\\\\chromedriver.exe\r\nchromeDriverPath: ${USERPROFILE}\\\\desktop\\\\chromedriver.exe\r\ngeckoDriverPath: c:/java/selenium/geckodriver.exe\r\nfirefoxBrowserPath: c:/Program Files (x86)/Mozilla Firefox/firefox.exe\r\nieDriverPath: c:/java/selenium/IEDriverServer.exe\r\n```\r\nThe `username` and `password` entris are not currently used - these are reserved for possible users with accounts on Sauce Labs or browserStack.\r\n\r\n### Testing Individual Forms\r\nOne can useshell / cmd script to build and test individual forms (`ElementAttributeEditor`, `RecorderConfigurationEditor`, `ScrolledTextEx` etc.) like\r\n```cmd\r\nrun.cmd ElementAttributeEditor\r\n```\r\nand \r\n```powershell\r\n./run.ps1 ElementAttributeEditor\r\n```\r\nand\r\n```sh\r\n./run.sh ElementAttributeEditor\r\n```\r\n* one can pass form arguments field by field like\r\n```cmd\r\nrun.cmd ElementAttributeEditor -init -ElementCodeName test123\r\n```\r\nor to skip time consuming compilation part one can\r\n```cmd\r\njava  -cp \"target\\swet-0.17.0-SNAPSHOT.jar;target\\lib\\*\"  com.github.sergueik.swet.ElementAttributeEditor -init -ElementSelectedBy ElementCssSelector -ElementCssSelector a#myid -ElementId myid -ElementXPath //div[@someclass]/a\r\n```\r\nor\r\n```cmd\r\nlaunch.cmd ElementAttributeEditor -init -ElementSelectedBy ElementCssSelector -ElementCssSelector a#myid -ElementId myid -ElementXPath //div[@someclass]/a\r\n```\r\n![Custom Argument init Example](https://github.com/sergueik/SWET/blob/master/screenshots/init_with_custom_arguments.png)\r\n\r\n__Note:__\r\nPowershell is rejecting undeclated arguments and refusing to run e.g.\r\n```powershell\r\n ./run.ps1 ElementAttributeEditor \"-init\" \"-ElementSelectedBy\" \"ElementCssSelector\" \"-ElementCssSelector\" \"a#myid\"  \"-ElementXPath\" \"//div[@someclass]/a\"\r\n```\r\nleads to\r\n```powershell\r\nrun.ps1 : A positional parameter cannot be foundthat accepts argument '//div[@someclass]/a'.\r\n```\r\n### License\r\n\r\n__SWET__is licensed under Apache License, Version 2.0\r\n\r\n### Links\r\n\r\n#### SWT\r\n\r\n  * [main SWT snippets directory](https://www.eclipse.org/swt/snippets)\r\n  * [SWT examples on javased.com](http://www.javased.com/?api=org.eclipse.swt.widgets.FileDialog)\r\n  * [SWT - Tutorial by Lars Vogel, Simon Scholz](http://www.vogella.com/tutorials/SWT/article.html)\r\n  * [Opal Project (SWT new widgets library) by Laurent Caron](https://github.com/lcaron/opal)\r\n  * [Nebula - Supplemental Widgets for SWT](https://github.com/eclipse/nebula)\r\n  * [danlucraft/jruby-swt-cookbook](https://github.com/danlucraft/jruby-swt-cookbook)\r\n  * Misc. [SWT widgets](https://github.com/greipadmin/greip), in particular, the `StyledLabel`\r\n  * [swt Ruby gem](https://github.com/danlucraft/swt)\r\n  * [fab1an/appkit toolkit for swt app design](https://github.com/fab1an/appkit)\r\n  * [SWT dependency repositories](http://stackoverflow.com/questions/5096299/maven-project-swt-3-5-dependency-any-official-public-repo)\r\n  * [SWT jar ANT helper](http://mchr3k.github.io/swtjar)\r\n  * [Examples](http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/CatalogSWT-JFace-Eclipse.htm)\r\n  * [Examples](https://github.com/ReadyTalk/avian-swt-examples)\r\n  * [swt-bling](https://github.com/ReadyTalk/swt-bling)\r\n  * [int32at/sweaty](https://github.com/int32at/sweaty)\r\n  * [Multiplatform SWT](https://github.com/jendap/multiplatform-swt)\r\n  * [SWT Single Jar Packager](https://github.com/mchr3k/swtjar)\r\n  * [SWT custom preference dialog](https://github.com/prasser/swtpreferences) - needs too recent versions of SWT and JFace\r\n  * [SWT multiple choice dialogs](https://github.com/prasser/swtchoices)\r\n  * [fancy custom SWT-components](https://github.com/Holzschneider/Sweater)\r\n  * [Misc JFace/SWT UI elements and utils](https://github.com/Albertus82/JFaceUtils)\r\n  * [SWT System Tray](https://github.com/dorkbox/SystemTray)\r\n  * [Chromium widget for SWT](https://github.com/maketechnology/chromium.swt) \r\n  * [Console](https://github.com/dorkbox/Console)\r\n  * [Notify](https://github.com/dorkbox/Notify)\r\n  * [System Tray](https://github.com/Vladimir-Novick/System-Tray)\r\n  * [SWT/WMI](https://github.com/ctron/wmisample)\r\n  * [SWT Tools](https://github.com/bp-FLN/SWT-Tools)\r\n  * [SWTools](https://github.com/Sanglinard26/SWTools)\r\n  * [SWT Button conrol with a drop down menu](https://github.com/SubashJanarthanan/SWT_Button_DropDown)\r\n  * [vogellacompany/swt-custom-widgets](https://github.com/vogellacompany/swt-custom-widgets) eclipse plugin\r\n  * [SWT Browser component based recorder](https://github.com/itspanzi/swt-browser-recorder-spike)\r\n  * [Joptions Pane examples](http://alvinalexander.com/java/java-joptionpane-examples-tutorials-dialogs)\r\n  * [Haixing-Hu/swt-widgets](https://github.com/Haixing-Hu/swt-widgets/wiki/Dialog)\r\n  * [SWING to SWT transformation tool](https://github.com/xgdsmileboy/SWING-SWT-Transformation)\r\n  * [SWT UI described in JSON](https://github.com/milanaleksic/baobab)\r\n  * [SWT custom components](https://github.com/SWTCustomComponents/SWTCustomComponents)\r\n  * [jGrid - styled SWT grid](https://github.com/GrandmasterTash/jGrid)\r\n  * [Eclipse SWT for Maven Users](https://github.com/maven-eclipse/maven-eclipse.github.io)\r\n  * [Kitten](https://github.com/uniquejava/KittenBox) - fully functional SWT applicaion\r\n  * eclipse [Rich Client Platform](https://www.vogella.com/tutorials/EclipseRCP/article.html) (RCP) tutorial\r\n#### Eclipse Plugins\r\n  * [Eclipse Plugin documentation](https://github.com/vtrao/Eclipse-Plugin/tree/master/Articles)\r\n  * [java2s](http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/Eclipse-Plugin.htm)\r\n  * [eclipse IDE Plug-in Development] (http://www.vogella.com/tutorials/EclipsePlugin/article.html#firstplugin_migratione4_toolbar)\r\n  * [SeleniumPlus Eclipse plugin](https://github.com/SAFSDEV/SeleniumPlus-Plugin/tree/master/samples)\r\n  * [SelenumPlus Core](https://github.com/SAFSDEV/Core/tree/master/src/org/safs/selenium)\r\n\r\n#### Code Generation\r\n\r\n  * [Jtwig](https://github.com/jtwig/jtwig)\r\n  * [Thymeleaf](http://www.thymeleaf.org/)\r\n  * [StringTemplate](http://www.stringtemplate.org/)\r\n  * [Protractor page object generator](https://github.com/pageobject-io/pageobject-generator)\r\n  * [Expression Evaluator](https://github.com/ggrandes/mapexpression) for apache commons-like `${name}` templating\r\n\r\n#### Existing Selenium Test Generation recorders and plugins\r\n\r\n  * [Selenium IDE New gen](https://github.com/SeleniumHQ/selenium-ide/tree/v3/packages) WebExtension code export feature - note, need to switch to `v3` or one of the `code-export` branches to browse the code in github. Currently exportting into Java, C#, Javascript, Ruby, Python\r\n  * Applitools [Selenium IDE NG](https://applitools.com/blog/why-selenium-ide-2019) promo presentation \r\n  * [Katalon Recorder](https://github.com/katalon-studio/katalon-recorder/tree/master/panel/js/katalon/selenium-ide/format/java) supports a number of formatters, likely inherited from old Selenium IDE\r\n  * [Katalon Studio overview (in Russian)](http://www.software-testing.ru/library/testing/testing-automation/2551-katalon-studio), official memo covering [Katalon Studio GUI Linux version](https://docs.katalon.com/katalon-studio/docs/katalon-studio-gui-beta-for-linux.html)\r\n  * [Muse Test Framework](https://github.com/ChrisLMerrill/muse), [Muse examples](https://github.com/ChrisLMerrill/muse-examples), [Muse IDE](https://github.com/ChrisLMerrill/muse-pageobjects)\r\n  * [Bromiomi browser based framework for running automated integration and end-to-end tests](https://github.com/hristo-vrigazov/bromium)\r\n  * [alibaba/uirecorder](https://github.com/alibaba/uirecorder)\r\n  * [selenium2/webdriver test script recorder](https://github.com/fudax/selenium_recorder), uses Swing\r\n  * [top 10 test automation instruments](http://automated-testing.info/t/top-10-instrumentov-avtomatizaczii-testirovaniya-2018/17404)(in russian)\r\n  * [links in the Selenium IDE retirement memo](https://blog.testproject.io/2017/09/03/farewell-selenium-ide/)\r\n  * [CognizantQAHub/Cognizant-Intelligent-Test-Scripter](https://github.com/CognizantQAHub/Cognizant-Intelligent-Test-Scripter)\r\n  * [CITS IE Toolbar (c#)](https://github.com/CognizantQAHub/Cognizant-Intelligent-Test-Scripter-IE-Toolbar)\r\n  * [CITS-Chrome-Extension](https://github.com/CognizantQAHub/Cognizant-Intelligent-Test-Scripter-Chrome-Extension)\r\n  * [CITS-Firefox-Addon](https://github.com/CognizantQAHub/Cognizant-Intelligent-Test-Scripter-Firefox-Addon)\r\n  * [IntelliJ Selenium Plugin](http://perfect-test.com/index.php/ru/instruments-rus-menu/15-selenium-plugin-rus), [форум](http://automated-testing.info/t/intellij-selenium-plugin-novyj-plagin-dlya-uproshheniya-sozdaniya-java-webdriver-testov/6514/39)\r\n  * [ ui-automation-chrome-extension](https://github.com/TsvetomirSlavov/ui-automation-chrome-extension) - see implementations of `XPathGenerator.js` and `CSSGenerator.js`\r\n  * [wsbaser/Natu.WebSync.Chrome](https://github.com/wsbaser/Natu.WebSync.Chrome)\r\n  * [watarus-nt/SeleniumGenerator](https://github.com/watarus-nt/SeleniumGenerator)\r\n  * [Silk-WebDriver (not open source)](https://community.microfocus.com/borland/test/silk-webdriver/)\r\n  * [SnapTest](https://www.snaptest.io/) (no source on github -  have to download the `.crx` and find it in `%USERPROFILE%\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\Extensions\\aeofjocnhdlleichkjbaibdbicpcddhp\\0.6.9_0\\manifest.json` )\r\n  * [ChroPath Chrome extension](https://chrome.google.com/webstore/detail/chropath/ljngjbnaijcbncmcnjfhigebomdlkcjo?hl=en)\r\n  * [ChroPath for Firefox (claims to be compatible only with FF 48+)](https://addons.mozilla.org/en-US/firefox/addon/chropath-for-firefox/)\r\n  * [Catchpoint Script Recorder (alternative download of version 1.9.5 (ondjkacanajgdlnhcnpiapajjpgilplo), no longer in App Store)](https://www.crx4chrome.com/crx/49424/)\r\n  * [FireBreath cross-platform browser plugin framework](https://github.com/firebreath/FireBreath) see also [](https://www.firebreath.org/)\r\n  * [UI Recorder (nodejs)](https://github.com/alibaba/uirecorder)\r\n  * [AutonomiQ - Test Data  / Test Script Generation - commercial](https://autonomiq.io/) \r\n  * Marathon V5 - Opensource Test Automation for Java/Swing and Java/FX Application [home page](https://marathontesting.com) and github [project](https://github.com/jalian-systems/marathonv5) - commercial\r\n\r\n#### Selenium Locator Strategies\r\n\r\n  * [Choosing Effective XPaths](http://toolsqa.com/selenium-webdriver/choosing-effective-xpath/)\r\n  * [Use XPath locators efficiently](http://bitbar.com/appium-tip-18-how-to-use-xpath-locators-efficiently/)\r\n  * [XPath-Finder](https://chrome.google.com/webstore/detail/xpath-finder/edglefgecckonkgchckokopkibcpbojb)\r\n  * [XPath-Helper](https://chrome.google.com/webstore/detail/xpath-helper/hgimnogjllphhhkhlmebbmlgjoejdpjl)\r\n  * [CSS Selector Tester](https://chrome.google.com/webstore/detail/css-selector-tester/bbklnaodgoocmcdejoalmbjihhdkbfon)\r\n\r\n#### YAML\r\n  * [snakeyaml](https://bitbucket.org/asomov/snakeyaml)\r\n\r\n#### Javascript injection\r\n  * [Keymaster](https://github.com/madrobby/keymaster)\r\n  * [SeleniumPlus WebDriver user-extensions.js](https://github.com/SAFSDEV/Core/blob/master/src/org/safs/selenium/user-extensions.js)\r\n\r\n#### Misc.\r\n\r\n  * [AnarSultanov/InstalledBrowsers](https://github.com/AnarSultanov/InstalledBrowsers)\r\n  * [how to define conditional properties in maven](http://stackoverflow.com/questions/14430122/how-to-define-conditional-properties-in-maven)\r\n  * [eclipse xwt](https://wiki.eclipse.org/XWT_Documentation)\r\n  * [mono/xwt](https://github.com/mono/xwt)\r\n  * Introduce the GUI program of Java Swing using [small source code examples](https://github.com/aterai/java-swing-tips) - a huge Swing example collection\r\n  * [json2](https://github.com/douglascrockford/JSON-js)\r\n  * [geckodriver](http://www.automationtestinghub.com/selenium-3-0-launch-firefox-with-geckodriver/)\r\n  * [jProcesses](https://github.com/profesorfalken/jProcesses)\r\n  * [jedi-tester/Ext2POI](https://github.com/jedi-tester/Ext2POI)\r\n  * [free java license-management projects](http://freshmeat.sourceforge.net/tags/license-management)\r\n  * [Hamcrest tutorial](http://www.vogella.com/tutorials/Hamcrest/article.html)\r\n  * [Autoit documentation](https://www.autoitscript.com/autoit3/docs/introduction.htm)\r\n  * [Autoit JNA wrapper](https://github.com/midorlo/JNAutoIt), also forked. \r\n  * [Autoit COM jva bridge](https://github.com/accessrichard/autoitx4java)\r\n  * [Mock server](https://github.com/jamesdbloom/mockserver)\r\n  * list of recent APM [vendors](https://stackify.com/application-performance-management-tools/)  \r\n### Note\r\n\r\n[Swet](http://www.urbandictionary.com/define.php?term=swet\u0026defid=6820405) - according to \r\nurbanictionary, describes *something that's hot. Or something that would typically take a lot of skill and practice to do, therefore causing the person to sweat*.\r\n\r\n####  Source Code History\r\n\r\nThe code was originally located inside a much larger repository: `https://github.com/sergueik/selenium_java/tree/master/swd_recorder`.\r\nOn April 11 2017 the master branch HEAD was copied into separate project, to track past histories and branches please review the original project location.\r\n\r\n### License\r\nThis project is licensed under the terms of the MIT license.\r\n\r\n### Author\r\n[Serguei Kouzmine](kouzmine_serguei@yahoo.com)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergueik%2Fswet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsergueik%2Fswet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergueik%2Fswet/lists"}