0% found this document useful (0 votes)
87 views5 pages

Entre Vista

Polymorphism and encapsulation allow defining classes and objects in object-oriented programming. Inheritance allows child classes to inherit attributes and methods from parent classes. Abstract classes and interfaces define generic functionality that subclasses further specify. Overriding and overloading modify and distinguish methods. Constructors initialize classes and objects. Final, static, and instance define how variables and methods can be accessed and extended.

Uploaded by

Luis Padilla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
87 views5 pages

Entre Vista

Polymorphism and encapsulation allow defining classes and objects in object-oriented programming. Inheritance allows child classes to inherit attributes and methods from parent classes. Abstract classes and interfaces define generic functionality that subclasses further specify. Overriding and overloading modify and distinguish methods. Constructors initialize classes and objects. Final, static, and instance define how variables and methods can be accessed and extended.

Uploaded by

Luis Padilla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 5

***Polhymorfism: is the different ways in which objects or classes can be

implemented, an example would be overload and override


***Encapsulation: Store and organize in a class the features and functions of
objects, using attributes and methods
is used to make collections of data, such as public, protected, private
FOR EXAMPLE IN A VIDEO GAME, we sees the result of the method through the
functionality and gameplay,
but we do not know how are made the methods that make that functionality,
or the code.
(Public (Todos), Private(Clase), By Default(clase+paquete),
Protected(Subclase+default)) these are the access modifiers

***Extends/inheritance: its when then the child class extends all the atributes and
methods from the parent clasS
basicly the parent class passed all the functionality to the child class
It is like a contract where methods and attributes are used,
you can not give functionality to this, you only define how you are
going to be using it and where

*** Metodos y Clases Abstractas**:

***Abstract: Abstract classes are generic, abstract means will give you different
results, it depends on who requests it,
and the subclasses (child classes) are the ones that define the behavior
***Interfaces: It is used when you want to bring specific properties and since you
can not used multiple inheritance,
for that reason you have to use interfaces
(an intarface has predefined methodes, and those methodes need to be implemented in
a mandatory way)

***A class can extend only one abstract class, but it can make use of any number of
interfaces

***Override: when a text or a method is modified in a child class.


***Overload: when you have many methods with the same name wich can received
different parameters.
all those looks the same, but they are different and the output could be
different as well.

***Constructor Method: used to initialize the class objects or the variables.

***Instancia: An object is a class instance - getter and setter methods are used to
instantiate an object.
Clase: Template o estructura con caracteristicas x.

***Final: When a variable becomes final, it becomes a constant.


When a class is final, it cannot extends/inherit.
when a method is final, it cannot be modified.
***Static: static allows access to class methods and variables without the need to
instantiate an object of that class

***Instance: An object is a class instance, used with the getters and setters
methods

***Java 8 Functions: Stream, Lambd, Comparator

***Alerta de selenium:, Alert alert = driver.switchto().alert();


alert.accept(); , alert.Dimiss(); , alert.sendkeys("hola"); , alert.getText();
ArtifactID = Nombre del proyecto dentro de pom

***Exceptions Selenium: (ERRORES COMUNES EN SELENIUM)


WebDriverException
NosuchElementException
NoSuchframeException
NoSuchWindowsException
ElementNotVisibleException
ElementNotInteractableException
SessionNotCreatedException
TimeoutException

*** driver.get: refresh the page, all cookies and sesions, etc. and then goes to
the page.
*** driver.navigate: goes to the page directly.

***REST: Cualquier interfaz que use http, soporta xml y json.


***SOAP: Soporta HTTP y xml.

***Implicit wait:When created element is alive until the WebDriver object dies.
is basicly the timeout you set until your webdriver dies. (Global Timeout:
driver.manage().timeouts())
***Explicit waits:can be declared for a particular element, its applied only for
those specifed elements wich the user set.

For example, we declared implicit Wait of 10 secs but an element takes more than
that,
say 20 seconds and sometimes may appears on 5 secs, so in this scenario, Explicit
wait is declared.

***XPATH: is a query language for selecting nodes from an XML document.


theres some main locators or Identifiers: there is the id, name, css, xpath,
class
//: means any descendant node of the current node tree matches the locator.
/: means that node is a direct child of the current element.

***Scroll, cannot be used using selenium only, we have to use java script executor
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript(Script,Arguments);

***Diferencias entre Array y Arraylist:


An ArrayList has a dynamic size, and an Array is defined in its creation.
An ArrayList cannot contain primitive data, only Objects.

Datos primitivos: byte


short
int
long
float
double
boolean
char

*** Ciclo de vida del QA: Definir lo que quieren , analizar, Diseñar, codificar,
probar, validar que funcione, mantenimiento
Para correr en headless:
Chromeoptions chromeOptions = new ChromeOptions();
chromeOptions.AddArguments("--headless");
driver = new ChromeDriver (chromeOptions);

Listeners: Logs y reports que se agregan a partir de interfaces.


las interfaces contienen solo metodos abstractos.
Scrum: proceso de practicas para trabajar en equipo.

Data driven: para comparar lo que se espera con el resultado actual


se puede comparar estos datos de una tabla o un archivo.

Data provider: es igual al data driven pero se traen los datos de un excel.

Keyboard Driven: es como todo hardcodeado, los datos se ponen en el codigo.

KeyWord Driven: Es por palabras especiales o especificas, que apuntan a codigo


especifico o a excel.

**** Behaviour-Driven Development: Cucumber to get better undestanding between


business people and technical
people*****************************************************************************
*********************

Keywords: Scenario (Test Cases), Scenario Outline, Feature, Feautre file, Step
definition

Feature:Represent a Business requirement.


Scenario:Test Case or a business rule that wants to be tested

Gherkin / Scenarios (Test Cases):


Given (Preconditions or Initial Context to test),
When (describe an User action or an event), //AND
Then (observe the expected result, what happen after the action, in this places the
asserts are seted) // AND, BUT

And: This is used for statements (Declaraciones) that are an addition to the
previous steps and represent positive statements.
But: This is used for Statements that are an addition to previous steps and
represent negative statements.

Feature:Represent a Business requirement.


Scenario:Test Case or a business rule that wants to be tested

Cuales son los componentes de la terminal principal que están involucrados en


cucumber:
Feature file: Test Suite wich consist of all scenarios (Here you define all your
test cases that will be automated) "Login.feature"
Step Definition: How to automated
JUnit Test Runner: to connect all and trigger the execution.

* (Se ua cuando es una lista en vez de And)


But the user is not an admin (PERO EL USUARIO NO ES TAL, O NO SE TIENE PERMISO DE
ALGO)

Feature: Access to the system


Scenario: The user puts incorrect data
Given The user is in the main page
And the hour is less than 5pm
When The user enters the incorrect username
And the user enters the incorrect password
Then The user is not logged in to the system
And the user can see an alert with the message "Incorrect user or password"
******SI NO VARIA SIGUE SIENDO SCENARIO NORMAL

Feature: Validating Place APIS


Scenario: Verify if place is being succesfully added using AddPlaceAPI
Given Add Place Payload
When user calls "AddPlaceApi" with Post Http request
Then the API call got success with status code 200
And "status" in response body is "OK"
And "scope" in response body is "APP"

Feature: Access to the system


Scenario Outline: Access to the system with credentials **************SCENARIO
OUTLINE
Given The user is in the main page
When The user enters the username "<username>"
And the user enters the password "<password>"
Then The user login status is "<status>"

Examples:
|username|password|status|
|correct |correct |true |
|incorrect|correct|false |
|correct|incorrect|false |

package newpackage;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.Select;
import org.openqa.selenium.By;

public class accessDropDown {


public static void main(String[] args) {
System.setProperty("webdriver.gecko.driver","C:\\geckodriver.exe");
String baseURL = "http://demo.guru99.com/test/newtours/register.php";
WebDriver driver = new FirefoxDriver();
driver.get(baseURL);

Select drpCountry = new Select(driver.findElement(By.name("country")));


drpCountry.selectByVisibleText("ANTARCTICA");

//Selecting Items in a Multiple SELECT elements


driver.get("http://jsbin.com/osebed/2");
Select fruits = new Select(driver.findElement(By.id("fruits")));
fruits.selectByVisibleText("Banana");
fruits.selectByIndex(1);
}
}

Para crear una clase para poder crear objetos de clase:


public class Employee {
private int id;
private String nombre;
public int getID(){
return id;
}
public void setID(int id){
this.id = id;
}

public String getNombre(){


return nombre;
}
public void setNombre(String nombre){
this.nombre = nombre;
}
}

You might also like