Posts

Showing posts from 2020

JavaScript Selenium Webdriver

 / *Syntax: JavascriptExecutor js = (JavascriptExecutor) driver;   js.executeScript(Script,Arguments); script - The JavaScript to execute Arguments - The arguments to the script.(Optional)*/                   JavascriptExecutor js = (JavascriptExecutor)driver;                 //Uncomment each scenario by using Ctrl + Shift + \ (backslash) and find the solution  without using sendKeys()   *//to type text in Selenium WebDriver without using sendKeys() method    js.executeScript("document.getElementById('some id').value='someValue';");                 js.executeScript("document.getElementById('Email').value='SoftwareTestingMaterial.com';");*/   click a button /*//to click a button in Selenium WebDriver using JavaScript  //js.executeScript("arguments[0].click();", loginButton);   ...

Appium AVD device setup

1-UI Automator viewer- to find locators 2- androidUIautomator  driver.findElementByAndroidUIAutomator("text(\"Views\")").click(); AndroidDriver<AndroidElement>  driver; ######################################################################### File f= new File("src"); File fs= new File(f,"ApiDemos-debug.apk"); DesiredCapabilities cp = new DesiredCapabilities();           cp.setCapability(MobileCapabilityType.DEVICE_NAME,"AndriodTest"); cp.setCapability(MobileCapabilityType.AUTOMATION_NAME,"Uiautomator2"); cp.setCapability(MobileCapabilityType.APP,fs.getAbsolutePath()); driver = new AndroidDriver<AndroidElement>(new URL("http://127.0.0.1:4723/wd/hub"), cp);  //xpath id className,  androidUIautomator      /*    xpath Syntax       *    //tagName[@attribute='value'].      driver.findElementByXPath("//android.widget.TextView[@text='Preference']")....

Cucumber Interview Questions and Answers

Most Frequently Asked Cucumber Interview Questions Q #1) Explain Cucumber shortly. Answer:  Cucumber is a tool that is based on Behavior Driven Development (BDD) methodology. The main aim of the Behavior Driven Development framework is to make various project roles such as Business Analysts,  Quality Assurance , Developers, etc., understand the application without diving deep into the technical aspects. Q #2) What language is used by Cucumber? Answer:  Gherkin  is the language that is used by the Cucumber tool. It is a simple English representation of the application behavior. Gherkin language uses several keywords to describe the behavior of applications such as Feature, Scenario, Scenario Outline, Given, When, Then, etc. Q #3) What is meant by a feature file? Answer:  A feature file must provide a high-level description of an Application Under Test (AUT). The first line of the feature file must start with the keyword ‘Feature’ followed by the de...

Appium : Architecture and Installation Steps - Windows

Appium i s a open source tool to automate Mobile applications Can automate Native,Web and Hybrid mobile applications ---------------------- Native application--calulate,calender or camera app(native to device) Mobile application-- Ipay cash point(mobile browser- chrome ) Hybrid applications-- combination of both Supports Andriod, IOS and window desktop platforms Open sourse platform --------------- History Appium was originally developed by Dan Cuellar in 2011 under the name of "IOSAuto", written in the c# Programming Language The program was open source in Aug 2012 using the Apache 2 licence ----------------- Design: -Appium use webdriver Script libary (we write our scripts using webdriver libary -scripts) -Json Wire protocal our scripts will converted into HTTP rest based request which can be understand by HTTP server(node.js) - Http server runs this request in Mobile apps ----------- Framework'; vendor specific drivers IOS 9.3 and above : Apple...