Skip to main content

Posts

Showing posts from 2014

Buy MI Phone : Scripting Flipkart

This is sample code for buying MI ( Xiaomi ) Phone using selenium scripts on Flipkart. Things to keep in mind : Find working ( as today : 30/12/14 ) visual studio project here :   Download You will need chrome installed on your system In this project we have used reference to selenium webdriver. If Flipkart change Tag name or Class name in future, We may need to change accordingly. Current html for 'Buy Now' button is included in code. using System ; using System.Collections.Generic ; using System.Linq ; using System.Text ; using OpenQA.Selenium ; using OpenQA.Selenium.Chrome ; namespace BuyMIPhoneFlipkartScripted { class Program { static void Main ( string [] args) { ChromeOptions options = new ChromeOptions(); options.AddArgument( "--start-maximized" ); IWebDriver driver = new ChromeDriver(options); // This Will Login Into FLipkart driver.Navigate().GoT...

Drawing and Animating ASCII Art in C# Console

This is sample code for drawing ASCII art character in C# console. Things to keep in mind : Replace the variable var with any ASCII art you want to get drawn in console.  Take care of [@],["] and [,] while replacing. using System ; namespace Dotned.UI.Framework { public class Arbit { public static void Main (String[] Args) { var arr = new [] { @" /$$$$$$ /$$ /$$ /$$ " , @" /$$__ $$ | $$ | $$ |__/ " , @" | $$ \__/ /$$$$$$ /$$$$$$/$$$$ /$$$$$$ /$$$$$$ | $$$$$$$ /$$ /$$$$$$$ /$$$$$$ " , @" | $$$$$$ /$$__ $$| $$_ $$_ $$ /$$__ $$|_ $$_/ | $$__ $$| $$| $$__ $$ /$$__ $$ " , @" ...

Serializing & Deserializing JSON Object [ C++ ]

         This is sample code for serializing an object into json object and deserializing it back into earlier object. Things to keep in mind : While creating a json object, you have to write  json_object* jObj=json_object_new_object();   initializing it as   json_object* jObj ;   will not work. You need to install JSON library using  $ sudo apt-get install libjson0 libjson0-dev, Check path of installed json here   $ ls /usr/include/json You need to add json library to linker or compiler path. For ex. in Eclipse , Right click on project >> properties >> path and symbols. Add /usr/include/json in library paths & json in libraries. //============================================================================ // Name : JsonTest.cpp // Author : Manish Kumar Khedawat //============================================================================ #include <iostream> #include <json...