{"id":22531386,"url":"https://github.com/owaismohsin001/ba-test","last_synced_at":"2026-05-10T16:13:37.313Z","repository":{"id":193433076,"uuid":"234370873","full_name":"owaismohsin001/BA-Test","owner":"owaismohsin001","description":"This is an extensible DSL made with selenium and python for browser automation test writing with very simple and elegant syntax. Deprecated in favor of BWTest","archived":false,"fork":false,"pushed_at":"2020-05-23T14:27:52.000Z","size":114,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T05:19:16.580Z","etag":null,"topics":["automation","automation-library","browser-automation","domain-specific-language","dsl","selenium","selenium-python","selenium-webdriver","test-automation"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/owaismohsin001.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}},"created_at":"2020-01-16T17:11:10.000Z","updated_at":"2020-05-23T14:28:43.000Z","dependencies_parsed_at":"2023-09-08T06:52:02.793Z","dependency_job_id":null,"html_url":"https://github.com/owaismohsin001/BA-Test","commit_stats":null,"previous_names":["ameerwasi001/ba-test","zaidharoon001/ba-test","owaismohsin001/ba-test"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/owaismohsin001/BA-Test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owaismohsin001%2FBA-Test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owaismohsin001%2FBA-Test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owaismohsin001%2FBA-Test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owaismohsin001%2FBA-Test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/owaismohsin001","download_url":"https://codeload.github.com/owaismohsin001/BA-Test/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owaismohsin001%2FBA-Test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272805571,"owners_count":24995916,"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-08-30T02:00:09.474Z","response_time":77,"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":["automation","automation-library","browser-automation","domain-specific-language","dsl","selenium","selenium-python","selenium-webdriver","test-automation"],"created_at":"2024-12-07T08:07:16.448Z","updated_at":"2026-05-10T16:13:32.286Z","avatar_url":"https://github.com/owaismohsin001.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Browser Automation-Test\nThis is an extensible DSL made with selenium and python for browser automation test writing with very simple and elegant syntax. It has been deprecated in favour of it's successor [BWTest](https://github.com/ameerwasi001/BWTest)\n\n# Supported Browsers\nIt supports every browser that selenium supports meaning Firefox, Chrome, Safari, Edge and Internet Explorer 3 and drivers for all of them will be required.\n\n# The knowledge required beforehand\nThere's very little knowledge required beforehand for starting working with this DSL because the only things you need to know are CSS selectors and xpath which is directly accessible in this language but it's totally not for someone who hasn't done any testing before because it has the exact same workflow of selecting elements in a variable and writing or clicking on them.\n\n# Selectors\nThere are many methods with which elements can be selected and here are the mthods that are currently supported.\\n\n```\nget_element_by_name\nget_element_by_id\nget_element_by_xpath\nget_element_by_class\nget_element_by_tag\nget_element_by_link_text\nget_element_by_css_selector\n```\nIn future there are plans for more selectors that just use xpath under the hood.\n\n# Syntax\nThis language has very few syntax gotcha's but it still has some and here's the basic syntax that you would need to know to start doing browser testing in this language.\n\n## Starting a web browser\n```start =\u003e chrome, C:/Browserdriver/chromedriver.exe```\n\nSo, yeah you say start, then assign arguments using this sign `=\u003e` and the only two arguments seprated by `,` are the browser you are going to use and the path to the driver. \n\n## Visiting a website\n```visit =\u003e https://www.google.com/```\n\nYep, it's that simple you just go ahead and say visit, then assign arguments using this sign `=\u003e` and the only required argument here is the URL of the website you want to visit but make sure to add `http://www.`, because BA-Test at least for now doesn't recognize URLs without this beginning.\n\n## Selecting an element\nSimilar to what we had done above we will just\n\n```get_element_by_name =\u003e q, google_search```\n\nbut in this particular instance we assign two arguments seprated by `,` and the first argument asks for the name that you want it to search for, in a page while the second one asks for the name that you want to store it with so that you can use it later in rest of your test.\n\nOther methods can be used in a similar manner, by just providing name, id or xpath respectively.\n\n## Writing on an element\n```write =\u003e google_search, 'PyCon is big'```\n\nYou might write on an element by first calling the name you used to store the found element which may or may not be more than one which in our case it's not so we don't need to pass any optional arguments so, the next argument here is and string because it contains spaces but if it didn't then we could have just typed `PyCon is big` instead of `'PyCon is big'` which requires either double or single quotes.\nThe write method presses enters unless you pass an optional argument `enter-\u003efalse` in the same line.\n\n## Action Chains\n### Action initialization\nAction chains need to be intialized before using and it can be done by simply saying something along the lines of what follows\n\n```action_initialize```\n\n### Action Methods\n#### Text Action\nThis function command named ```text_action``` sends some text over to the currently focused field, it takes two arguments but one of them is required and it is, ```text_args``` and it as you have probably guessed takes text arguments that you want to be typed and the second one which is optional is named enter and is by default true and if you don't want to hit enter after sending the text then you should make it False. Some Sample code it's usage is what follows.\n\n```\nvisit =\u003e https://www.google.com/\naction_initialize\ntext_action =\u003e \"That's true\"\naction_perform\nsleep =\u003e 10\nclose\n```\n\n#### Perform\nPerhaps the simplest to use yet the most important in the entire action chain section is this one because it makes you be able to perform actions when you are done linking them up and it's used something like what follows\n\n```action_perform```\n\n## Switching between windows\nIn web applications, it's common to have multiple windows and in order to switch between them you should use `switch_to`, and in order  to do that you must be able to provide the name of the window as an argument to this command. Following is a way of using this command.\n\n```switch_to =\u003e myWin```\n\n## Wait\nIn the process of testing you may want to wait for certain things to happen, even though going to website by either clicking or visiting through the methods alredy does so but, you now can wait by sleeping, meaning using sleep method.\n\n```sleep =\u003e 10```\n\nThe above as you might have guessed asks system to wait for 10 seconds before doing anything else.\n\n## Comments\n```# Hey, this part finds search results```\n\nSome times you might want to write some arbitrary text for someone reading your code and to do so you can do what's done above and start your line by `#` symbol.\n\n## Indexed elements\nIf we ask for an element where multiple search results are found this stores them in a list by index starting from 0 so that you can call it with index whenever required. What follows is an example for you to find search results through xpath and store all of them in a list.\n```\nget_element_by_xpath =\u003e //h3[@class='LC20lb'], results\nclick =\u003e results, index-\u003e1\n```\n\nWhile the first one is quite self explanatory the second one needs an explanation about the optional argument `index` being passed, it says that click the second index of the found results because results start from 0, so what it'll do is click the second index meaning the index number one which correlates to the second search result.\n\n## Close\n`close`\n\nIf you decide to close your window after a certain test is done, then you can use the `close` method with no arguments passed whatsoever.\n\n## Variables\nThis language can help you store, read and re-evaluate certain variables namely strings, floats and integers.\n### Setting a variable\nSetting a variable is quite simple, you can just state\n```\nSET =\u003e int =\u003e wait = 2\n```\nSetting an integer is as simple as that and we can do the same for setting strings and floats.\n### Getting a variable\nGetting a variable is just as simple, you can just state\n```\nGET =\u003e wait\n```\nanywhere in the program so you might be thinking about how you can assign a variables value to an argument.\n```\nsleep =\u003e GET =\u003e wait\n```\nand the same thing can be done with optional arguments.\n\n### Basic math with a variable\nAll basic math can be done with variables in BA-Test like this,\n```\nEVALUATE =\u003e ((get \u003e wait + 1 - get \u003e wait)*2)/2\n```\nwhere `get\u003e` gets the variable and then the next thing is to assign it to a certain method like what follows,\n```\nsleep =\u003e wait -\u003e EVALUATE =\u003e ((get \u003e wait + 1 - get \u003e wait)*2)/2\n```\nthanks, for reading through and we'll hope you'll continue to use BA-Test.\n\n# Development\nWait, were you a developer looking for a test writing DSL for your testers or business people to use and for you to extend we got you. This language has a file named `extensions.py` where you can write methods and they will be directly accessible in this language and what follows is a plethora of things you would need to know before you can start extending this DSL to meet your needs.\n\n## Global variables\nThere are a few global variables used as memory for BA-Test, the first one is **driver** which is the driver we want to use for browser automation, **ActionChain** which is initialized by action_initialize and is responsible for all actions in action chain, the second one is **elements** which ofcourse is the memory used to store elements, and the last one is **variables** which is the memory we use to store variables being set by users.\n\n## findElement\nYou would have to use this function to find an element and whenever you'd have to find an element from global element you must have an element and an index argument which by default should be `None`, and what follows is an example extension of this file where I make another function to click a button.\n```\ndef testClicker(element, index=None):\n  findElement(element, index).click()\n```\n## listOrNot\nThis is used to check the given element appropriately and to convert list to an element if nessecary and to raise appropriate errors if required and what follows is an example for a `find_element_by_class` method in extensions.\n```\ndef find_element_by_class(elem_class, index):\n  global elements\n  elements[index] = driver.find_elements_by_class_name(elem_class)\n  listOrNot(index)\n```\n## str2bool\nEverything given by the language is a string with certain exceptions specifically variables inside global variable memory and what follows is an example of where it might be used\n```\nif str2bool(enter):\n  print(\"we are going to press enter\")\n```\n# What's to come\nSome of the examples such as the \"class\" one is implemented in the core language now, more optimizations will be done for this language and more functions for developers' convenience will also be avalible.\n\n# Thanks\nThis time for real, thanks for reading through and we hope to thank you for using this language for test writing purposes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowaismohsin001%2Fba-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fowaismohsin001%2Fba-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowaismohsin001%2Fba-test/lists"}