All Questions
Tagged with automated-testing java
496 questions
0
votes
2
answers
69
views
Loose coupling for utility/helper classes
What solutions do you use to avoid tight coupling between classes when using utility classes like waithelpers, data formatting, selenium utils etc? I am using these classes having static methods, ...
0
votes
0
answers
22
views
How to resolve Null error displayed for shadowRoot element?
I have written this code in which I am able to get the shadow element:
package org.example;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa....
0
votes
1
answer
46
views
Maven Standard Directory Layout for UI Test Automation project on Java: what modules should be considered as main, and what as test?
Usually UI test automation framework is a separate code base, different from developers repository.
It is common to use Maven or Gradle as a build tool in test automation frameworks written on Java. ...
0
votes
1
answer
48
views
Best way to automate File contents verification using Selenium/Java?
In my application, there are lot of files that contain financial data and those are sent to different parties. So, I have to automate verification of content of all these files. Now, each file has a ...
0
votes
0
answers
59
views
How to run multiple Feature files parallelly in Cucumber with TestNG Runner?
I am facing one issue: I need to run 5 feature files that are totally independent of each other, Each feature files logs into a different site. I want 5 different ChromeDriver Browser sessions to open ...
0
votes
0
answers
22
views
Regarding Google Playstore Automation
I have this project where I have to automate the Play Store using Java and Appium.
Problem:
The problem I am facing is, that it seems like the buttons in the Play Store are changing their id's ...
0
votes
2
answers
123
views
How to use java classes of one Selenium project into Another project in Eclipse?
I have around 10 Selenium/Java projects in Eclipse IDE and there is "utils" package and Automation framework classes that i manually copied to all projects and all those have different ...
0
votes
1
answer
55
views
Get code from email - java
I have an automation flow where there is a need retrieve a code from an email and input it into as a verification code.
As its a demo I could use any temp email and grab it but I am wondering now what ...
0
votes
2
answers
109
views
How to handle this Particular date picker scenario where i want to traverse back in selenium
In this code i want to navigate to the year 2022 and select July and print that result in the console but the issue is that in the else if condition when checking when this particular condition is ...
0
votes
0
answers
170
views
How to connect to a Anti-Detect browser (Incogniton) using selenium java
I want to connect to a browser session of this specific anti-detect browser called Incogniton.
It does support Selenium browser automation, but it only supports Python. I don't know anything about ...
0
votes
1
answer
28
views
Appium version issue
I am confused to see what Appium version is installed on my machine. If I look into Appium UI it shows Appium v1.22.3 but When I check from cmd it shows 2.0.0-beta.71. how do I know which one is ...
3
votes
1
answer
3k
views
Selenium latest version is not able to launch FireFox browser in Ubuntu 20.04
I'm trying to automate web tests with Selenium and Java in Ubuntu OS.
Earlier versions of Selenium used to work very well with older version of Firefox in Ubuntu.
Since I upgraded to
Selenium 4+ (...
0
votes
2
answers
272
views
how to automate a date picker that not in a table tag
I want to automate that starting date and end date but in DOM I can't find a Table tag for date picker so I don't know how to locate the field.
The tag is
<input class="inputvd" type=&...
-1
votes
1
answer
382
views
How to validate invalid date error message in Selenium Java project?
I have a "Date" field on my page I want to automate. Now, when I enter invalid value or invalid format, then its displays an error like:
"This is invalid value for "Date" ...
2
votes
1
answer
650
views
How to validate if .txt file format is correct as a part of File processing in Automation framework?
In my Selenium+Java automation framework, I need to open a .txt file or any other extension file and then see if the text is in a particular format. Now, I need to see if all lines are in this format ...
-1
votes
1
answer
516
views
Is it mandatory to return a PageObject instance in every Page Object save/submit method?
In the Page Object model, we separate page UI elements and Test methods. However, there is a concept of Page chaining, in which we return an object on the next Page Object in the previous page object ...
0
votes
4
answers
384
views
Selenium email automation
I'm trying to automate tests using Selenium and a Yahoo email address.
The problem is when I run my test in Azure DevOps I face the CAPTCHA privacy terms.
Any ideas on how to fix this problem?
-1
votes
1
answer
51
views
Verify that 4 products are shown with € symbol
I want to verify from this website: https://demo.nopcommerce.com/. There are 4 products shown with the Euro symbol by using for loop.
Code:
List <WebElement> productcurrency = driver....
1
vote
3
answers
192
views
Selenium Test cases for UI look
I have a test case, where I need to verify:
a user selects any of the options.
the text is not going out of the layout and displays complete
readability to the user.
As a result, the UI look and ...
7
votes
1
answer
895
views
Selenium + Java: How to get the OS, and Browser details on run time?
What I want to do is, while I'm running my tests, I want to get the current,
Operating System
Browser Name
Browser Version
This is for making the details clear in the test/bug report.
I haven't ...
2
votes
2
answers
1k
views
Not able to match ChromeDriver version with chrome version
So at my current job I’m at a pinch, we can’t just download executable jars and use them. We have to request to download whatever we want . So the problem is , our chrome gets auto updated where as we ...
2
votes
1
answer
234
views
Selenium Webdriver : Trying to get text, but specific class present
Kindly find attached the html code of the section in question
I use the following code and managed to get the text for Status
successMessage = driver.findElement(By.xpath("//span[@class='status-...
0
votes
1
answer
7k
views
Cannot invoke "org.openqa.selenium.SearchContext.findElement(org.openqa.selenium.By)" because "this.searchContext" is null error
I am trying to verify a functionality as a guest user and logged in user. In order to do that I log out form the system and verify the guest user actions then login again and verify logged in user ...
0
votes
1
answer
137
views
Element is not clicked even after explicit wait
I am trying to verify default selected value of a dropdown.
<div class="p-3 p-md-4 mt-4 mt-md-4 card"><div class="row"><div class="d-flex align-items-center col-...
2
votes
1
answer
293
views
Verifying scrollbar is present script fails
I'm trying to check whether a scrollbar is present when there are more than 2 elements in a pop up.
Here is the HTML code for the div which enables the scroll bar if when there are more than 2 ...
0
votes
2
answers
587
views
Button click was not performed even though element was found
I'm trying to click below button.
<button class="MuiButtonBase-root MuiButton-root jss47 jss58 MuiButton-contained jss48 jss59 MuiButton-containedPrimary MuiButton-disableElevation" ...
1
vote
2
answers
450
views
Getting value from data-value (webdriver selenium / java)
I have the following HTML code
<div class="mbsc-sc-whl-c" style="height:40px;margin-top:-21px;">
<div class="mbsc-sc-whl-sc" style="top: 0px; transform: ...
0
votes
1
answer
455
views
Return always false as using isSelected() in Selenium Webdriver java
I'm trying to use isSelected() method on Amazon website.
I'm trying to tick the check-box of item filter and then read the status of check-box by isSelected() but it always returns false message.
...
0
votes
2
answers
228
views
How to test a huge list of domains redirect to HTTPS?
I have got a huge list of domains/URLs (about a 1000). The task is to test if each one of them, if accessed with http://domain.com then it redirects to https://domain.com.
All the domains that do not ...
0
votes
1
answer
138
views
How do i get rid of duplicated local variables
I have a multiple drop-downs and need to automate them.
I added the code below, how do I add them in one step?
or
make it easier
or
how do I add them in one function?
I'm using eclipse and TestNG ...
3
votes
2
answers
6k
views
Selenium + Java: Unable to close Advertisement in webpage
Issue I am facing:
After this step: driver.findElement(By.linkText("New Customer")).click(); an advertisement window opens and script stops here. I'm unable to close the advertisement and ...
0
votes
2
answers
529
views
How to execute multiple selenium java test-scripts with different parameter at one time?
Is there any solutions for executing multiple selenium webdriver java test-scripts having different parameters at one time and get results.
If parameter is URLs, then we can test multiple Urls on one ...
0
votes
1
answer
912
views
Type mismatch: cannot convert from WebElement to WebDriver?
Type mismatch: cannot convert from WebElement to WebDriver
Getting this error in my code why?
package testcases;
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium....
1
vote
1
answer
525
views
Can we Drag and Drop multiple desktop images at the same time to web page using selenium - Java through script ingestion
I found the below article for image upload using script ingestion. But this script is working for a single file at a time but I want to drag and drop multiple files at the same time.
My client doesn't ...
1
vote
2
answers
335
views
Unable to capture the element using xpath
I'm trying to capture the dynamic code using xpath(Selenium+Java).
I want to get that code and store it in a variable, but it always returns no such element exception.
My xpath looks like below when ...
1
vote
1
answer
3k
views
Is there a free API for spell and grammar check?
I'm a QA automation engineer looking for a free API or a website for grammar and spell check to automate checks for those errors in web app using Selenium and Java.
2
votes
5
answers
99
views
Should automation scripts made in Selenium always contain wait calls?
Should the automation scripts made in Selenium always contain wait calls like implicit, explicit and fluent, or could it be that waits are not needed?
0
votes
1
answer
1k
views
How to send POST api request with the extracted details from an element using selenium+java
Use case is as below.
There is a modal in a website and it contains User ID, Name and email. I want to capture those details using selenium+java and send a POST api request with the above extracted ...
0
votes
2
answers
251
views
How to run java+selenium method continuously?
There is a functionality like in sometimes one of modal pops up and there is a button on it. If the modal pops up user needs to click on that button. This is a continuous process and I need to ...
-1
votes
2
answers
456
views
I wrote automation code to click on a date from a data picker but its not working
Website : https://www.abhibus.com/
I am trying to automate selecting date of journey on the website above. Nothing I have tried is working.
Screenshot of the date selector
Code I am using
...
1
vote
1
answer
719
views
Cucumber - Accessing injected context in After scenario hook
I'm attempting to refactor a test automation framework I have inherited (Java, Selenide, Cucumber) from one that uses static global state for test data, to context injected test data using ...
2
votes
1
answer
129
views
Is Cucumber Scenario equivalent to a Java Class?
@Add User
Scenario: Add a new User profile in the System
Given user is on the Add User profile page
Then Add a new user profile in the system
Then verify that user has been added successfully
Now, ...
0
votes
1
answer
222
views
Why dont we use the main() method in TestNG class?
public class Tests{
@Test
public void run(){
sop("this is test method 1");
}
}
How will Jvm know about entry point of the program? 🤔
2
votes
4
answers
7k
views
How to open outlook and click on the link that is there in the mail using Selenium
In my application I need to send a confirmation after which an mail will arrive to my Outlook which I need to open and click on the link which is sent in the mail.
Can someone please let me know if ...
1
vote
2
answers
170
views
how to add "\n" to the method
I have the below method:
PUBLIC methodname(WebDriver driver,formEntryMap<String,String>,String Colkey)
{
String Xpath = This will have the xpath of the input text box
inputfieldEntry(driver,...
1
vote
0
answers
1k
views
How to perform mouse hover in selenium java using page object model approach?
I have automated some test cases mentioned at https://www.techlistic.com/2019/08/automate-buy-product-using-selenium.html For second test case mentioned at given link, I have written code for mouse ...
0
votes
2
answers
879
views
I want to scroll to a specific location Selenium Java
I have a list of webelements, I have written the below code:
List <WebElement> feature_tiles = driver.findElements(By.xpath("//div[contains(@class,'featuretile')]//a"));
System....
1
vote
1
answer
596
views
AllureRestAssured , how to ignore logging headers
I am using rest-assured and allureRestAssured for testing api
given().header("Content-Type", "application/json")
.header("key", key()).filter(new ...
1
vote
1
answer
542
views
Waiting for two events in Selenide
I have code, written on Selenium which waits for the first or for the second event. But all testing framework uses Selenide. The question is how to rewrite such code on Selenide, to avoid unxpectable ...
1
vote
0
answers
100
views
NullPointerException-webdriver null
I put a screenshot with getDriverInstance.
After run.
When I run the test, I get this error.
At debug it tells me, that the WebDriver is null.
Can anyone help me with a solution how to fix the ...