tag:blogger.com,1999:blog-49020947684907347722024-03-18T08:33:17.396+05:30Beginning .net | .Net Tips | C# Tips | MVC | c# .net programming | vb .net programming | SQL ServerProgramming techniques and codes for Asp.net , C# Examples , VB.net Examples , MVC Examples , Sql Server , Javascript , .Net Tips , C# Tip , .Net Beginners, Selenium C# WebDriver Tool. This is pure .Net Blog .
You can Get Real World Examples Over Here.Anonymoushttp://www.blogger.com/profile/02950389317224636373noreply@blogger.comBlogger244125tag:blogger.com,1999:blog-4902094768490734772.post-13904113978366916382015-02-14T22:17:00.002+05:302015-02-14T22:17:40.880+05:30Selenium C# : Click on button control in website with selenium C# webdirver
Click Here to Download ClickOnButtonUsingSeleniumWebDriverTool.zip
Note :
If any runtime error occurred by running our downloaded project meaning
of that your browser version and Selenium API DLL version is not
matching. To resolve this issue you need to download latest Selenium C#
API DLLs from this link and paste downloaded DLLs into 'Bin'
folder of downloaded project. Or you can removeAnonymoushttp://www.blogger.com/profile/02950389317224636373noreply@blogger.com10tag:blogger.com,1999:blog-4902094768490734772.post-61975597296970573872014-09-30T18:02:00.003+05:302014-10-07T10:47:30.513+05:30Selenium C# : Insert text in website textbox with selenium C# webdirver
Click Here to Download InsertTextInTextBox.zip
Note :
If any runtime error occurred by running our downloaded project meaning
of that your browser version and Selenium API DLL version is not
matching. To resolve this issue you need to download latest Selenium C#
API DLLs from this link and paste downloaded DLLs into 'Bin'
folder of downloaded project. Or you can remove references of Anonymoushttp://www.blogger.com/profile/02950389317224636373noreply@blogger.com4tag:blogger.com,1999:blog-4902094768490734772.post-66220416389566040832014-09-22T16:58:00.001+05:302014-10-10T10:43:51.746+05:30Selenium : Locate element in web browser using Element Locator Tool
There are various way to local element on web browser. We can use located element in selenium script to do automate things.
There are various locator types :
C# Locator
Java Locator
XPath Locator
Ruby Locator
We can Locate element by various way like by ID, Type, Name, CSS Class, etc..
Here are examples of locator strings which are useful in C# code to get value or perform any action on thatAnonymoushttp://www.blogger.com/profile/02950389317224636373noreply@blogger.com1tag:blogger.com,1999:blog-4902094768490734772.post-19779187973852470002014-09-16T07:00:00.000+05:302014-09-23T10:37:43.024+05:30Selenium C# : How to Open Website or URL with selenium c# webdirver in ASP.Net website.
Click Here to Download OpenWebsiteInBrowserUsingSeleniumWebDriver.zip
Note :
If any runtime error occurred by running our downloaded project meaning
of that your browser version and Selenium API DLL version is not
matching. To resolve this issue you need to download latest Selenium C#
API DLLs from this link and paste downloaded DLLs into 'Bin'
folder of downloaded project. Or you can Anonymoushttp://www.blogger.com/profile/02950389317224636373noreply@blogger.com0tag:blogger.com,1999:blog-4902094768490734772.post-3258532695612822822014-09-12T16:35:00.000+05:302014-09-12T16:35:08.083+05:30Selenium C# : How to Open web Browser with selenium C# webdirver in ASP.Net
You can open web browsers like FireFox, Internet Explorer, Chrome, etc. using selenium c# webdirver.
This is a very essential step to do automate website testing or automate website actions without user interactions.
Here are useful Selenium webdriver video tutorials and articles to open web browser.
How to Open Firefox Browser using selenium C# webdriver with ASP.Net.
How to Open Internet Anonymoushttp://www.blogger.com/profile/02950389317224636373noreply@blogger.com0tag:blogger.com,1999:blog-4902094768490734772.post-18677725822908113792014-09-10T11:43:00.000+05:302014-09-30T18:08:48.594+05:30Selenium C# : How to Open Chrome Browser using selenium webdriver with ASP.Net C#
Click Here to OpenChromeBrowserUsingSeleniumWebDriverTool.zip
Note : If any runtime error occurred by running our downloaded project meaning of that your browser version and Selenium API DLL version is not matching. To resolve this issue you need to download latest Selenium C# API DLLs from this link and paste downloaded DLLs into 'Bin' folder of downloaded project. Or you can remove Anonymoushttp://www.blogger.com/profile/02950389317224636373noreply@blogger.com7tag:blogger.com,1999:blog-4902094768490734772.post-63637548011744235312014-09-05T13:01:00.003+05:302014-09-15T14:12:33.867+05:30Selenium C# : How to Open Internet Explorer Browser using selenium webdriver with ASP.Net C#
Click Here to Download OpenInternetExplorerWithSeleniumWebDriverTool.zip
Note : If any runtime error occurred by running our downloaded project meaning of that your browser version and Selenium API DLL version is not matching. To resolve this issue you need to download latest Selenium C# API DLLs from this link and paste downloaded DLLs into 'Bin' folder of downloaded project. Or you can Anonymoushttp://www.blogger.com/profile/02950389317224636373noreply@blogger.com43tag:blogger.com,1999:blog-4902094768490734772.post-83458327204146390222014-09-02T15:46:00.001+05:302014-09-08T15:26:18.548+05:30Selenium Webdriver : How to Open Firefox Browser using selenium webdriver with ASP.Net C#
We can open FireFox Browser programmatically using selenium webdriver API with ASP.Net C#. Here you can Learn how to open Firefox browser using selenium webdriver with ASP.Net C#
STEP 1 : First you need to create empty 'Website' or in existing 'Website' or project you need to add selenium 'WebDriver' API DLL references.
You can visit this link to create new 'Website' and add selenium 'Anonymoushttp://www.blogger.com/profile/02950389317224636373noreply@blogger.com0tag:blogger.com,1999:blog-4902094768490734772.post-25968691429083392252014-08-28T11:11:00.004+05:302014-09-03T18:51:41.280+05:30Selenium Tool : Download and Install WebDriver Element Locator Add-on
Element Locator Add-on is available in FireFox Browser as Add-on or extension. You can install it in FireFox browser.
Element Locator Add-on is very useful to find or locate appropriate web element or control like, text box, button, image, input box, etc. in browser. It will return location string of that particular control. This string is helpful in selenium automation process.
When you rightAnonymoushttp://www.blogger.com/profile/02950389317224636373noreply@blogger.com0tag:blogger.com,1999:blog-4902094768490734772.post-12245778313051340862014-08-26T11:01:00.005+05:302014-09-02T10:44:59.186+05:30Selenium Tool : Configure selenium tool for asp.net C# website or project in Visual Studio
It is very easy to configure selenium tool for asp.net website or project.
We can configure selenium tool and it's DLL into Visual Studio by creating new 'website' or 'project' or in Existing 'website' or 'project'.
In previous article you can see the article of how to download selenium webdriver tool.
Here are some steps to configure selenium webdriver tool :
STEP 1 : Open Visual Studio Anonymoushttp://www.blogger.com/profile/02950389317224636373noreply@blogger.com2tag:blogger.com,1999:blog-4902094768490734772.post-49203730101265475362014-08-22T14:06:00.000+05:302014-09-05T13:57:31.704+05:30Selenium Tool : Download selenium Webdriver for ASP.NET C#
Selenium is an excellent tool for automate series of use actions. It is also very useful for testing.
Selenium is a very useful tool for web application testing. We can integrate selenium tool in our ASP.Net website and do automation as well as testing.
Here we are providing series of learning selenium tool.
Download selenium is the first stage to learn selenium.
STEP 1 : Go to seleniumAnonymoushttp://www.blogger.com/profile/02950389317224636373noreply@blogger.com1tag:blogger.com,1999:blog-4902094768490734772.post-21250307818525479862014-07-02T07:00:00.000+05:302014-07-02T07:00:00.045+05:30.Net Tips : Remove leading and trailing white spaces from string using Regex with C#.Net and VB.Net example
It is very easy to remove string's leading and trailing white spaces using Regex.
The Regex is "^\s+|\s+$".
Here is example of this.
In this example we are taking on string which has leading and trailing white spaces. We can remove this spaces using Regex.
C#. Net Example :
string strData = " This string contains leading and trailing white spaces ";
strData = Anonymoushttp://www.blogger.com/profile/02950389317224636373noreply@blogger.com0tag:blogger.com,1999:blog-4902094768490734772.post-56104934484801763722014-06-25T07:00:00.000+05:302014-07-07T16:34:13.601+05:30.Net Tips : Remove only trailing white spaces from string using Regex with C#.Net and VB.Net example
It is very easy to remove string's trailing white space.
We can achieve using Regex. The Regex is "[ \t]+$".
Here is example of this.
In this example we are taking on string which has trailing white space. We can remove this spaces using Regex.
C#. Net Example :
string strData = "This string contains trailing white spaces ";
strData = Regex.Replace(strData, "[ \t]+$", "");
Anonymoushttp://www.blogger.com/profile/02950389317224636373noreply@blogger.com0tag:blogger.com,1999:blog-4902094768490734772.post-46428130950721049502014-06-18T07:00:00.000+05:302014-07-07T16:33:55.111+05:30.Net Tips : Remove only leading white spaces from string using Regex with C#.Net and VB.Net example
It is very easy to remove string's leading white space.
We can achieve using Regex. The Regex is "^[ \t]+".
Here is example of this.
In this example we are taking on string which has leading white space. We can remove this spaces using Regex.
C#. Net Example :
string strData = " This string contains leading white spaces";
strData=Regex.Replace(strData, "^[ \t]+", "");
Response.Write(strDataAnonymoushttp://www.blogger.com/profile/02950389317224636373noreply@blogger.com0tag:blogger.com,1999:blog-4902094768490734772.post-39968325227371496552014-05-13T07:00:00.000+05:302014-05-21T19:25:29.870+05:30MVC Tips : Writing Custom Razor helper class
Click Here to Download CustomRazorHelperClass.zip
It is very easy to write custom razor helper class. After creating custom razor helper class, we can use these classes anywhere in MVC Application.
Here is step by step explanation of creation of razor helper class.
STEP 1 :
First create MVC web application if you do not have MVC Web Application
STEP 2 :
Now Add new "App_Code" folder. In thisAnonymoushttp://www.blogger.com/profile/02950389317224636373noreply@blogger.com1tag:blogger.com,1999:blog-4902094768490734772.post-37448263225974482842014-04-23T07:00:00.000+05:302014-05-14T13:43:06.789+05:30MVC Tips : Play or display video in ASP.NET MVC using HTML5
Click Here to Download PlayVideoInMVC.zip
It is very easy to play or display video in ASP.NET MVC using HTML5. We can do this using custom action filter in MVC. We can play various files like MP4, Ogg, WebM, etc. format.
Here are step by step tutorial to play video in ASP.NET MVC using HTML5.
Here is example for this.
In this example we are taking .MP4 file to play in browser.
STEP : 1
Anonymoushttp://www.blogger.com/profile/02950389317224636373noreply@blogger.com2tag:blogger.com,1999:blog-4902094768490734772.post-69520748117850892632014-03-26T07:00:00.000+05:302014-04-23T10:51:36.461+05:30.Net Tips : Fill DataTable from another DataTable using LINQ with C#.Net and VB.Net example
You can fill DataTable from another DataTable using LINQ after doing LINQ operation.
This would be useful in condition like you need to perform some operation on DataTable using LINQ and get back result into another 'DataTable'. Means, you can filter and projection on one DataTable and get result in another DataTable.
We can achieve this by using 'CopyToDataTable' method of LINQ query result Anonymoushttp://www.blogger.com/profile/02950389317224636373noreply@blogger.com10tag:blogger.com,1999:blog-4902094768490734772.post-83799874843826749742014-03-04T11:20:00.001+05:302014-05-01T16:18:07.949+05:30.Net Tips : Create XML file from another XML file with selected Elements using LINQ with C#.Net and VB.Net example
You can create XML file from another file with selected elements from source XML file using LINQ. In this, we query the source XML file using LINQ and write or create new XML file.
Here is example for this.
In this example we take one "Book.xml" file. In this file we have element like Title, Pages, ISBN and Auther. Now we are querying the "Book.xml" file to get only Title and ISBN of bookAnonymoushttp://www.blogger.com/profile/02950389317224636373noreply@blogger.com1tag:blogger.com,1999:blog-4902094768490734772.post-78045869327602531192014-02-12T07:00:00.000+05:302014-03-04T11:27:13.355+05:30.Net Tips : Convert DataTable object to list of class object using LINQ with C#.Net and VB.Net example
You can fill List of object from DataTable using LINQ. There are many situations where you need to get data from DB into data table and after that from data table to proper class object. We can do this easily with LINQ.
Here is example for this.
In this example we take one DataTable object which contains two columns 'product_id' and 'product_name'. This DataTable has many rows. Now we want to Anonymoushttp://www.blogger.com/profile/02950389317224636373noreply@blogger.com38tag:blogger.com,1999:blog-4902094768490734772.post-1301967651858291662014-01-24T07:00:00.000+05:302014-02-06T12:01:38.959+05:30MVC Tips : Implement IValidatableObject Interface for custom validation in ASP.Net MVC 4
Click Here to Download ImplementIValidateObjectInterfaceInMVC.zip Example.
We can validate model itself by implementing IValidatableObject Interface. For validation you need to implement 'Validate' method of IValidatableObject Interface.
Here is some difference from the attribute validation version.
In this for validation method is 'Validate' instead of 'IsValid' and also return type andAnonymoushttp://www.blogger.com/profile/02950389317224636373noreply@blogger.com0tag:blogger.com,1999:blog-4902094768490734772.post-54172430912853267982014-01-16T11:33:00.001+05:302014-01-23T13:52:51.041+05:30.Net Tips : Attach and Raise events on XML document object with C#.Net and VB.Net example
You can attach events like 'onChanging' and 'onChanged' events on XML document object. These events raise when you 'ADD' or 'REMOVE' XML element from XML Document object.
First 'onChanging' event raise after that 'onChanged' event raise. In this event we get 'XObjectChangeEventArgs' class object. This object give us property like 'ObjectChange'. In this property we can know that which method isAnonymoushttp://www.blogger.com/profile/02950389317224636373noreply@blogger.com3tag:blogger.com,1999:blog-4902094768490734772.post-46012626302630459152014-01-01T11:56:00.000+05:302014-05-14T13:41:46.494+05:30MVC Tips : Custom Annotation validation in ASP.Net MVC 4
Click Here to Download CustomAnnotationInMVC.zip Example.
You can write your own custom annotations in MVC 4.
Here we can do custom validation using custom annotations. Custom annotations validation derive from the ValidationAttribute base class. This base class available in 'System.ComponentModel.DataAnnotations' namespace. ValidationAttribute class is abstract class.
For custom Anonymoushttp://www.blogger.com/profile/02950389317224636373noreply@blogger.com7tag:blogger.com,1999:blog-4902094768490734772.post-78205411045447335122013-12-20T12:50:00.001+05:302014-01-01T11:58:59.686+05:30C# Tips : Validate or Verify XML File Data using LINQ and REGEX with C#.Net and VB.Net example
You can validate the data of XML file and identify XML elements which are failed to validate. We can easily achieve this using LINQ.
Here is example for this.
In this example we take one 'customer.xml' file. In this file we have 'name' and 'phone' element. We need to validate phone number with REGEX and display it's validate result either it is true or false.
C#. Net Example :
static Anonymoushttp://www.blogger.com/profile/02950389317224636373noreply@blogger.com0tag:blogger.com,1999:blog-4902094768490734772.post-16937350503710481772013-12-11T14:04:00.002+05:302013-12-11T14:07:41.559+05:30C# Tips : Check XML element has attribute using LINQ with C#.Net and VB.Net example
Using LINQ you can check that attribute exist in element or not. There is property called "HasAttributes" of XElement class to check existence of attribute.
Here is example for this.
In this example we take one 'customers.xml' file which contains customers information like name, id, etc. Now we check that does "customer" element has 'id' attribute or not. In XML there is one customer 'David' Anonymoushttp://www.blogger.com/profile/02950389317224636373noreply@blogger.com1tag:blogger.com,1999:blog-4902094768490734772.post-88818217824782086262013-11-20T14:16:00.000+05:302013-12-11T14:07:59.010+05:30C# Tips : Sort or order by Date in XML File data using LINQ with C#.Net and VB.Net example
XML file contains various types of data like string, integer, date, etc. Now if we want to get data from XML file order by some attribute which contains dates at that time we need to do some special things if we are not doing that at that time data is not sorted date wise it will treat as normal string sorting. We can do date wise sorting.
Here are examples for this.
In this Anonymoushttp://www.blogger.com/profile/02950389317224636373noreply@blogger.com0