Open Means Open Means

Handling File upload using Selenium RC in IE and Firefox

No comments on “Handling File upload using Selenium RC in IE and Firefox”

Here I would like to share my experience on handling file upload using selenium. Handling File upload with selenium I spent more than two days and googled many sites to overcom this. At last I was able to crack this and found solution for the same. This script is devledoped in Java and can be easily coverted to any other langugage. 

To handle file upload using selenium RC (1.0 or higher) comes with two challenges.

1. Clicking on Browse/Upload button. ( As Upload buttion come with input type File which is combination of both text box and Browse button).

2. Selecting a file from windows dialog.

I will share handling this on both Fire fox and IE.

Handling file upload in Fire Fox:


Its really very simple when comes to handle file upload in Fire Fox. You just need to use selenium.type command for input file=type control.

Lets take below sample html code.

All you just need to do is use below command to upload file.

selenium.type("//input[@name='fileupload']","c:\test.txt")

Type command take care of uploading file automatically. No other code is required to handle this.


IE:


When it comes to IE its little tricky. Follow below steps.

1. Download AutoIt latest version.
2. Open new editor and past below code in editor.

If $CmdLine[0]<2 Then
Exit
EndIf


handleUpload($CmdLine[1],$CmdLine[2])


;define function to handleupload


Func handleUpload($title, $uploadFile)


if WinWait($title,"",4) Then
WinActivate($title)
ControlSetText($title,"","Edit1",$uploadFile) ;put file path into text fild
ControlClick($title,"","Button2")
Else
Return False
EndIf

EndFunc

4. Go to Tools menu click on build the code. It will generate an .exe (e.g. upload.exe)
5. Now write a function in java to make a call to aboe auto it function. Below is sample code for the same.

public void handleUpload(String windowtitle, String filepath) {
         String execute_file = "upload.exe";
         String cmd = "\"" + execute_file + "\"" + " " + "\"" + windowtitle + "\""
                                   + " " + "\"" + filepath + "\""; //with arguments
         try {
                 Process p = Runtime.getRuntime().exec(cmd);
                
         } catch (Exception e) {
                 e.printStackTrace();
         }

}


6. In you TC first call above java function ( remember first you need to call function before click on browse button. Else control never comes back to your code if you click browse button first.

7. Now click on upload button using selenium.click("//input[@name='fileupload']").


In other browsers like chrome and safari I tired either type or AutoIt code will function successfully. 

 

{jcomments on}

Union, Except and Intersect Operators in Sql Server

No comments on “Union, Except and Intersect Operators in Sql Server”

Union, Except and Intersect Operators in Sql Server

•Union Operator :

Union Operator is used to select related information from two or more table. But keep in mind, when you’ll use union operator, the selected columns should be of same data type.

Here is an example:
Let, there are two tables of a MNC Company – first one (from left) is Dept table and the next one is Details table.
  
Syntax:  
 
Select Column_Name from Table1
Union
Select Column_Name from Table2

Example:
Employee ID   Department               Name
0010              Finance                     Mary
0023              Marketing                  Allan
0045            Customer Service      Thomas
0167              Finance                     Victor
 
Employee ID Designation            Name
0010             Manager                Mary
0023             Branch Manager    Allan
0049             Developer              Mark
0167             Accountant           Victor
0901             Consultant              Lisa

 
Now use union operator to select Name and Employee ID:

Select Employee ID, Name from Dept
Union 
Select Employee ID, Name from Details     


Result:
Employee ID  Name
0010              Mary
0023              Allan
0045             Thomas
0167              Victor
0049              Mark
0901              Lisa

Remember, Union Operator only select distinct values. If you want to list all records from two or more tables use Union all instead of Union. Look at the sql query and corresponding output below:

Select Employee ID, Name from Dept
Union all 
Select Employee ID, Name from Details

Result:
Employee ID  Name
0010              Mary
0010              Mary
0023              Allan
0023              Allan
0045              Thomas
0049              Mark
0167              Victor
0167              Victor
0901              Lisa

•Except Operator:

Except operator is used to select all records from table1 which are not present in table2. More specifically, all the rows from the left side of except operator will be returned but it removes all of the rows from the result set that match the rows that are on the right side of the EXCEPT operator. The order and the datatype of the column should be same.

Syntax:
Select Column_Name from Table1
Except
Select Column_Name from Table2

Example:
Take the Dept and Details table. Write the following query.

Select Employee ID, Name from Details
Except
Select Employee ID, Name from Dept

Result:
  
Employee ID  Name
0049              Mark
0901              Lisa


•Intersect Operator:

Intersect operator is used to select the common records from both the left and right side query of intersect operator. But you should declare same number of columns in all queries. The order and the datatype of the column should be same.

Syntax:
Select Column_Name from Table1
Intersect
Select Column_Name from Table2

Example:
Take the Dept and Details table. Write the following query.

Select Employee ID, Name from Dept
Except
Select Employee ID, Name from Details

Result

Employee ID  Name
0010             Mary
0023             Allan
0167             Victor

VISUAL BASIC

No comments on “VISUAL BASIC”

VISUAL BASIC

 

What Visual Basic means and how is it used are some of the basic questions that come in mind, for the first time, of a person who is not familiar with it. Let us have some light on this VISUAL BASIC. It is a Computer Programming Language. It evolved from BASIC or Beginners All Purpose Symbolic Instruction Code, which was developed in 1960s by John Kemny and Thomas Kurtz. With the dvelopment of Graphical User Interface (GUI), BASIC developed into Visual BASIC.

Although Visual Basic is not the only example of High Level Language, there are many other languages classified in it. But there are some characteristics that differentiate it from other High Level Languages. This special characteristic is its GUI nature. It allows the users to work directly with graphics. Visual Basic programs are created in Integrated Development Environment that allows the programmer to design, debug and run the program. There are different versions of Visual Basic available in the market, which are categorized in a way so that it can be easily handled by the programmers and learners as well.

Talking about features, Visual Basic provides control as seen in Windows-based systems like Combo box, Scroll bar, list, etc. Designs are made on form and their program. What each control does, is written in code window and accordingly control function when program runs. Visual Basic has features that display the syntax, events, i.e. when the controls would be activated etc. on screen.

When programs are written in code, Visual Basic helps the programmer in telling which word or commands are pre-defined by changing the color or font of those words. If any error in syntax occurs while writing program then Visual Basic informs this by providing error message. Visual Basic provides graphic capabilities for drawing different shapes in different colors. It also allows insert picture and images in desired size from any source. It provides different means to interact with those controls, i.e., one can select the controls through keyboard or mouse, but there are different events associated with the two. As an example, a control can be activated only when a key is pressed down or when it is released and many more events. One can set a program to change the shape of oue pointer while any mouse process is going on. A programmer when designs a project, then situation may occur that when end-user uses the project then he may enter wrong information. For this Visual Basic provides a feature of error handling in which programmer can write error message in simple language so that end user understand t easily and correct hi mistake.

This is all basic about VISUAL BASIC. Now decide yourself if it is a good Graphical User Interface Language or not.

FOXPRO

No comments on “FOXPRO”

FOXPRO

 

What does a database mean? Perhaps many might be unaware of the meaning of this word. Lets derive its meaning step by step. Information is a collection of meaningful data sch as when one prepares bo-data of any person then elements like name, age, sex, etc. are the data and their collection i.e., bio-data is information. When such related information are organized in a certain way then we get a database. As an example, any organization keeps the record of their employees, then these related information forms a database.

Earlier databases where handled manually. But this was too much time consuming and lots of human efforts were wasted. To overcome this problem, computers began to be used for the work. For this, many software packages called DBMS or Database Management Systems were used. They help to build and manage databases as well as they help to retrieve the required information as pr requirement. Anybody can modify the records in such databases. A good example of such DBMS is FOXPRO.

Foxpro is actually an updated version of FOXBASE+ software. It is now the most commonly used DBMS in Personal Computers nowadays, though many newer and better options are available. Foxpro performs all the functions specified to it. Data is entered and saved for the future use and if anybody wants to get that data back, it can be retrieved very easily. The data stored in it is very flexible i.e., they can be modified as per requirement. Foxpro is very simple to be used and learnt as the statements and commands generated or written in are in simple and easy English language. With a single command, one can get the print out of any database and Foxpro provides the facility to manage more than one database at a time. Foxpro can be used on Local Area network (LAN) where a small group of people can work simultaneously on different systems.

Different versions of Foxpro are available. They can run in MSDO, Windows, UNIX as well as Macintosh with just a few differences in their operating behaviour.

 

 

How to transfer your website to a new web host?

No comments on “How to transfer your website to a new web host?”

There are many reasons why you would like to change web hosting provider . Your current provider does not have the support you wait, the servers always have problems because they do not meet new technical requirements or simply because he found a cheaper alternative. Whatever the reasons, he found a new provider and need to transfer your website to new servers.

Below is the procedure to be used to transfer your website to a new web hosting provider, seeking to avoid service cuts and be as transparent as possible.

If you are transferring your site to an account in Neothek.com not need to perform the steps above, all prices for web hosting include the transfer of data to our servers, you only need to generate a support ticket and we'll take care.



hostSet the date of transfer

The ideal is to schedule the transfer of your website, at least 1 month before the date of termination of contract with their current provider. This period allows sufficient time to make several attempts and trials.



Registration in the new web hosting provider

Now, enter the service with the new web hosting provider. Depending on your new provider, usually your new web hosting account will be activated within 24 hours.


Create a full backup of your website

There are several ways to accomplish this task. Many providers use cPanel as control panel, you can use the File Manager and compress your www or public_html directory, you have everything your web site in 1 file compressed, easy to download and upload to new servers. If you do not have access to this tool, you can use an FTP program and import all the files on your website.

If your site uses a database, you must create a backup using the tools current provider offers.



hostingTransfer data to new web hosting provider

Once you are notified that your web hosting account has been created with your new provider, I can start uploading the archive or pages of your website. Generally, web hosting provider notified the hosting account creation by email where specified: access control panel, FTP and temporary alternative address or check your web site while the domain propagates.

Once you've finished uploading all files and databases, you can now use the temporary URL to test your website.


Tests

Using the temporary address, your new web hosting provider assigned, please test all scripts, hyperlinks and access to the database. Test that everything is working on the new server.

While performing tests using the temporary URL, your website hosted on the old provider will continue to operate.

Point the domain to the new hosting provider

Once you have finished testing the new website at the temporary address and verified that it works perfectly, the next step is to contact your current domain name registrar (ie the company where you register your domain name) to change the DNS (Domain Name Server) to point to the new DNS of your new web hosting provider.

Usually, the DNS information is sent via email after successful registration to the new web hosting provider.

The propagation of changes can take from 24 to 48 hours, during this period, some visitors will enter the old provider.

Alternatively, you can enter a mark on the page in the new provider, so you will know you are entering the new server and domain are propagated correctly.

host

Final Test

After the propagation period (24 to 48 hours), your site is online at the new web host. Must repeat all tests to make sure your site is fully functional. Once it is confirmed that its new website is working properly, you can download to enable your account on the old server.

NOTE: Please note that the steps described above do not include domain transfer. Please contact your dealer for more information.

More Articles …

  1. VB Forms And Controls
  2. VB FlexGrid / Timer Controls
  3. Function of Menu based Program
  4. RDBMS in a nutshell
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

Page 4 of 13

  • About Us
  • Faqs
  • Contact Us
  • Disclaimer
  • Terms & Conditions