Posts

Showing posts from November, 2019

Actions class in Selenium-Webdriver

Image
=> An API for simulating complex keyboard events and mouse events. => You can build a series of actions using the Action interface and Actions class.(Action chaining) eg:- To copy content in clipboard Actions builder = new Actions(driver); builder.keyDown( Keys.CONTROL ).sendKeys( "ac" ).keyUp( Keys.CONTROL ).build().perform(); => This is possible because methods of Actions class returns the Actions class object. => build() of Actions class compiles all events and returns object of Action interface. => perform() of Action interface executes all events.

Arguments in javascript to be used with JavascriptExecutor in Selenium script

Image
Signature of Method: Object executeScript(String script, Object... args) The arguments to the script may be empty or any object. It can be String object, WebElement, etc.. eg:-  ((JavascriptExecutor)driver).executeScript("arguments[0].click();", loginButton);  where "loginButton" is a WebElement. ((JavascriptExecutor)driver).executeScript("arguments[0].value=arguments[1]",emailTextField,"qacult");    where "emailTextField" is a WebElement.

Open new Tabs in Selenium script with javascript.

Image
for(int i=0; i<3; i++) { ((JavascriptExecutor)driver).executeScript("window.open('http://google.com', '_blank');"); }  U sing JavascriptExecutor interface executeScript() which executes the given script for opening tabs. ************************************************************************************** QACult Best Software Testing Courses in Chandigarh tricity.- We love to enhance your knowledge. QACult is the premier institute catering to the requirements of experienced and fresh pass-out that gives leaders like you a new way to experience Quality engineering—while you work and giving you the flexibility to both advance your career. Our faculty have 12+ years of industrial experience and have developed many automation testing frameworks in java using TestNG or BDD (cucumber) methodology. We expertise in developing automation testing frameworks in java, python, javascript, php, ruby(WATIR-webdriver & Capybara) and Appium.

FirefoxOptions & ChromeOptions

Image
 Both are the child class of MutableCapabilities which is also parent class of DesiredCapabilities. Both are used to handle properties of Firefox and Chrome browser via geckodriver and chromedriver respectively. Object of both these classes are passed an an argument to FirefoxDriver and ChromeDriver classes. ************************************************************************************** QACult Best Software Testing Courses in Chandigarh tricity.- We love to enhance your knowledge. QACult is the premier institute catering to the requirements of experienced and fresh pass-out that gives leaders like you a new way to experience Quality engineering—while you work and giving you the flexibility to both advance your career. Our faculty have 12+ years of industrial experience and have developed many automation testing frameworks in java using TestNG or BDD (cucumber) methodology. We expertise in developing automation testing frameworks in java, python, javascript