public void TestMethod2() { //Give fully formed URL(Web Page address) of which you intend to extract elements //example-http://www.vishalsridhar.com/unifiedframework instead of vishalsridhar.com/unifiedframework var url = "http://www.convert-jpg-to-pdf.net/"; //pass on the Url defined in previous step to Extract the elements. //By default it will create UFHtmlExtractor Folder in the project file path and relevant json file inside that(based on the URL passed) //** UnifiedFramework will automatically add the newly created file to the solution, so that you could refer within IDE itself. UnifiedHtmlExtractor.ExtractElements(url); }
public void testMethodTwo() { ////Initiates the Unified Code Engine, Should be first line. //UCodeGen.Initiate(); ////Namespace under which c# files will be generated //string nameSpace = "MyProjectNamespace"; ////Primary config file of the project( probably will be inherited by other implmentators, hence is good candidate to act as base class) //string baseType = "Config"; ////Determine the current projects root file, dynamically. Can be replaced with absolute path but not recommended. //string filePath = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName; ////In this Section we will create Config File(which handles test intialisation, cleanup, assembly cleanups, Logginh, report generation etc.) ////Invoke Unified Code Engine:Dynamic code creation fragment, using Namespace and Config file Name defined above. //UCodeGenController codeEngine = new UCodeGenController(nameSpace, baseType); ////Invoke Unified Code Config Generator:writing generated code to IOStream(here its c# file), using file path and classnme ////Eg. here we intend to create file named as Config, so baseType is passed as second parameter. //codeEngine.UCodeConfigGen(filePath, baseType); ////In this section we will create a single file inside a folder. ////Invoke Unified Code Engine, using Namespace, folder name, and baseclass //codeEngine = new UCodeGenController(nameSpace, "SampleFileOne", baseType); ////Invoke Unified Code Generator, apart from creation of config file. this way should be followed to create c# files ////Here we need to passs file path, folder name, class name. //codeEngine.UCodeBuilder(filePath, "FolderOne", "SampleFileOne"); ////In this Section we will be creating two file under single folder //codeEngine = new UCodeGenController(nameSpace, "SampleFileTwo", baseType); //codeEngine.UCodeBuilder(filePath, "FolderTwo", "SampleFileTwo"); //codeEngine = new UCodeGenController(nameSpace, "SampleFileThree", baseType); //codeEngine.UCodeBuilder(filePath, "FolderTwo", "SampleFileThree"); //UCodeGen.Finalise(); //Give fully formed URL(Web Page address) of which you intend to extract elements //example-http://www.vishalsridhar.com/unifiedframework instead of vishalsridhar.com/unifiedframework var url = "http://www.mikesdotnetting.com/article/273/using-the-htmlagilitypack-to-parse-html-in-asp-net"; //pass on the Url defined in previous step to Extract the elements. //By default it will create UFHtmlExtractor Folder in the project file path and relevant json file inside that(based on the URL passed) //** UnifiedFramework will automatically add the newly created file to the solution, so that you could refer within IDE itself. UnifiedHtmlExtractor.ExtractElements(url); }