Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Questions about testing applications written in Java or test automation written in Java, a popular programming language and runtime environment which allows Java programs to run unchanged on most hardware and software platforms.
3
votes
ArrayOutOfBoundException when reading test data from Excel
Defect isolation
The stacktrace
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2
at jxl.read.biff.SheetImpl.getCell(SheetImpl.java:288)
at seleniumscripts.Excelreaddata.mai …
2
votes
Accepted
TestNG showing as test passed even if assertion fails
Just stop catching AssertionError exceptions and you will see your tests failing as expected.
Why this so? When an assertion evaluates to false:
assertEquals(3, 5);
assertThat(3, is(equalTo(5)));
a …
0
votes
Accepted
Compare if the output values are sorted or not using tree map and comparator
With JDK 8 you can use the following solution:
List<String> labels = elementcount.stream()
.map(WebElement::getText).collect(Collectors.toList());
SortedSet<String> sorted = new TreeSet<>(labels); …
2
votes
java: String.format with PageFactory
There's no way to do it with PageFactory without re-implementing it. Locators to page object elements in @FindBy annotations cannot be updated at runtime. You probably would like to have something lik …
2
votes
BrowserMobProxy verifying request
You can access a logged entry from Har object at runtime. For instance, the following code will return only entries (tuples of a request and a response) with HTTP POST request:
Har har = proxy.getHar …
1
vote
How to test user can be logged in only one browser instance?
Here is a sketch of the solution in Java:
WebDriver driver1 = new FirefoxDriver();
WebDriver driver2 = new FirefoxDriver();
login(driver1);
assertThat(driver1, canAccessProtectedPage());
assertThat(driver2 …
0
votes
Accepted
Implement steps from file
Plain Java it is. Thanks to that you don't need any fancy libraries nor business logic for parsing external files, you have IDE autocompletion and debugging support gratis. …
0
votes
How to test single sign on(SSO) application using a token
As lauda said you need to automate also the process of getting a token, i.e. authentication.
JWT token suggests you're probably testing a system with OAuth2 authentication. RFC 6749 specification defi …
5
votes
Accepted
Selenium delete cookie
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.man …
1
vote
Speeding up selenium page load times?
An alternative way is to use a faster way to authenticate, i.e.:
Login at REST API level, e.g., with REST-assured, Retrofit or any other HTTP client.
Copy a session cookie from HTTP response or HTTP …
1
vote
Accepted
How to ignore/accept/avoid SSLHandshakeException while trying to check for broken links?
The exception is not related to HTTP Basic Authentication, i.e., is not about missing authentication credentials. This also has nothing to do with broken links. This bizzarre exception message is sayi …
2
votes
Difference between Singleton, POM, Abstract design patterns
all in all these 3 design patterns, we are instantiating WebDriver object only once and using across the project (we have one baseclass, where we have setup and teardown methods, and instantiating …
2
votes
What are the good java Frameworks/Libraries for REST API Automation Testing?
Retrofit
OkHttp
curl command line tool
8
votes
Accepted
How to wait for an api request to return a response?
TimeLimitedCodeBlock(5, TimeUnit.MINUTES) {
@Override
public void codeBlock() {
framework.createNewData();//Takes some time.
}
}.run();
TimeLimitedCodeBlock is described in answers to Java …
1
vote
Page factory performance
Java implementation of PageFactory decorates WebElements with a dynamic proxy. …