UrbanPro
true

Learn Selenium from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Learn Selenium with Free Lessons & Tips

Ask a Question

Post a Lesson

All

All

Lessons

Discussion

Lesson Posted on 19/12/2019 Learn Selenium with Java

How to Read Data From Property File

Sarthak Chadha

I am Sr. QA Lead having experience in multiple companies/projects. Currently working in Top MNC in Noida. Experience...

1. Create a property file using New > File > Given name - like config.properties (it must be saved with .properties). 2. Add data in config.properties like: browser = chrome environment = qa 3. Add a class to read the property file (see below class) import java.io.FileInputStream;import java.io.IOException;import... read more

1. Create a property file using New > File > Given name - like config.properties (it must be saved with .properties).

2. Add data in config.properties like:

browser = chrome

environment = qa

3. Add a class to read the property file (see below class)

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

public class ReadingProperties {

static FileInputStream fis;
static Properties prop;

public static String getValueOfPropertyFile(String value) throws IOException {

fis = new FileInputStream("-------Path of the property file-------");
prop = new Properties();
prop.load(fis);

return prop.getProperty(value);
}

}

4. Where you want to read the data just call - ReadingProperties.getValueOfPropertyFile("----pass the key which you want from property file").

The function will return to the value of that key.

read less
Comments
Dislike Bookmark

Answered on 06/02/2019 Learn Selenium

Gayatri Mishra

Freelance Coach for Selenium Automation using Java , POM , TestNG , HTML with project

The mentor will guide you the java basics wrt selenium automation. You can able to learn. Gayatri
Answers 19 Comments
Dislike Bookmark

Lesson Posted on 23/11/2018 Learn Selenium with Java

Why we declare WebDriver driver = new FirefoxDriver(); and not FirefoxDriver driver = new FirefoxDriver();

Srinivas Kini

*Overall having 12+ years experience in IT with various MNC's. * Automation tool experience is 10+...

Here, List or WebDriver is an Interface - a contract or set of rules created for implementing class.So, in Java, we cannot create an instance of an interface. ieI cannot say List list = new List();But classes can be instantiated. Hence,FirefoxDriver fd= new FirefoxDriver(); andArrayList list=new ArrayList();are... read more

Here, List or WebDriver is an Interface - a contract or set of rules created for implementing class.
So, in Java, we cannot create an instance of an interface. ie
I cannot say List list = new List();
But classes can be instantiated. Hence,
FirefoxDriver fd= new FirefoxDriver(); and
ArrayList list=new ArrayList();
are meaningful because both are classes in Java.
Now, coming back to the same question. When we say FirefoxDriver fd= new FirefoxDriver(); or ArrayList list=new ArrayList();
It is nothing but using specific implementation. ArrayList or FirefoxDriver. If we have code like this, then in the future, if we want to switch to
other implementations of List or WebDriver then we need to modify our complete code as there is no guarantee that the rest of the code doesn't make use of methods specific to the particular class. However, if given like this:
List list = new ArrayList();
WebDriver driver = new FirefoxDriver();
It gives the flexibility to switch implementation any time with minimal rework.
For eg: changing ArrayList to LinkedList you can change the code to List list = new LinkedList(); from List list = new ArrayList();.

read less
Comments
Dislike Bookmark

Learn Selenium from the Best Tutors

  • Affordable fees
  • Flexible Timings
  • Choose between 1-1 and Group class
  • Verified Tutors

Lesson Posted on 23/11/2018 Learn Selenium with Java

Use JavascriptExecutor to do many cool things in Selenium

Srinivas Kini

*Overall having 12+ years experience in IT with various MNC's. * Automation tool experience is 10+...

Javascript is a compelling language to interact with DOM. So it would make sense to use Javascript to run in the browser using Selenium whenever there is no other way to work on a particular element using Selenium. JavascriptExecutor is an interface. By creating object JavascriptExecutor jse=(JavascriptExecutor)driver;... read more

Javascript is a compelling language to interact with DOM. So it would make sense to use Javascript to run in the browser using Selenium whenever there is no other way to work on a particular element using Selenium.

JavascriptExecutor is an interface.
By creating object JavascriptExecutor jse=(JavascriptExecutor)driver;
we can use method executeScript to execute anything in the browser using javascript.

Firstly, some of the basic things like a scroll, get URL, Title can be performed using javascript with the following code.

window.scrollBy(0,400); // x, y --> x is for horizontal scroll. y is for vertical scroll. And if you pass negative value it scrolls in other direction.

document.URL; // get URL of current browser
document.domain; // get domain of browser
document.title; // get title of the browser page.

Now, this code we can execute in selenium using.

JavascriptExecutor jse=(JavascriptExecutor)driver;
jse.executeScript("window.scrollBy(0,400);");

it would scroll down by 400 pixels from the current position.

You could also javascript returning some data such as in boolean, long, String, WebElement and using in your selenium code.

Eg:
String currentURL= jse.executeScript(""return document.URL").toString();

Similarly, you can write javascript to work on any element for that matter and call it in Selenium.

Another approach you can use with JavascriptExecutor is to use elements created to execute in Javascript.

Eg:

WebElement button=driver.findElement(By.name("Insert"));
button.click();
jse.executeScript("arguments[0].click();",button);

read less
Comments
Dislike Bookmark

Lesson Posted on 26/09/2018 Learn Java +7 Java Script Training Java Programming Core Java JSP (Java Server Pages) Selenium with Java Programming in JAVA Advanced Java Programming

How can everyone prepare to clear any Java interview?

Bright Computer Education

Bright Computer Education is Vadodara based Institute, works on All India Computer Education Mission....

Java interview your java should be much strong then J2EE. core java and Advance java is the basic foundation for Interview. Some of the topic about which you should know before going for a java interview are mentioned below: 1-JRE, JDK & JVM 2-OOPS 3-Different scenarios related to oops like scenarios... read more

Java interview your java should be much strong then J2EE. core java and Advance java is the basic foundation for Interview. Some of the topic about which you should know before going for a java interview are mentioned below:

1-JRE, JDK & JVM

2-OOPS

3-Different scenarios related to oops like scenarios based on compile-time and runtime polymorphism, different type of inheritence

4-exception hierarchy, checked and unchecked exception, Different scenarios related to exceptions

5-Threads , their states and ways of creating threads.

6-Collection framework and difference between different collections.

7-Generics.

8-Hashcode and equals and their contract.

9-Difference between:

         String & StringBuffer

         equals and ==

         checked and unchecked exceptions

         interface and abstract class

          Thread class and runnable interface.

read less
Comments
Dislike Bookmark

Answered on 09/06/2018 Learn Selenium

Shalini Raman

Trainer

Hi, I am 8.5 yrs in it industry in automation.i will give all kind of practical experience. With regards Shalini
Answers 6 Comments 3
Dislike Bookmark

Learn Selenium from the Best Tutors

  • Affordable fees
  • Flexible Timings
  • Choose between 1-1 and Group class
  • Verified Tutors

Answered on 03/05/2018 Learn Java +3 Core Java Java Script Training Selenium with Java

Ishita Pandey

Tutor

Hi, If you haven't finalised yet, I am interested in being an instructor. I will be teaching the newest version of Java, Java 10. Experience - 3 yrs as Software Engineer, BTech CSE, teaching Java to school and college students since 3 yrs.
Answers 78 Comments
Dislike Bookmark

Answered on 25/01/2018 Learn Selenium

Arun Sharma

Tutor

As a beginner level you should have some meaningful idea of some basic terminologies and their functional behaviors like classes, data types or methods. Once you start understanding these, then you can jump on the concept of OOPS and can start your selenium learning simultaneously so that you can correlate... read more

As a beginner level you should have some meaningful idea of some basic terminologies and their functional behaviors like classes, data types or methods. Once you start understanding these, then you can jump on the concept of OOPS and can start your selenium learning simultaneously so that you can correlate your learning with the practical and hands on work. In case of any more doubt, you can contact me on my number. We can have a discussion.

read less
Answers 3 Comments
Dislike Bookmark

Answered on 09/02/2018 Learn Selenium

Geetha

Teacher

By id
Answers 3 Comments
Dislike Bookmark

Learn Selenium from the Best Tutors

  • Affordable fees
  • Flexible Timings
  • Choose between 1-1 and Group class
  • Verified Tutors

Answered on 11/12/2017 Learn Selenium

Which is the best Eclipse version for Java for selenium WebDriver in Ubuntu 16.04?

Prathap Kumar K

Selenium Expert

Eclipse Oxygen is the best version. for further help you can get in the below links https://www.youtube.com/watch?v=EiGl2Ag35AI
Answers 2 Comments
Dislike Bookmark

About UrbanPro

UrbanPro.com helps you to connect with the best Selenium Training in India. Post Your Requirement today and get connected.

Overview

Questions 441

Lessons 57

Total Shares  

+ Follow 23,341 Followers

You can also Learn

Top Contributors

Connect with Expert Tutors & Institutes for Selenium

x

Ask a Question

Please enter your Question

Please select a Tag

X

Looking for Selenium Classes?

The best tutors for Selenium Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Selenium with the Best Tutors

The best Tutors for Selenium Classes are on UrbanPro

Book a Free Demo

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more