Menu Close
    Start a Project Request quote Reading list Switch to dark mode

    How to login and add product in Opencart using CasperJS

    It will be more interesting if we add product automatically in our Opencart store. Nowadays we all want to do our work in very lesser time and efforts. Of course, it is possible. We can add product automatically in our Opencart store using CasperJS. In previous blog , we have learned how to sign up in our Opencart store. In this blog, we will learn how to login in our Opencart store and after that we will add product.

    Let’s start our script with login process and after that, we will add the product in our Opencart store.

    As discussed in the previous blog, we use the verbose setting for tracing every step made. For login and to add product in Opencart using CasperJS we can use following methods- fill(), then(), click(), getTitle().

    For adding a product into the store, firstly we have to log in. Once you will login successfully you can add a product in Opencart store. For login into the Opencart store, we have to enter username and password.

    After the successful login, we have to add a product in our Opencart store. For adding the product we have to fill out the form. We can use fill() method for filling the form. fill() method, fills the fields of a form with given values and submits it. click() method performs a click on the element matching the provided selector expression.

    Here is the full script for the whole login and add product process.

    After preparing the script, you have to execute the command in terminal. Here is the command.

    Here, ProductAdd.js is the js file in which we have written script for login and add a product in Opencart store process.

    Thank You Very Much, My Beloved Readers 🙂

    . . .


    Add Your Comment

    Be the first to comment.

    Back to Top
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again