New answers tagged

0

A new window is basically a new webpage that opens in a separate window or a tab depending on your browser settings. Since you have asked for examples, here it is e.g. visit appium tutorial webpage. Click on any chapter say chapter 1. It will take you to new window/tab. An alert box or pop up window is often used if you want to make sure information ...


0

You have to do some string manipulations to get the desired result String text=driver.findElement(By.id(idOfRecordCountElement)).getText(); String desiredText=text.substring(0,text.indexOf("\n"));


0

Yes it is possible. JUnit has nothing to do with calling methods. You can write code like in 'normal' java.


-1

executor.swipeWhileNotFound(direction, offset, element);


0

client.elementSwipeWhileNotFound("NATIVE", "id=nav_drawer", "Down", 0, 2000, "NATIVE", "text=History", 0, 1000, 5, true)) or normal scroll method available to use- client.scroll(500,500);


0

'state' variable holds the name of the state you are about to select. Simply use this variable in switch statement. switch(state){ //cases }


0

Simple ready2use snippet > Working perfectly for me static void waitForPageLoad(WebDriver wdriver) { WebDriverWait wait = new WebDriverWait(wdriver, 60); Predicate<WebDriver> pageLoaded = new Predicate<WebDriver>() { @Override public boolean apply(WebDriver input) { return ((JavascriptExecutor) input)....


2

Yes. You can create an application to run your test scripts, when you create your test projects they are just libraries/dlls that you have created and they do work just like any other library/dll. add to references and you should be able to call specific tests and get their pass/fail value when they are finished.


1

To become an automation QA Engineer is a process and you are right nowadays it is really difficult to find a job only with manual skills. My suggestions is to start with grey box testing first. Watch what there is behind a web page,a single page application and mobile apps. You definitely should start with some proxy tools. To learn to manage your ...


2

When your web browser requests a URL, the response is just the page and anything embedded in the page. Your web browser parses the response, determines what other resources are referenced by the page, and sends additional requests to fetch those resources, one resource per request. You will have to do the same thing.


2

Agree with @Dale Emery. Use this code: public class WatchTV { WebDriver driver; WebDriverWait wait; int waitseconds = 60; public WatchTV(WebDriver driver){ this.driver = driver; wait = new WebDriverWait(driver, waitseconds); } By watchtvlink = By.linkText("Watch TV »"); public WebElement WatchTVLink() { ...


1

Your Setup() method runs (and initializes the driver) only in the Pg_WatchTV_Test class. Merely extending TestBase does not cause TestNG to run your setup method. It runs setup methods (annotated by @BeforeMethod and the like) only if the class has test methods. Your WatchTV class has no tests, so TestNG does not treat it as a test class. So the Setup() ...


0

For starters, I would suggest you to start reading about Page Object Model - which is a great way to introduction abstraction in your Selenium tests and provides a programmatic way to drive and interact with UI. Each page of your AUT (Application Under Test) is mapped to a class file in your code and each method within the class file can be treated as a ...


0

There may be some misconfigurations in your specification. You declare useUnlimitedThreads=true but then threadCountMethods=5, and they don't seem to get along with each other: The parameter useUnlimitedThreads allows for an unlimited number of threads. Unless useUnlimitedThreads is set to "true", the parameter threadCount can be used with the optional ...


0

The simpliest way is using CSS selector instead of xpath in this case. driver.findElements(By.cssSelector("input:checked[type='checkbox']")) should return the list with all selected checkboxes. And this one for not selected: driver.findElements(By.cssSelector("input:not(:checked)[type='checkbox']"))


0

I use this function with good results: static WebElement getElementsWithAlteratingNames(String PartialName, String Tag, WebDriver driver, String Attribute) { try { List<WebElement> Elements = driver.findElements(By.tagName(Tag)); String[] ElementStrings = new String[Elements.size()]; System.out.println(Elements.size()); ...


3

If I understand your question correctly you try to run the java file and not the compiled code. Try exporting your project as an executable .jar via eclipse and run this via "java -jar FileName.jar". Regarding the second part of your question though, I´ve got no idea what you were trying to say.


0

The PageFactory code isn't working because fruits isn't a WebElement to be found on the page as is, which is what that scheme is used for. Instead, it is a string substitution template and should be kept as just a "private final String".


0

You can use the RunWith and Parameterized annotations to run a test suite that is backed by a spreadsheet, database result set or delimited file. import java.io.IOException; import javax.xml.parsers.ParserConfigurationException; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import ...


1

I haven't found a solution, rather an alternative. I have used Jenkins and used to BuildFLow plugin to create a Build Flow job. I use this job to call 3 other jobs to run parallel. The 3 other jobs are Maven jobs which are each pointing to their own test XML files which contains the tests classes I need to be run parallel. It greatly reduced the time of ...


2

When you call driver.manage().deleteAllCookies() it deletes all cookies for the current domain. So if you're on bbc.co.uk page it will not be able to remove cookies for facebook.com domain. driver.manage().deleteCookieNamed(cookieName) can delete only a cookie for a current domain. It's stems from the the way Web browsers work, WebDriver cannot do more. ...



Top 50 recent answers are included