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 started • Supported opcodes • Build • Test • Report a bug • Questions
install using the command: pip install nctp
{
"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.
driver_path
: give the location of the selenium chrome driver path.auto_install
: This key is used to download the chrome driver automatically and install it.browser
: The browser that you recommend for the auto install.get
: The URL of the landing page.window
: Always recommended to use the maximize one. Minimize also can be used if needed.screen_recorder
: It records the testing from beginning to end.run_and_wait
: It waits the window of the browser to run the program.- 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
'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.
{ "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" } }, }
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" } } }
"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.
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.- '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
: It can be used with any field. It has two parameters the maximize and minimize one.- 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" }