Sunday, January 5, 2020

How to Handle Droup Down in Selenium


Example:- 1

package com.basicselenium;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.Select;

public class StaticDropdown {

public static void main(String[] args) {
WebDriver driver;
System.setProperty("webdriver.chrome.driver", "F:\\chromedriver.exe");
driver=new ChromeDriver();
driver.get("https://www.spicejet.com/");
driver.manage().window().maximize();
Select sel=new Select(driver.findElement(By.id("ctl00_mainContent_DropDownListCurrency")));
sel.selectByIndex(2);
sel.selectByValue("INR");
sel.selectByVisibleText("AED");

}

}

Example:-2
package com.basicselenium;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.Select;

public class HelperClass {

public static WebDriver driver;
public static String url="https://www.spicejet.com/";
public static void launchBrowser(){
try{
System.setProperty("webdriver.chrome.driver", "F:\\chromedriver.exe");
driver=new ChromeDriver();
}
catch (Exception e) {
System.out.println(e.getMessage());
}
}

public static void maxmizeBrowser(){
try{
driver.manage().window().maximize();
}
catch (Exception e) {
System.out.println(e.getMessage());
}
}

public static void getUrl(){
try{
driver.get(url);
}
catch (Exception e) {
System.out.println(e.getMessage());
}
}

public static void clickAdlt(){
driver.findElement(By.id("divpaxinfo")).click();
Select sel_adalt=new Select(driver.findElement(By.id("ctl00_mainContent_ddl_Adult")));
sel_adalt.selectByIndex(5);

Select sel_child=new Select(driver.findElement(By.id("ctl00_mainContent_ddl_Child")));
sel_adalt.selectByValue("3");

Select infant=new Select(driver.findElement(By.id("ctl00_mainContent_ddl_Infant")));
infant.selectByIndex(3);

}



}

---------------
public WebDriver driver;
//public DroupDownupdated(WebDriver driver){
//this.driver=driver;
//}
@Test()
public void tc_01(){
//WebDriver driver = null;
HelperClass.launchBrowser();
//driver=new ChromeDriver();

//System.setProperty("webdriver.chrome.driver", "F:\\chromedriver.exe");
//driver.get("https://www.spicejet.com/");
//driver.manage().window().maximize();
HelperClass.getUrl();
HelperClass.maxmizeBrowser();
//driver.findElement(By.id("divpaxinfo")).click();
HelperClass.clickAdlt();

}

}

How to Handle Suggestion Drop Down 
==============================
package com.basicseenum1;

import java.util.List;

import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;

public class VerifyDropDown {

public static void main(String[] args) throws InterruptedException {
WebDriver driver;
System.setProperty("webdriver.chrome.driver","F:\\chromedriver.exe");
driver=new ChromeDriver();
driver.get("https://www.makemytrip.com/");
driver.manage().window().maximize();
driver.findElement(By.id("fromCity")).click();
driver.findElement(By.xpath("//div[@id='react-autowhatever-1']/preceding::input[1]")).sendKeys("Hyd");
Thread.sleep(2000);
driver.findElement(By.xpath("//div[@id='react-autowhatever-1']/preceding::input[1]")).sendKeys(Keys.ARROW_DOWN);
Thread.sleep(2000);
driver.findElement(By.xpath("//div[@id='react-autowhatever-1']/preceding::input[1]")).sendKeys(Keys.ENTER);
Thread.sleep(2000);
//driver.findElement(By.id("toCity")).click();
driver.findElement(By.xpath("//div[@id='react-autowhatever-1']/preceding::input[1]")).sendKeys("PAT");
Thread.sleep(2000);
driver.findElement(By.xpath("//div[@id='react-autowhatever-1']/preceding::input[1]")).sendKeys(Keys.ARROW_DOWN);
Thread.sleep(2000);
driver.findElement(By.xpath("//div[@id='react-autowhatever-1']/preceding::input[1]")).sendKeys(Keys.ENTER);
Thread.sleep(2000);




}

}















Saturday, January 4, 2020

How to upload file in Selenium and How to make dynamic path location

package com.autoit;

import java.io.File;

import java.io.IOException;
import java.util.HashMap;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.interactions.Actions;

public class FileUpload {
public static void main(String[] args) throws InterruptedException, IOException {
try{
WebDriver driver;
String downloadPath=System.getProperty("user.dir");//using this steps we will get System path means project path F:\MyWorkSpace\Selenium_Batch_2018
System.setProperty("webdriver.chrome.driver", "F:\\chromedriver.exe");
//By using below line of code to copy the downlaod file in project locations
HashMap<String, Object> chromePrefs = new HashMap<String, Object>();
chromePrefs.put("profile.default_content_settings.popups", 0);
       chromePrefs.put("download.default_directory",downloadPath);
ChromeOptions options=new ChromeOptions();
options.setExperimentalOption("prefs", chromePrefs);
driver=new ChromeDriver(options);
driver.get("https://www.ilovepdf.com/word_to_pdf");
driver.findElement(By.xpath("//span[contains(text(),'Select WORD files')]")).click();
Thread.sleep(3000);
Runtime.getRuntime().exec("D:\\fileupload.exe");
Thread.sleep(3000);
// WebElement ele =driver.findElement(By.id("processTask")).click();
WebElement ele=driver.findElement(By.cssSelector("#processTask"));
Actions act=new Actions(driver);
act.moveToElement(ele).click().build().perform();
Thread.sleep(3000);
//driver.findElement(By.id("pickfiles")).click();
File f=new File(downloadPath+"/Resume.pdf");
if(f.exists()){
System.out.println("File is downloaded");
if(f.delete()){
System.out.println("File is delated");
}
}
else{
System.out.println("File is not downloaded");
}
System.out.println("***Test case is passed***");
}
catch(Exception  e){
System.out.println(e.getMessage());
}
//driver.close();
}
}
=========================================================================




























Saturday, December 28, 2019

Selenium Real Time Project

Hi there ,

Now I have added Selenium Live project .In session I will be cover 

1)Important topic of java like Collection, String,OOP concept .

2)Logical programming which is asked in Interview .

3)Frame work component and Development  of framework 

4)Resume Preparation as experience what project you have to mentioned

5)Demo Interview Preparation with Real Time expert

course fee is only 2500/
duration 3 weeks 





Interview Question  

What is Map In Core java.
Ans:-  You can find in below videos .

Friday, December 20, 2019

Going to Start New Batch for Core java Selenium + Python Selenium + Data Analysis

We provide Real Time hands on Training as Experience level. ...We have record of 100% Placement with good package.Our agenda is Your Success is Our Success.(If you will not get placement 100% fee is refundable)

New Batch is going to Start on 4th Jan(offline/online Session Weekdays/Weekend ) for Automation Testing ,Manual Testing,Core python+Advanced python

1)Core java + Selenum WebDriver + RealTime Project

Syllabus :- https://ingenioustechhub.blogspot.com/2019/12/my-syllabus.html


2)Core python + Advanced python + Selenum WebDriver+ Real Time Project

Syllabus:- https://ingenioustechhub.blogspot.com/2019/12/python-selenium-syllabus.html


3)Manual Testing + RealTime Project

Syllabus:- https://ingenioustechhub.blogspot.com/2019/12/python-selenium-syllabus.html

4)RealTime Project(Automation Testing-->Development of framework)

Real Time Interview preparation with IT expert (We will support you until u will get placed )

Timing 7:00:am to 8:00am (Daily Session),3:00 pm to 5:00 pm IST ,8pm to 10 pm IST ( Free Demo Class ).Don't miss demo class refer your friend also

Passout(2010,2011,2012,2013,2014,2015,2016,2017,2018,2019)

Timing 
7:00:am to 7:45 am Ist (Weekdays) (Core java + Selenum WebDriver + RealTime Project)
7:00:am to 7:45 am Ist (Weekdays)  Core python + Advanced python + Selenum WebDriver+ Real Time Project)

3:00 pm to 5:00 pm IST(Weekend)  Core python + Advanced python + Selenum 
WebDriver+ Real Time Project

10 am to 12 pm IST ( Weekend ). Core java + Selenum WebDriver + RealTime Project

Don't miss demo class refer your friend also )

Duration 45 days

For Registraton contact below mentioned no...

Mobno-7829471985,6362190671.

Weekdays and weekend batch is available

Address:- LandMark :- Naranaya Medical College Near Libarary Park.

SR Nagar(AndharaBank) Main Rd, Srinivasa Nagar, Sanjeeva Reddy Nagar, Hyderabad, Telangana 500038

https://www.youtube.com/channel/UC0GLi8ttkIr1VvDk7EVCuIg?view_as=subscriber
https://www.facebook.com/ingenious123/?ref=bookmarks
https://www.facebook.com/groups/108383303164936/?ref=bookmarks


Friday, December 13, 2019

Python Selenium Syllabus

Core python + Advanced python + Data Analysis(This python syllabus will help you WebDevelopment ,Data Science and Machine learning +Devoops
=================================================================
Python Syllabus
================
1.Introduction to python
2.Interoduction to script
3.Define IDE
4.Variables in python
5.Type Conversion or Type Casting
6.String Operators
====================
a)Dirrerent ways to create a string
b)String indexing and String slicing
c)String concatenation and String multiplication
d)String unpacking
e)capitalize() and title and split()
f)del,count,find(),swapcase()
g)reverse(),replace(),and sort()
h)String immutable.
7)python Lists
================
a)Lists are mutable
b)Getting to Lists
c)List indices
d)Traversing a list
e)List operators
f)List operators
g)List slices
h)Lists Methods
i)Map,filter and reduce
j)Deleting elements
k)Lists and String
8)Tuple Data Structure
=======================
a)Creating a tuple
b)Creating and working with homogeneous tuple
c)tuple indexing and slicing
d)tuple concatenation and tuple multiplication.
e)tuple unpacking and tuple immutable
f)all,any,len,and sort
g)del keyword
h)python tuple ascending and decending.
9)Sets Data Structure
======================
a)How to create a sets?
b)Iteration Over sets
c)Python Set Methods
d)Python Set Operations
e)Union of Sets
f)Built in funcation with sets
g)Python Frozenset
10)Dictionary Data Structure
=============================
a)How to create a dictionary?
b)Python Hashing
c)Python Dictionary
d)Delete keys from the dictionary
e)Dictionay items() method
f)Sorting the dictionary
g)Python Dictionary in-built Functions
h)Dictionay len() Method
i)Variable Type
j)Python List cmp() method
k)Dictionary Str(dict)
11)Python Operators and Operands
==============================
a)Arithmetic Operators
b)Comparison Operators
c)Python Assignments Operators
d)Membership Operators
e)Identity Operators
f)Operator precedence
12)Python Conditional Statements:-
====================================
a)How to use "if condition" in conditional structures
b)if statement
c)if..else statement
d)How to use "else condition"
e)When else condition is not work
f)How to use "elif" condition
g)How to execute conditional statemet with minimal code
h)Nested If statment
13)Python Loops
=================
a)How to use "While Loop"
b)How to use "For Loop"
c)How to use For loop for set of other things besides numbers
d)Break statements in For loop
e)Continue statements in for loop
f)Enumeration funcation for For loop
14)Python Funcations ans Arguments
===================================
a)Defining funcation and working with funcations
b)Using def keyword for funcations
c)Called funcations and funcation defining and calling funcations
d)Formal arguments and actual arguments
e)Working with name arguments and keywords arguments
f)Default arguments and positional arguments
g)Variable length arguments
h)Nested funcations
Advanced Python
================
15)File Handling
---------------
a)Creating a file in a directionay
b)Open the file in the python
c)Different ways to open the file python
d)Writing to the file
e)Appending the data to the existing file
f)Modes of operations
g)Seek and tell methods
h)Readline and readlines
i)Working with words and characters in the file
16)OOPS Concepts
=================
a)Class and objects
b)Class variables and instances variables
c)Constructor
d)Data hiding
e)Method overloading and overriding
f)Abstraction
g)inheritance
h)Polymorphism
i)Encapsulation
17)Modules
=============
a)What is module and purpose of modules
b)Different types of modules
c)Different ways to import modules
d)Standard modules and user modules
e)From ... imports
f)Creating own modules
g)Using modules in other modules
h)Working with some standard modules
i)MATH,DATE TIME,CALENDAR,SYS,OS Modules
18)Excepting Handing in python
================================
a)What is an exception
b)Handling excepting
c)Try and except block
d)Handling multiple exceptions using multiple excepts.
f)Handling multiple exceptions using except
g)Handling exceptions with else and finally blocks
h)Using assert for handling exceptions.
19)Iterators,generators and decorators
a)Working with yield keyword
b)Different between yield and return
c)Decorating a function with another function
20)Regular Expression
21)Command Line Arguments
a)Reading command line Arguments
b)Using command line Arguments
22)Working with Database connection.
a)Connecting to database from python
b)Creating connection to the database from the python application
c)Creating database and tables from python appliication to the database
d)Fetching data and updating data in the entities
e)Using Cusrsor to execute SQL command in python application
f)Using Fetchall and Fetchone methods
20)Unit Testing in python
a)Important unit test module
b)Calling all unit test cases
c)assertEqual,assertTrue and assertFase
21)Regular Expression
a)Basic of Regular expression
b)Findall funcation
c)Serch funcation
d)Match methods
1)Group
2)Groups
e)Matching and serching
f)Compile and sub funcations
g)Mobile number verifiacation
h)Email id verifications
i)web Scrapping
Data Analysis Numpy
DataAnalysis Pandas
Data Visulization Matplotlib
Data Visulization Geographical Plotting
Data Visulization Plotly and Cufflinks

Selenium Syllabus + Framework
============================
1>Download and Install python
2>Configure Setup- Selenium,TestNG
3>Difference between Webdriver, RC and IDE
4>How to execute testcases in IE browser using Selenium 
5>Challenges with IE browser in Selenium 
6>XPath plugin for Firefox
7>Complete stydy of Dynamic XPath in Selenium
8>XPath plugin for Chrome
9>How to verify Page title in Selenium Webdriver
10>How to work with Radio button and Checkbox in Selenium
Webdriver
11>Handle Basic Dropdown in Selenium WebDriver
12>Guide to perform Drag and Drop in Selenium
13>How to perform Advance activity in Selenium like- Mouse Hover,
RightClick, DoubleClick, Keyboard Event
14>Implicit wait in selenium Webdriver
15>Explicit Wait in Selenium Webdriver
16>Fluent Wait in Selenium Webdriver
17>How to capture error message in Selenium Webdriver.
18>How to handle frames in Selenium Webdriver
19>How to handle Alert in Selenium Webdriver
20>How to handle Calender in Selenium Webdriver
21>How to capture Screenshot in Selenium
22>How to capture screenshots of failed test cases in Selenium
Webdriver
23>How to capture tooltip in Selenium Webdriver
24>How to scroll page in Selenium Webdriver
25>How to handle Exception in Webdriver
26>Solution for java.lang.illegalstateexception in Selenium
Webdriver
28>How to handle Element not visible exception
29>Solution for sendkeys(CharSequence) in Selenium
30>How to Handle Stale element reference exception in Selenium
Webdriver
31>Difference between findElement and findElements in Selenium
Webdriver
32>- Page Object Model in Selenium – Complete Guide
33>Read and Write Excel file in Selenium using Apache
34>Data Driven Framework in Selenium
35>Maven Integration with Selenium
36>Configure Eclipse with Selenium and TestNG
37>Create First TestNG Program and Execute.
Configure Eclipse with Selenium and TestNG
38>Check reports generated by TestNG
39>Cross browser testing using TestNG
40>Create Data driven framework using DataProivider
41>How to execute only failed testcases in Selenium Webdriver
42>How to disable testcase in Selenium using TestNG
43>How to group Testcases in Selenium using TestNG
44>How to create dependency between Test cases in Selenium
Webdriver
45>How to execute testng.xml file through Java Program
46>Execute Selenium Webdriver Test cases parallel using TestNG
48)Git
49)Jenkins
50)FrameWork from scratch
1)Develop Maven project (How to configure maven)
2)Create Page Object model
3)Create Base class
4)create utility class
5)create Handler class
6)Run all test cases using XML file
7)Create log4j
8)Take screenshot for fail test cases

Happy leaning .........................................................................................................................................

Duration of Course 45 days 

7:00:am to 7:45 am Ist (Weekdays)  Core python + Advanced python + Selenum WebDriver+ Real Time Project)

3:00 pm to 5:00 pm IST(Weekend)  Core python + Advanced python + Selenum 

WebDriver+ Real Time Project

Course fee is 10000/ 


For Registraton contact below mentioned no...

Mobno-7829471985,6362190671.

Weekdays and weekend batch is available

Address:- LandMark :- Naranaya Medical College Near Libarary Park.

SR Nagar(AndharaBank) Main Rd, Srinivasa Nagar, Sanjeeva Reddy Nagar, Hyderabad, Telangana 500038

Wednesday, December 11, 2019

Interview Question Remove all Spaces in String


package com.javacoding;

public class RemoveAllSpaceOfString {
public static String replaceAllSpace(String s1) {
  String s2=s1.replaceAll("\\s", "");
System.out.println(s2);
return s1;
}
public static void main(String[] args) {
replaceAllSpace("ahfajk    asf   fgdss");

}

}

Q) How To Find Duplicate Characters In A String In Java?

Step1:- Creating a HashMap containing char as key and it's occurrences as value. Step2:- Converting given string to char array. Step3:- ...