What is a frame?

Frame is just like as a container  where few elements can be grouped.

How to identify frame inside a webpage?

There are different ways to identify frame inside a webpage

Way 1:

  • Open webpage in a browser.
  • Right click on webelement in a webpage

Way 2:

  • Open webpage in a browser.
  • Right click on webelement in a webpage
  • Open source code(Html Code) of the webpage by clicking inspect element with firebug option see below image.

How to handle an element inside the frame ?

There are 4 ways to handles frames in selenium webdriver.

Switch to frame by using index :

Method 1 :

Suppose if there is single frame in a webpage then we can switch to the iframe by using index.

Here is the sample code:

Syntax : driver.switchTo().frame(int index);

Example : driver.switchTo().frame(0);

Note : By default single frame index value ‘ 0’.That means when webpage has  only one frame then the index will be zero.

Method 2 :

Suppose if there are 3 frames in a webpage then we can switch to the iframe by using index.

Here is the sample code:

Syntax :

List<WebElement> framelist=driver.findElements(By.tagName(“iframe”));

driver.switchTo().frame(framelist.get(int index));

Example :

List<WebElement> framelist=driver.findElements(By.tagName(“iframe”));

//switchTo 1st frame by using index

driver.switchTo().frame(framelist.get(0));

  //switchTo 2nd frame by using index

driver.switchTo().frame(framelist.get(1));

//switchTo 3rd frame by using index

driver.switchTo().frame(framelist.get(2));

Switch to frame by using Id or Name :

We can also use Name and Id attributes of iframe  through which we can switch to iframes.

Here is the sample code:

Syntax 1:

driver.switchTo().frame(“Id of  the element”);

Html code :

Example : driver.switchTo().frame(“rightMenu”);

Syntax 2:

driver.switchTo().frame(“Name of  the element”);

Html code :

Example : driver.switchTo().frame(“rightMenu”);

Switch to frame by using WebElement :

We can also switch to the frame using webelement.

Here is the sample code:

Syntax :

driver.switchTo().frame(WebElement);

Html code :

Example : driver.switchTo().frame(driver.findElement(By.name(“rightMenu”)));

How to get all the frames in a webpage ?

Html code :

Open notepad and type the below Html code and save as frames.html

<html>

<body>

<iframe src=”http://www.seleniumhq.org/download/” width=”200″ height=”200″ name=”selenium”>

<p>Your browser does not support iframes.<p>

</iframe>

 

<iframe src=”http://127.0.0.1/orangehrm-2.5.0.2/login.php” width=”200″ height=”200″ name=”selenium”>

<p>Your browser does not support iframes.<p>

</iframe>

<br>

<iframe src=”http://testng.org/doc/index.html” width=”200″ height=”200″ name=”selenium”>

<p>Your browser does not support iframes.<p>

</iframe>

<br>

<a class=”gb_P” data-ved=”0EMIuCBMoAA” href=”https://mail.google.com/mail/?tab=wm” data-pid=”23″>Click on Gmail</a>

</body>

</html>

 

Example :

package seleniumProject;

import java.util.List;

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.WebElement;

import org.openqa.selenium.firefox.FirefoxDriver;

public class getTotalFrames {

public static void main(String[] args) {

//   Open Firefox Browser  

       WebDriver driver = new FirefoxDriver();

 //   Open AppURL In Browser

driver.get(“file:///C:/Users/Hanumanthu/Downloads/frames.html”);

 // count all the frames on a webpage

List<WebElement> total_frames=driver.findElements(By.tagName(“iframe”));

System.out.println(total_frames.size());

//close the current browser window

driver.close();

}

}

How to verify TestNg text inside 3rd frame?

Selenium Sample Code :

package seleniumProject;

import java.util.List;

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.WebElement;

import org.openqa.selenium.firefox.FirefoxDriver;

public class getTotalFrames {

public static void main(String[] args) {

   // Open Firefox Browser  

WebDriver driver = new FirefoxDriver();

//  Open AppURL In Browser

driver.get(“file:///C:/Users/Hanumanthu/Downloads/frames.html”);

 //count all the frames on a webpage

List<WebElement> total_frames=driver.findElements(By.tagName(“iframe”));

System.out.println(total_frames.size());

 //Switch to 3rd Frame by using Index

driver.switchTo().frame(total_frames.get(2));

  //Identify and get the text and store into testNg_text variable

String testNg_text=driver.findElement(By.xpath(“html/body/h2[1]”)).getText();

   //print the text from 3rd frame

System.out.println(testNg_text);

  //verify the text from 3rd frame

if(testNg_text.equals(“TestNG”))

{

System.out.println(“TestNG text verified successfully”);

}else

{

System.out.println(“TestNG text not verified successfully”);

}

 //How switch back to main window from inside any frame ?

driver.switchTo().defaultContent();

//Close the Firefox Browser

driver.close();

}

}

Note :

1.Switch to 3rd Frame by using Index

Syntax :   driver.switchTo().frame(total_frames.get(index));

Example :   driver.switchTo().frame(total_frames.get(2));

2.Switch to 3rd  Frame by using Id

Syntax :   driver.switchTo().frame(“Id of the element”);

Example :   driver.switchTo().frame(“selenium”);

If no id then go for Name.

 3.Switch to 3rd  Frame by using Name

Syntax :   driver.switchTo().frame(“Name of the element”);

Example :   driver.switchTo().frame(“selenium”);

4.Switch to 3rd  Frame by using WebElement

Syntax :   driver.switchTo().frame(WebElement);

Example :   driver.switchTo().frame(driver.findElement(By.name(“selenium”);

 How switch back to main window from inside any frame ?

Syntax : driver.switchTo().defaultContent();

 How to handle frame in selenium webdriver using java

TestSteps:

Open Firefox Browser

Open AppURL In Browser

Get the Title of WebPage

Verify Title of WebPage

Enter the username

Enter the password

Clicking On Login Button

Identify and get  the Welcome selenium text

Verify  Welcome selenium text

Switch to frame

Handle DropDown in Selenium

  1.  How to print all the dropdown values
  2. How to Select the dropdown value inside a frame
  3. verify selected value from dropdown
  4. How to Verify dropdown values

Again switch back to main window from frame

Clicking On Logout Button

Close the Firefox Browser

Selenium Code :

package com.tests;

import java.util.List;

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.WebElement;

import org.openqa.selenium.firefox.FirefoxDriver;

importorg.openqa.selenium.support.ui.Select;

public class OrangeHRM_login {

public static void main(String[] args) throws Interrupted Exception {

// open the firefox browser

WebDriver driver = newFirefoxDriver();

// navigate the AppUrl

diver.get(“http://127.0.0.1/orangehrm-2.5.0.2/login.php”);

//Get the Title of WebPage

String title=driver.getTitle();

//print the title of the webpage

System.out.println(title);

//Verify Title of the WebPage

if (title.equals(“OrangeHRM – New Level of HR Management”)) {

System.out.println(“title is verified successfully”);

} else {

System.out.println(“title is not verified successfully”);

}

// Enter the username

  driver.findElement(By.name(“txtUserName”)).sendKeys(“selenium”);

// Enter the password

driver.findElement(By.name(“txtPassword”)).sendKeys(“selenium”);

// Clicking On Login Button

driver.findElement(By.name(“Submit”)).click();

// Identify and get  the Welcome selenium text and store into text variable

String text = driver.findElement(By.xpath(“//*[@id=’option-menu’]/li[1]”)).getText();

// Print the welcome selenium text

System.out.println(text);

//  To verify whether the welcome page successfully opened or not

if (text.equals(“Welcome selenium”)) {

System.out.println(“Welcome selenium is verified successfully”);

} else {

System.out.println(“Welcome selenium is not verified successfully”);

}

// Switch to Frame by ID

driver.switchTo().frame(“rightMenu”);

System.out.println(“****How to print all the dropdown values inside a frame****”);

// Identify the dropdown

WebElement dropdown = driver.findElement(By.id(“loc_code”));

// Identify  dropdown values  and store into droplist  variable

List<WebElement> droplist = dropdown.findElements(By.tagName(“option”));

// How to print all the dropdown values

for (inti = 0; i<droplist.size(); i++) {

System.out.println(droplist.get(i).getText());

}

System.out.println(“*****How to Select the dropdown value inside a frame*****”);

/*

                    If u want to select the dropdown value then we need to create the select object for that dropdown

                    */

Select s = new Select(dropdown);

// Select the dropdown value by using index

s.selectByIndex(2);

//s.selectByVisibleText(“Emp. First Name”);

//s.selectByValue(“1”);

System.out.println(“****verify selected value from dropdown inside a frame *****”);

//get the selected value and store into selected_value variable

String  selected_value=s.getFirstSelectedOption().getText();

//print selected value

System.out.println(“selected_value  :”+selected_value);

//verify selected value from dropdown

if (selected_value.equals(“Emp. First Name”)) {

System.out.println(“selected value  verified successfully”);

} else {

System.out.println(“selected value not verified successfully”);

}

// How switch back to main window from inside any frame

driver.switchTo().defaultContent();

// Clicking On Logout Button

driver.findElement(By.xpath(“//*[@id=’option-menu’]/li[3]/a”)).click();

// Close the Firefox Browser

driver.close();

}

}

 

 

Kotlin For Android Developers

Kotlin For Android Developers

Kotlin For Android Developers

Kotlin is a new programming language from JetBrains, the maker of the world’s best IDEs. Now Kotlin supported by Google For Android.
 
Kotlin comes from industry, not academia. It solves problems faced by working programmers today. As an example, the type system helps you avoid null pointer exceptions. Research languages tend to not have null at all.

1. Why Kotlin

 
1.1 Java Interoperability
 
Kotlin language is inter-operable with java. It means we can user previous java project with new kotlin classes also and all java frameworks are still available. We have a one click java to kotlin converters also.
 
1.2 Familiar syntax
 
Kotlin Language syntax is very familiar to any programing language who came from OOP domine. There are some differences compare to Java such as val, var
 
Class Example{
 
val a:String= “Kosmik” //val means unmodifiable
 
Var i:int=1 // var means modifiable
 
}
 
Fun hellworld(){
 
Val str=”hello”
 
print(“$str World”)
 
}
 
1.3 String Interpolation
 
It’s as if a smarter and more readable version of Java’s String.format() built into the Kotlin language
 
var x=4
 
var y=3
 
print(“sum of $x and $y is ${x+y}”) //sum of 4 and 7 is 11
 
1.4 Open Source
 
It is open source under apache 2.0
 
1.5 Compatibility
 
Kotlin is fully compatible with JDK6 and kotlin applications can run on older android devices also
 
1.6 Performance
 
Kotlin application will run fast as an equal to java
 
1.7 Support
 
Kotlin is fully supported from Android Studio 3.0
 
1.8 Some Syntaxes
  1. No more semicolons ;
  2. Variable declaration is different in kotlin like var is mutable and val is immutable
  3. Functions in kotlin (methods)

fun sum (x: Int ,y: Int): Int{

return x+y

}

  1. when function

Now switch changed into when a condition, which is very easy to understand  like below example

when (x) {

   1 -> print(“x is 1”)

   2 -> print(“x is 2”)

   3, 4 -> print(“x is 3 or 4”)

   in 5..10 -> print(“x is 5, 6, 7, 8, 9, or 10”)

   else -> print(“x is out of range”)

}

6.creating a class in kotlin

val rectangle = Rectangle(5.0, 2.0) //no ‘new’ keyword required

val triangle = Triangle(3.0, 4.0, 5.0)

Android Training in Hyderabad

kosmik provides Android training in Hyderabad, we are providing lab facilities with complete real time training & 100% job assistance will be there

Steps to configure Selenium WebDriver with java to develop test scripts

Pre-conditions: We need below files

Step 1: Download and Install JDK 8

Follow below URL

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Select Accept License Agreement radio button

Java SE Development Kit 8

Choose version to download: Windows 86 or x64 based on your OS (jdk-8-windows-i586.exe and jdk-8-windows-x64.exe)

  • wait until complete download.
  • copy downloaded file and paste in personal folder.
  • click on setup to start installation.
  • click on next until installation will go to end
  • click on close.
  • Restart Computer.

Note :

After completion of JDK installation tester can create environment variable for JAVA_HOME in your windows system by following below navigation.

  • Click on start
  • Right click on my computer
  • Click on properties
  • Click on Advanced system setting
  • Select Advanced tab
  • Click on Environment variable button
  • Go to user variables
  • click on New button
  • Type JAVA_HOME and provide path of JDK folder
  • click on ok

Follow below image

Environment variable button

  • Go to system variable
  • Select path
  • click on Edit button
  • Add path of JDK bin folder followed by semicolon(😉 at the end of existing path value
  • Click on ok
  • Click on ok

Follow below image

Environment variables

How to verify java successfully installed or not into your local system

  • Open the command prompt.
  • Run command “java -version”

 

It should show your installed java version detail as shown in above image. That means java is installed successfully into your local system and you are ready to use it.

Step 2: Download and launch Eclipse IDE

  1. IDE stands for Intigrated Development Environment. Eclipse Ide is useful to write our test scripts in java or java based tools like selenium.
  1. We need to follow below URL to download and launch Eclipse Ide

 

http://www.eclipse.org/downloads/packages/release/Mars/2

Eclipse Mars 2 Packages

 

Download the Eclipse Mars, you can choose version Windows 32 bit or 64 bit based on your OS

  • wait until complete download.
  • copy downloaded file and paste into personal folder and extract
  • click on Eclipse folder
  • Here click on ‘eclipse.exe’ file directly. Here no need to install eclipse into your local system.

Step 3: Download Selenium WebDriver Jar Files.

After completion of eclipse Ide launching with the creation of project, package, and class with main(), we need to download selenium webdriver jar file.

Follow the below steps :

  • Go to google search
  • Enter seleniumhq then search it
  • Click on first link(https://www.seleniumhq.org/download/)
  • Click on download
  • Scroll to Selenium Client & WebDriver Language Bindings
  • Click on download for java based selenium webdriver

Selenium Client & WebDriver Language Bindings

  • wait until complete download.
  • copy downloaded jar file and paste into personal folder and extract

Step 4: Associate selenium webdriver with eclipse Ide.

  • click on ‘eclipse.exe’ to start eclipse
  • First time when you start eclipse software application, it will ask you to select your workspace where your work will be stored as shown in bellow image.

Workspace Launcher

Choose a workspace folder name as D:\workspace and click on ok button .Here You can change the workspace location from ‘Switch Workspace’ under ‘file’ menu of eclipse.

Create new project

  • Go to File
  • New
  • Go to Java Project and give your project name ‘SeleniumProject’
  • Click on finish button.

Create new package

  • Right click on source folder(src)
  • New
  • Package
  • give the package name ‘SeleniumTests’
  • Click on finish button.

Create New Class

  • Right click on package ‘SeleniumTests’
  • New Class
  • give the class name ‘myTestLogin’
  • click on Finish button.

Add external jars for that project

  • Right click on project ‘SeleniumProject’
  • go to Java build path
  • configure build path
  • >select Libraries
  • Click on add external JARs button
  • Then go your jar file folder path location
  • select both .jar files from D:\selenium-java 3.12.0.
  • click on open button
  • Click on add external JARs button
  • Then go your jar file folder path location
  • select all .jar files from D:\selenium-java 3.11.0\libs
  • click on open button
  • click on ok button

Steps to Download and Install firebug Add-on.

Follow my below url to install Fire Bug

https://addons.mozilla.org/en-US/firefox/addon/firebug/

Click on Add to Firefox button

Click on Install button

After install FireBug then go to

Tools > Web Developer > Firebug > Open Firebug (or)you can use shortcut key ‘F12’

 

After open the firebug. Right-click on field or element in your application then click on inspect element with firebug option.

In html code take either id(or)name(or)className etc. from highlighted section.

See below image

Hospital Management System

Note: Here no need to restart your Firefox after installing Firebug Add-On

Steps to Download and Install firepath Add-on.

Follow my below url to install Firepath add-on

https://addons.mozilla.org/en-US/firefox/addon/firepath/

Click on Add to Firefox button

FirePath By pierre Tholence

Click on Install button

Click on Restart Now

After install firepath then go to

Tools > Web Developer > Firebug > Open Firebug (or)you can use shortcut key ‘F12’

You could find ‘FirePath’ as shown below image

 

Selenium WebDriver First Program :

TestSteps:

  • Open the firefox browser
  • Navigate the application url
  • Get the Title of the WebPage
  • Print the title of the webpage
  • Verify Title of the WebPage
  • Enter the username
  • Enter the password
  • Clicking On Login Button
  • Identify and get the Dashboard Text
  • Print the Dashboard Text
  • To verify whether the welcome page successfully opened or not
  • Clicking On Logout Button
  • Close the current Firefox Browser

Selenium Code :

package seleniumProject;

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.firefox.FirefoxDriver;

public class SampleClass {

public static void main(String[] args) throws Interrupted Exception {

// open the firefox browser

WebDriver driver = new FirefoxDriver();

// navigate the application url

driver.get(“http://www.kosmiktechnologies.com/se leniumLiveProject/eKart/admin/”);

//Get the Title of the WebPage

String title=driver.getTitle();

//print the title of the webpage

System.out.println(title);

//Verify Title of the WebPage

if (title.equals(“Administration”))

{

System.out.println(“title verifiedsuccessfully”);

} else {

System.out.println(“title not verified successfully”);

}

// Enter the username

driver.findElement(By.name(“username”)).sendKeys (“Kadmin”);

// Enter the password

driver.findElement(By.name(“password”)).sendKeys (“K@admin”);

// Clicking On Login Button

driver.findElement(By.xpath(“//*[@id=’content’]/ div/div/div/div/div[2]/form/div[3]/button”)).cli ck();

// Identify and get the Dashboard Text

String text = driver.findElement(By.xpath(“//*[@id=’content’]/div[1]/div/h1”)).getText();

// Print the Dashboard Text

System.out.println(text);

// To verify whether the welcome page successfully opened or not

if (text.equals(“Dashboard”))

{

System.out.println(“Welcome pageverified successfully”);

} else {

System.out.println(“Welcome page not verified successfully”);

}

// Clicking On Logout Button

driver.findElement(By.xpath(“//*[@id=’header’]/u l/li[3]/a”)).click();

//Close the current Firefox Browser driver.close();

}

}

SELENIUM | BROWSER COMMANDS :

1.get() : This will be used to navigate the application url

Syntax : driver.get(“appURL”);

2.getTitle() : This will be used to get the title of the current Webpage.

Syntax : driver.getTitle();

3.findElement() : By using this we can identify single webelement On a webpage.

Ex: Button, checkbox, radio button etc.

Syntax : driver.findElement(By.Locator(“Locator-Value”));

4.findElements() : By using this we can identify list of webelements On a webpage.

Ex :

  1. Suppose if you want to identify dropdown values at a time then we use findElements method.
  2. Suppose if you want to identify list of frames in a webpage then we use findElements method.
  3. Suppose if you want to identify list of links in a webpage then we use findElements method.

Syntax :

List<WebElement> total_Links = driver.findElements(By.tagName(“a”));

5.sendKeys() : If you want to give the value to the input field(textbox,text area) then we use sendkeys method.

Syntax :

driver.findElement(By.locator(“locator-value”)).sendKeys(“text”);

6.getText() : If you want to get the particular text in a webpage then we use getText method.

Syntax :

String PageText=driver.findElement(By.Locator(“Locator-value”)).getText();

7.click() :Is there any click operation in your application then we use click().

Syntax :

driver.findElement(By.Locator(“Locator-value”)).click();

8.close() : This will be used to close the current browser window.

Syntax : driver.close();

Important Interview Questions :

1. How to Identify WebElement in selenium webdriver?

A )By using firebug and firepath we can Identify

WebElement.

2. Can we use firebug and firepath for chrome and Ie?

No,

1.Here firebug and firepath these two add-ons only for firefox.

2.Suppose if u want to identify the WebElement In chrome and ie here no need to install firebug and firepath. Becoz chrome and ie have its won developer tool to identify the web element.

3. What is the default package of selenium?

  1. org.openqa.selenium

4. What is the difference between findElement() and findElements()?Find ElementsfindElement() :

By using this we can identify single webelement On a webpage.

Ex : Button, checkbox,radio button etc.

Syntax : driver.findElement(By.Locator(“Locator-Value”));

TestSteps :

  • open the firefox browser
  • navigate the application url Enter the username
  • Close the current Firefox Browser

Selenium Program :

package seleniumProject;

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.firefox.FirefoxDriver;

public class findElementMethod {

public static void main(String[] args) throws Interrupted Exception {

// open the firefox browser

WebDriver driver = new FirefoxDriver();

// navigate the application url

driver.get(“http://www.kosmiktechnologies.com/se leniumLiveProject/eKart/admin/”);

// Enter the username

driver.findElement(By.name(“username”)).sendKeys (“Kadmin”);

//Close the current Firefox Browser

driver.close()

}

}

findElements() : By using this we can identify list of webelements On a webpage.

Ex :

  • Suppose if you want to identify dropdown values at a time then we use findElements method.
  • Suppose if you want to identify list of frames in a webpage then we use findElements method.
  • Suppose if you want to identify list of links in a webpage then we use findElements method.

Syntax :

List<WebElement> total_Links = driver.findElements(By.tagName(“a”));

TestSteps :

  • open the firefox browser
  • navigate the application url
  • Identify all the links and store into total_Links variable Print the total Links on a webpage
  • Close the current Firefox Browser

Selenium Program :

package seleniumProject;

import java.util.List;

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.WebElement;

import org.openqa.selenium.firefox.FirefoxDriver;

public class findElementsMethod {

public static void main(String[] args) throws InterruptedException {

// open the firefox browser

WebDriver driver = new FirefoxDriver();

// navigate the application url

driver.get(“http://www.kosmiktechnologies.com/se leniumLiveProject/eKart/admin/”);

//Identify all the links and store into total_Links variable

List<WebElement> total_Links = driver.findElements(By.tagName(“a”));

//Print the total Links on a webpage

System.out.println(total_Links.size());

//Close the current Firefox Browser

driver.close();

}

}

5.How to verify particular text on a webpage using selenium webdriver?  (Or) How to verify successful message on a webpage using selenium webdriver?

TestSteps :

  • open the firefox browser
  • navigate the application url Enter the username
  • Enter the password
  • Clicking On Login Button
  • Identify and get the Dashboard Text Print the Dashboard Text
  • To verify whether the welcome page successfully opened or not Clicking On Logout Button
  • Close the current Firefox Browser

Selenium Program :

package seleniumProject;

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.firefox.FirefoxDriver;

public class SampleClass {

public static void main(String[] args) throws Interrupted Exception {

// open the firefox browser

WebDriver driver = new FirefoxDriver();

// navigate the application url

driver.get(“http://www.kosmiktechnologies.com/se leniumLiveProject/eKart/admin/”);

// Enter the username

driver.findElement(By.name(“username”)).sendKeys (“Kadmin”);

// Enter the password

driver.findElement(By.name(“password”)).sendKeys (“K@admin”);

// Clicking On Login Button

driver.findElement(By.xpath(“//*[@id=’content’]/

div/div/div/div/div[2]/form/div[3]/button”)).click();

// Identify and get the Dashboard Text

String text =

driver.findElement(By.xpath(“//*[@id=’content’]/ div[1]/div/h1”)).getText();

// Print the Dashboard Text

System.out.println(text);

//To verify whether the welcome page successfully opened or not

if (text.equals(“Dashboard”))

{

System.out.println(“Text matched”);

} else {

System.out.println(“Text notmatched”);

}

// Clicking On Logout Button

driver.findElement(By.xpath(“//*[@id=’header’]/u l/li[3]/a”)).click();

//Close the current Firefox Browser

driver.close();

}

}

Control statements :

Syntax :

If(Actual_value.equals(Expected_value))

{

//Execute the code if condition is true

}else

{

//Execute the code if condition is false

}

Actual_value : Take the text from Testing Application.

Expected_value : client requirement

6.Difference between close() and quit() in selenium webdriver ?
Driver.close() :

By using this we can close the current browser window.

I.e Single window on which driver is having focus that will be closed only

Difference between close() and quit() in selenium webdriver

Driver.quit() : Every associated browser will be closed

I.e closed all the windows opened by the driver.

7. What is the purpose of public static void main() in java ?

public :

Since main() should be available to JVM. It should be declared as public.I f we don’t use main() as a public then it doesn’t make itself available to JVM and JVM cannot execute it.

Static :

We should be call the main() without creating an object, such methods are called static methods and we should be declared as static.

Void :

If main() it does not written any value then you have to put void(no value) before the main().

main():

If main() is not written in the java program then JVM will not execute the program.main() is the starting point for JVM to start execution of java.

What are the pre-requisites to run the selenium web driver?
  1. JDK 8
  1. Eclipse IDE
  1. Selenium JAR file
  1. Testing Application
  1. Browser (Firefox 53.0)
  1. Firebug
  1. Firepath
Selenium Training in Hyderabad

kosmik technologies is the best institute for selenium training in Hyderabad. we offer classroom and selenium online training courses by certified faculty. Selenium is an open source tool for web application testing. This tool primarily developed in JavaScript and browser technologies and hence supports all major browsers on all the platforms. Selenium is one of the best tool available in the market for a web application.

c# Dot net interview questions

c#questions and answers

c# interview questions and Answers

1.When call by value, call by reference, call by out?

 
 CALL BY VALUE:
Whenever we want to pass some value to a function. The modifications are not expecting to reflect back. To actual parameter then we will pass it as CALL BY VALUE.
 
CALL BY REFERENCE:
Whenever we want to pass some value and we are expecting the modifications. Should be reflected back to actual parameter then we will pass it as CALL BY REFERENCE.
 
CALL BY OUT:
Whenever we don’t want to pass any values but we are expecting back the modifications. then we will pass the particular parameter as CALL BY OUT.
 
2. What is Encapsulation? How can we achieve?
 
A) Wrapping STATES and BEHAVIOURS called as ENCAPSULATION. (Or) Binding VARIABLES and METHODS called as ENCAPSULATION. By implementing class we can achieve ENCAPSULATION.
 
3. What is abstraction? How can we achieve?
 
Abstraction means HIDING.
 
Abstractions are 2 types.
 
1) data abstraction:-
 
Hiding unwanted data called as data abstraction
 
2) Method abstraction:-
 
Invoking required method and hiding unwanted method called as method abstraction.
 
With the help of FUNCTION OVERLOADING, we can achieve Method ABSTRACTION.
 
4. What is Inheritance? Types of Inheritance?
 
Inheriting or deriving members from one class. To another class called as INHERITANCE.
 
C#.Net will support 5 types of Inheritance. They are
  • Single Inheritance 
  • Multi-level Inheritance 
  • Many Inheritance 
  • Hierarchical Inheritance 
  • Hybrid Inheritance.
 5. Is C#.Net will support much Inheritance?
 
In C#.NET many inheritances are not possible by using classes. which is possible with the help of INTERFACES.
 
6. What sealed class? When will we go for sealed class?
 
While characterizing a class, in the event that we have utilized ―sealed‖ watchword. Then that class can be called as SEALED CLASS. It can’t be acquired.
 
At whatever point we need to confine to get a class we can go for fixed class.
 
7.Why property?

 

  • To assign the value to a class level variable. After creating the object to retrieve the value from the class level variable
     
  • The property will provide SECURITY to variable data.
     
  • The property will provide VALIDATION FACILITY for variable data.
    At the time of Assigning.
 
8. What is static polymorphism and dynamic polymorphism?
 
A) STATIC POLYMORPHISM:
 
A method which will bind at compile time will execute. In runtime called as static polymorphism or early binding or compile time polymorphism
 
DYNAMIC POLYMORPHISM:
 
A method which will bind at compile time will not execute, instead of that a method. which will bind at runtime will execute called as RUNTIME POLYMORPHISM.
 
9. What is function overloading? When will we go for function overloading?
 
A) FUNCTION OVERLOADING: Having many methods with the same name but a different no. of arguments or the different type of arguments or different order of arguments. In a single class or in a combination of base and derived class.
 
WHEN: Whenever we want to install the same method with the different functionalities. Then we have to go for FUNCTION OVERLOADING
 
10.Difference between constructor and property?
 
Constructor
 
It used to initialize the instance variables at the time of creating an object.
 
PROPERTY
 
It used to assign the value to the class level variables as well as can retrieve the value from class level variables
 

For more Dot net interview questions: click here

Dot training in Hyderabad: 

Kosmik provides dot net training in Hyderabad. we are providing lab facilities with complete real-time training and training based on advanced concepts.

c# interview questions and answers

 

 
c#questions and answers

c# interview questions and answers for freshers

1. Why C#.Net?
 
A) To develop any type of application by using Dot NET. we must one Dot NET LANGUAGE to write the business logic of that application.
 
2. Explain about primitive data types?
 
 In C#.NET, according to the type of the data and size of the data, data types classified into 5 types.
 
They are—
 
1. Numerical Data types
 
a) Signed Numerical data types: sbyte, short, int, long
 
b) Unsigned Numerical data types;-byte, ushort, uint, ulong
 
2.Floating
 
float, double, decimal
 
3.Character related Data types a) Char
 
4.Logical Data Types
 
a) bool
 
5. General data Types
 
a) string
 
b) object
 
These data types called as PRIMITIVE DATA TYPES.
 
3. What is the MaxValue and MinValue?
 
A) MaxValue & MinValue predefined constants, which are members. of every primitive data type structure except bool.
 
. Using this Constant we can get the LEAST value and MOST value of a data type.
 
4. Difference between value types and Reference types?
 
VALUE TYPES
 
1.In value types, data will storing in STACK MEMORY
 
2.Value type variable can contain the actual data.
 
3.In primitive data types except General data types called VALUE TYPES. They are Numerical, Floating, Character and Logical Ex: Int, Long, Char
 
4. Structures and Enums are value types
 
REFERENCE TYPES
 
1.In this, Data will be storing in HEAP MEMORY
 
2.Reference type variable will contain the address of the data.
 
3.In primitive data types only General data types will come under REFERENCE TYPE EX: String, Object
 
4.Class, interface, delegates come under this.
 
5. What is the output?
 
static void Main (string [] args)
 
{
 
Char c=’a’; int j=c;
 
Console.WriteLine (j);
 
Console.ReadLine ();
 
}
 
Output: 97
 
6.Can I assign 1 or 0 into bool variable? static void Main(string[] args)
{
 
bool b = 1; Console.WriteLine(b); Console.ReadLine();
 
}
 
A) No.
 
7. What is the output ?
 
static void Main(string[] args)
 
{
 
bool b = true; Console.WriteLine(b); Console.ReadLine();
 
}
 
OUTPUT: True 8.Can we assign null value into value type variable?
 
but we can assign null values into reference type variable.
 
9.How to assign null value into value type variable?
 
A) We have to go for NULLABLE VALUE TYPES.
 
Syntax: <ValueType> ? <VariableName>=NULL;
 
10. What is the difference between GetType() and typeof()?
 
Typeof()
 
1.Type It will return the given data base type 2.It is a operator
 
GetType()
 
1.It will return the given variable data type base type 2.It is a method
 

For more Dot net interview questions: click here

Dot net training in Hyderabad:-Kosmik provides dot net training in Hyderabad. we are providing lab facilities with complete real time training and training based on advanced concepts.

 
 
RPA interview questions

rpa interview questions

rpa interview questions:-

 

1.What is difference between error and exception?
Errors are those occur at development time and exceptions. Are unforeseen errors which occur at run time.
2.hat are two major types of exception?
All the exceptions in blue prism categorised under two types. Business exception and System exception.
3.How do you handle an exception?
In blue prism we handle exception with the help of recover and resume stage.
 
4.What is the role of recover stage and resume stage?
Recover stage catches an exception and Resume stage neutralises exception.
5.What is recovery mode?
Path between recover stage and resume stage called as recovery mode. Recovery mode used to handle an exception.
6.What is exception preserving?
Exception preserving used to re throw an exception to upper pages. To preserve an exception we need to check preserve type and detail of current exception. The check box in the property window of exception stage.
7.What is exception bubbling?
The way in which exception moves upwards through the layers. Of a solution known as exception bubbling. Exception moves towards main pages when it unhandled in lower pages or actions.
8.How many recover and resume stages required to handle all exception in a page?
Only one resume and recovery stage is enough to handle all exceptions on a page.
9.What are exception blocks and why they used
Exception blocks used to isolate an area of exception handling. With the help of exception blocks we can use two or more recover and resume stages in a page.
10.What is use of exception stage?
Exception stage used to throw an exception to recover stage.

Rpa training in Hyderabad:-

Kosmik Technologies Offers RPA Training in Hyderabad.We will give 100% real time training with advanced concepts and tools by real time experienced trainers.

For more RPA interview questions:-  click here

What is Robotic Process Automation
 
 What is Robotic Process Automation
 
 
 
What is Robotic Process Automation
 
 

What meant by RPA (Robotic Process Automation)?

 
“Robotic Process Automation refers to a style of automation. where a computer can mimic human in completing rules based task.”
 
Which is quite mean that creating software robots to perform repetitive and rules-based computer work.
 

2) Where do we use RPA?

 
Certain work or certain process that do not need any manual intervention or any human interference. mean that no need to take any manual decision to complete that work.
 
For example, let say we have an employee whose day in day out job is to download some pdf files from a different web application. And e-mail these files to various users based on certain business rules. The bot can be programmed to do the exactly same that a human would do. It launches the application login with credentials searches the pdf files downloading. That pdf files by clicking save button and then use outlook and send emails. All these done on the front end like a human user would do.
 

3) Limitations in RPA?

 
Advantages:
 
1) No need to change structure of the application.
 
2) Robot work 24/7.
 
3) A robot used by one or more process on different schedules.
 
4) RPA reduce cost and improves efficiency and accuracy.
 
Disadvantages:
 
1) Speed of the bot depends upon the application.
 
2) The bot doesn’t responsible for the logic of the business application.
 
3) Even minor changes to the application need to reconfigure the bot.
 
4) Some RPA tools that are available in IT market?
 
a) Blue Prism
 
b) UI Path
 
c) Automation Anywhere
 
d) Work fusion
 
e) Open span………etc. and some other tools.

 Blue Prism? 

Blue Prism is one of the RPA tool. Which used to automate business applications. like windows applications, web applications, Java applications and mainframe applications. creating flowcharts using flowchart elements called stages in a blue prism. and create business objects that interact with external business. applications mean target application to automatic.

To learn more 

To learn more about Blue Prism: click here

 
Robotic process automation blue prismrobotic process automation blue prism
 

1) Blue Prism?

 
Blue Prism is one of the RPA tool. Which used to automate business applications. like windows applications, web applications, Java applications and mainframe applications. creating flowcharts using flowchart elements called stages in a blue prism. and create business objects that interact with external business. applications mean target application to automated.
 

2) Blue Prism Modules?

 

Blue Prism has six different modules that can be accessed from the tabs on the top or navigation bar of the left.

 Home: Home is the first module that available when we signed into a blue prism. it shows the default dashboard that created on dashboard module by the developer.

 
 Studio: Studio is the place where we create process automation. By drawing flowcharts and creating business objects. that interact with the Business applications. The studio has two sub-modules a) Process studio, b) Object studio.
 
Control Room: This is the place where we run and schedule the processes. Manage queues, sessions and allocating the resources. which are the computers that are running blue prism?
 
 Dashboard: This is the place where we create the dashboard with blocks of graphs. charts called tiles they generated from different datasets. These tiles are self-refreshing and customization.
 
Release Manager: In release manager tab we can create packages and release files. we can move the code between various environments like development, testing, and production.
 
System Manager: This module provides sys admin functionalities. like user account management setting up environment variables, storing and managing credential, manage audit logs …..
 

3) What is process studio in Blue prism?

 
Process Studio:
 
An area of the blue prism where we can create our blue prism process I called process studio.
 

4) What is a process?

 
a) A blue prism process created a diagram that looks like a business flow diagram. (or)
 
Blue prism process nothing. But a computer program that created a diagram in the graphical representation.
 

5) What is object studio in Blue Prism?

 
Object Studio:
 
An area of the blue prism where we can create the business object called Object studio.
 

6) What is Object?

 
Object:
 
An object is an interface between Process and external business application. Object grabs
 
 

7) Differences between Process studio and Object studio?

 
a) In process studio, we can create process. But in object studio, we can create a business object.
 
b) Process studio having the main page as a default page. But in object studio we have two default pages those are “initialize” and Clean Up” pages.
 
c) In process studio, the pages arranged in a hierarchy. But in object studio pages arranged in flat group means in a series format.
 
d) Process studio doesn’t have some stages that are available in object studio. Those stages are navigate, read, write, code and wait for stages

Rpa training in Hyderabad:

 Kosmik Technologies Offers RPA Training in Hyderabad. We will give 100% real-time training with advanced concepts and tools by real time experienced trainers.

click here for Top 10  RPA interview questions

Angularjs interview questions

 

angularjs interview questions

Angularjs interview questions

 

What is dom?

Dom means document object model is representation of html web page in objects relationship model.

Java scripts manipulate HTML elements in the help of DOM methods.DOM can access Html elements ID’s   class, tag names to and modify and delete Html elements.

It can set CSS properties values.

 

2.How methods we have to access DOM elements?

The three main DOM methods to access Html elements.

1.get Element BY ID()

2.get Element BY class()

3.get Element BY TagName()

3.2+4+”3″?

63

 

4.What is use of number?

Number function is used convert a value of character to number format in java script

5.print 2 4  6 8 10 12 ?

<script>

n=2;

For (i=2;i<=2;)

{

document.write (i);

i=i+n;

}

</script>

 6.what is the function?

Function is a block of code which contains JavaScript statments with a specific name and optional arguments

Ex:

<script>

Function Hello()

{

Document.write(Hello);

}

</script>

7.Difference between the while and Do-while and For?

While

This loop is used to execute the statement when condition is true

Ex:var i=10;

While (i=<10)

{

Document.write(i+”<br>”);

I+

}

Do-While

This loop is used to execute the statement when the while condition is true

Var i=11

{

do

Document.Write(i+”<br>”);

I++;

}

while(i<=10)

 

For

This is used to execute the statement when the condition satisfies.

It enter only when condition is satisfie.


8.print Following

1

1 2

1 2 3

for(i=1;i<=3;i++)

{

For(n=1;n<=i;n++)

{

Document.write(n);

Document.write(“<br>”);

}

 

9.print odd numbers upto 20 using for and while loop?

for(i=1;i<=20;i++)

{

Document.write(i+”<br>”);

}

angularjs training in hyderabad:-

Kosmik Technologies provides AngularJs training in Hyderabad. we are providing real time training and hands on experience in all concepts.

 

Angularjs  introduction

 

Angularjs introduction

Introduction to Angularjs:–

AngularJS Introduction AngularJS is a JavaScript framework.Architecture, Advantages Angularjs Architecture Diagram.User events trigger the functions which are stored inside your controller. The user events are part of the controller.

What is angularjs ?

  • Angularjs is a client side (browser side) technologies,which is developed by google & Framework of Javascript.
  • By using Angularjs we can decrease burden at server side so applications most reliable increase  speed, secure, code reusable.
  • using angularjs ,we can develop SPA.spa –> single page application. Even gmail is also a single page application. it means content will asynchronously.

Version of angularjs?

  • Current version–> angular 6.x
Versions

Angulajs1

Angulajs2

angulajs3

angulajs4

angulajs5

angulajs6

Is platform Dependent?

Using angular js , we can develop hylorid application. It means, which will work in different platforms like

Web app

Android

IOS

Window

blackberry

Easy to test -> Karma, jasmine, protractor.

Difference b/w angularjs & angular :–                                             

Angularjs 

  • angularjs is working with js
  • If will work with “CDN”
  • If don’t sperit folder structure
  • specially web app development
  • SEO friendly
  • works with Es5

Angular

  • angular is working with typescript
  • To install angular project,we node node package (npm)manage
  • Angular is well developed,and have good folder structure & Excellent work flow
  • mobile app & web application development
  • more seo friendly than angularjs
  • works with Es6
Important points:                           
  • angular has better performance than angularjs
  • angularjs more testable
  • React js is competitor to angular.
Difference b/w angular & React:–

Angularjs

  • Angularjs developed by google.
  • Javascript framework
  • Supports two-way data binding
  • Works with js and html
  • Current version is angular 6
  • Using angular we can develop hybrid application.using Ionic frame.

Reactjs

  • Reactjs developed by facebook
  • Javascript framework
  • Supports one-way data binding
  • Works with js and js a
  • Current version is react js 16
  • Using reactjs we can develop mobile application.using react native.

Click here: For  AngularJS Interview Questions and Answers