Skip to content

NagiPragalathan/No_Code_Testing

Repository files navigation

NCTP-No Code Automation Testing in Python using Selenium

GitHub GitHub contributors GitHub top language Telegram Contributions welcome Read FAQ GitHub Repo stars Twitter Follow

NCTP is an No Code Automation Testing in Python using Selenium. It helps the testers to automate their testcases using a json file. It limits the scalability and less complexity to test the application.! Why? Because It's over 9000!!!!!.

It is a work in progress, and it is not ready for production.

Getting startedSupported opcodesBuildTestReport a bugQuestions

Fear of coding the testing files use the NCTP to releive your complexity and upgrade your automation using NCTP for your application.

Setup:

1. Installation:

install using the command: pip install nctp

2. Usage:


{ 
"setup":{
"driver_path" : "C:/Users/nagip/Desktop/New_folder/chromedriver.exe",
"auto_install":"true",
"browser":"Opera",
"get":"https://www.saucedemo.com/",
"window" : "maximize"
"screen_recorder":"true", "run_amd_wait":"true" }
}

It is the keyword mandatory to use in the NCTP.
  1. driver_path: give the location of the selenium chrome driver path.
  2. auto_install: This key is used to download the chrome driver automatically and install it.
  3. browser: The browser that you recommend for the auto install.
  4. get: The URL of the landing page.
  5. window: Always recommended to use the maximize one. Minimize also can be used if needed.
  6. screen_recorder: It records the testing from beginning to end.
  7. run_and_wait: It waits the window of the browser to run the program.
  8. Auto_install can run the folowing browsers:
        1. Chrome
        2. ChromeService
        3. Brave
        4. BraveService
        5. Firefox
        6. FirefoxService
        7. IE
        8. IEService
        9. Edge
        10. EdgeService
        11. Opera

3. Get Elements

get_ids = ['id','name','class','xpath']

'id': It get the id elements using this keyword. 
'name': It get the name elements using this keyword.
'class': It get the class elements using this keyword.
'xpath': It get the xpath elements using this keyword.

Examples:

{   
    "setup":{
        "driver_path" : "C:/Users/nagip/Desktop/New_folder/chromedriver.exe",
        "auto_install":"true",
        "browser":"Opera",  //
        "get":"https://www.saucedemo.com/", //
        "window" : "maximize" //
    },
    "login_testing":{
        "fill_user_name" : {
            "id" : "user-name:sk:minimize",
            "data" : "standard_user"
        },
        "fill_password":{
            "id":"password:sk",
            "data":"secret_sauce"
        },
        "click_login_btn":{
            "id":"login-button:click"
        }
    },
 }

Click the list of Elements line by line at a time

list_data = ['ls_id_clk','ls_name_clk','ls_xpath_clk']

{   
    "setup":{
        "driver_path" : "C:/Users/nagip/Desktop/New_folder/chromedriver.exe",
        "auto_install":"true",
        "browser":"Opera",  //
        "get":"https://www.saucedemo.com/", //
        "window" : "maximize" //
    },
    "login_testing":{
        "fill_user_name" : {
            "id" : "user-name:sk:minimize",
            "data" : "standard_user"
        },
        "fill_password":{
            "id":"password:sk",
            "data":"secret_sauce"
        },
        "click_login_btn":{
            "id":"login-button:click"
        }
    },
    "home_page":{
        "ls_id_clk" : ["add-to-cart-sauce-labs-backpack","add-to-cart-sauce-labs-bike-light","add-to-cart-sauce-labs-fleece-jacket"],
        "ls_name_clk" : ["add-to-cart-test.allthethings()-t-shirt-(red)","add-to-cart-sauce-labs-bolt-t-shirt","add-to-cart-sauce-labs-onesie"]
    },
    "view_cart":{
        "select_select_box":{
            "xpath":"//*[@id='header_container']/div[2]/div[2]/span/select:select_by_index@2"   
        },
        "nav_to_view_cart":{
            "xpath": "//*[@id='shopping_cart_container']/a:click:minimize",
            "window":  "maximize"
        }
    }
}

ScreenShot and ScreenRecorder

"screen_recorder":"true": It records the testing with fullscreen from beginning to end. It should be impleted only in the setup query. It store in the Test_Video folder path.
"take":"screenshot": It takes the screenshot of the task. It can be impletmented at any line of code. It store in the ScreenShots folder path.

Keywords

Send Keys

  1. sk: Send keys. It help to send the keys to the input field. It can be send using two ways using :sk and :sk@data. If :sk is used alone then we should declare the data in another line.
  2. 'c&sk': It clears the data and send the keys to the input field similar to sk.
 "fill_password":{
            "id":"password:sk",
            "data":"secret_sauce"
        },
 "fill_changepassword":{
            "id":"changepassword:c&sk",
            "data":"secret_sauce"
        },

Window Controller

  1. window: It can be used with any field. It has two parameters the maximize and minimize one.
  2. set_window_position`: It allows the window to set the position.
"nav_to_view_cart":{
            "xpath": "//*[@id='shopping_cart_container']/a:click:minimize",
            "window":  "maximize"
        }
"nav_to_view_cart":{
            "xpath": "//*[@id='shopping_cart_container']/a:click:minimize",
            "window":  "minimize"
        }

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages