Questions tagged [java]

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.

Filter by
Sorted by
Tagged with
0
votes
3answers
54 views

Avoiding a NPE when checking JSON response using JsonPath and Rest Assured

Given the following JSON: { "priceOne": 1034, "priceTwo": null, "priceThree": 7282, } ...and the following Rest Assured method to get the priceTwo value and ...
1
vote
1answer
16 views

Asynchronous content is not found after button click in Selenium Grid

I have created a script in Selenium IDE that goes to this page: https://www.lexology.com/instructcounsel/find and presses the 'Example' button and then asserts that results are displayed for the ...
1
vote
1answer
31 views

Should Page Objects be reused or should new ones be created?

I am fairly new to using POM and I am wondering if there is a best practice when returning to a previously visited page. Is it better to create a new page object every time there is a page navigation? ...
0
votes
1answer
29 views

How to implement proxy server setting in selenium webdriver using java

I have tried both the below code but unable to set proxy Proxy proxy = new Proxy(); proxy.setHttpProxy("socks5://localhost:8080"); ChromeOptions options = new ChromeOptions(); ...
0
votes
1answer
27 views

How to create correct JSONArray in Java using JSONObject [closed]

I'm trying to create a JSONArray but having difficulties cause the format I need to create is as follows: "header": [ { "name": "x", "id": &...
1
vote
1answer
19 views

Unable to select the text from the drop down

i tried to identify the text from the drop down but it displays the error. Select agentName1 = new Select(driver.findElement(By.id("XYZ"))); agentName1.selectByVisibleText("ABC"); ...
0
votes
0answers
31 views

Anyone had success running TestNg with Java 9 or above?

Has anybody successfully run the TestNG with >=Java 9? I tried and it failed. I also had no luck finding any helpful information from Google search. This is the error I got, Error occurred during ...
0
votes
2answers
27 views

GUI / report for Selenium / Maven test failures

I've got testers starting to work with Selenium / Maven / Java / IntelliJ Idea. Does anyone know if a way I can generate a GUI report of a test's results after it has been complete? Only need to ...
1
vote
1answer
73 views

No such element: Unable to locate element

I am trying to automate a payment using selenium java via a modal. I am able to enter the CC details however when I exit the iframe and try to click the pay button I get the following error message ...
0
votes
1answer
20 views

List issues facing

I am creating script for list but it is all four tab run and when last tab found it's popup it automatically script fails. How to put condition if it is continuously run. Please see my code. http://...
2
votes
1answer
46 views

Which is the correct page object model design and why?

Issue: The target webpage has many buttons in the page and adding separate abstraction for each method like , click button1 , button2 etc feels like unnecessary and just creates additional lines of ...
0
votes
1answer
43 views

Backend test automation framework - Java

I'd like to create and ask about best framework for backend end-to-end tests. This is microservice architecture software and the services communicates via REST API and Apache Kafka. What would be best ...
1
vote
1answer
20 views

Unable to find Javadoc location for selenium version 3.141.59 jar for java version

I installed Selnium for Java version 3.141.59. I am using Eclipse-Neon edition .I was trying to attach javadoc location to the client-combined-3.141.59 jar.can u please confirm if the javadoc URL ...
1
vote
1answer
19 views

How can we handle SeekBar in Appium?

I wrote a code for SeekBar. I wanted to move the SeekBar but it did not move. When I run the code it gives me values in the console but did not move. Kindly check my code and tell me what I am missing ...
1
vote
2answers
66 views

How can we write scrolling code in Appium with Java?

How can we write scrolling code in Appium with Java? Here is what I want to do, Open the application. Scroll down to the footer. Scroll back up. This is the code that I have written: base.java ; ...
0
votes
1answer
39 views

I am unable to login

import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; public class testClass { public static ...
0
votes
3answers
42 views

How to have just one pre-requisite check in TestNG for multiple tests distributed across classes

I have a Test Automation project using TestNg. I want to make sure certain configurations are enabled before I start some of the tests. I have written this as a test and marked other tests as ...
0
votes
2answers
33 views

How to select two and three check box in a table

How to select random checkbox in a table because checkbox id, type , name are same then how to get random checkbox select and value is different. http://prntscr.com/106nuzd
0
votes
3answers
58 views

How to log testing results to xlsx (Excel) file with Selenium WebDriver?

I have a certain test automation script written in Java with Selenium WebDriver. Currently, I log the testing results to the console and manually copy them to the required document. Is there a way I ...
2
votes
1answer
93 views

How to select this dropdown with Selenium

Here is the HTML code: <select id="faculty_id" name="faculty_id[]" class="form-control select-select2" multiple="" tabindex="-1" style="...
-1
votes
1answer
496 views

Error using Page Object Model in selenium

I am trying to design an automation framework, using the page object model, I am new to automation. I am stuck at this point, could not solve it. Kindly help I am getting Cannot invoke "org....
0
votes
0answers
7 views

Testing a mock UNIX project with MC-DC coverage

I’m currently on a UNIX mock shell project involving writing and testing implemented commands such as ls and grep. This is part of a testing module in my university, and is written in Java.. I’m ...
1
vote
2answers
26 views

Struggling to find solution for clicking element that is duplicated on different tabs of my application

Getting pretty desperate so I thought I'd reach out and see if others had ideas. The application that I'm automating has different forms and each of them open in different tabs within the application (...
0
votes
2answers
103 views

Unable to import “ExtentHtmlReporter” for the java class

I'm trying generate reports for the selenium test script. but unable import "ExtentHtmlReporter" packages to the class. added dependencies as below <dependency> <...
-1
votes
1answer
33 views

Still Getting Element is not currently visible and so may not be interacted with Can some one pls give your inputs

I am getting the above error : Below is the xpath : String MeetingTypedropdown = "//*[@id='meetingDatesForm:meetingDatesTable_data']/tr["+(i+1)+"]/td[3]//div[3]/span"; PageUtil....
0
votes
3answers
47 views

Error with driver.switchTo().window() complaining that something isn't a string when it is

TL;DR I give my function a string. It complains that what I gave it isn't a string. My code: new WebDriverWait(driver, 5).until(ExpectedConditions.numberOfWindowsToBe(1)); //induce WebDriverWait ...
1
vote
1answer
27 views

Checkbox gets unchecked even though the Code is written to only select the checkbox..can someone pls help

Scenario: On the Screen once I navigate I have to click on the checkbox the first time only... Next time when I run the script the checkbox should not be unchecked.... but Issue: First Time if the ...
0
votes
0answers
18 views

In the screen how to navigate to the row which contains the text that needs to be Edited and then click on Edit button.Can some one pls guide.NeedHelp

In the screen how to navigate to the row which contains the text that needs to be Edited and then click on Edit button. Scenario: I have a screen where I need to find the row which has the value as &...
-1
votes
1answer
251 views

Getting null pointer exception when data read from excel file

Getting null pointer exception : verifying the login successful or not. public class Test { private static WebDriver driver; private static XSSFWorkbook workbook; ...
1
vote
1answer
43 views

Not able to click Search button and also select the option from the drop down Getting .ElementNotVisibleException

Not able to click Search button and also select the option from the drop down Getting: org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted ...
0
votes
1answer
41 views

How to check in the page if the name exists and then increment a unique name

I have a scenario where I need to add new username everytime is run the script. For instance, if the last time I had added a name as test1, then next time when I add another name I should not add ...
0
votes
1answer
46 views

Getting java.lang.NumberFormatException: For input string: “517838839328”

PageUtil.clickOnButton(driver, AppXPathsConstants.UserAdminAddNewuser); String id ="1517838839328"; String newid = "1517838839328" + (Integer.parseInt(id.substring(1,id.length()))+...
-1
votes
1answer
23 views

Getting Nullpointer exception when using click method using Page object model

In Helpers class I have this below method public void click(By locator){ driver.findElement(locator).click(); } In one of the pages used that method to click on an element as follows public class ...
0
votes
0answers
18 views

How can I identify each text box without any label using Sikuli GUI automation?

Anyone please help me to solve this, i using the latest Sikuli. I have read the documentation but yet I still stuck with this. I want to automate this screen (Oracle Form), I capture the image but ...
0
votes
2answers
61 views

Selenium : How to automate end to end email feature of an application

So basically i am trying to automate the testing flow for the email functionality wherein - emails are triggered from application to users when they fill in a specific form and provide there email id ...
0
votes
2answers
49 views

How to avoid errors occur as 'Unable to locate the element'?

Here I wanted to run this method properly when boolean values are false, but when running this method it always failed the test case saying "no such element: Unable to locate element".How ...
-2
votes
1answer
47 views

Selenium Getting Hover Textbox Text

I am working in eclipse writing selenium scripts using Java. I am using the chrome web driver. I have a hyper text link that when I put my mouse over it hover text box appears. I need to return that ...
-1
votes
1answer
35 views

How can we use WebElement.FindElement() or findElements() method on a single WebElement object, even if its a method of WebDriver interface? [closed]

I am a newbie in Selenium and Java. Now, is this code correct. How can I call findElement() or findElements() method on a single WebElement? I want to store text of td[1] node. Why are we doing ...
0
votes
0answers
29 views

Unsatisfied link error exception while fetching data from sql

The following code is to fetch otp from SQL to the frontend import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql....
0
votes
2answers
59 views

convert to selnium java for loop code in python selenium [closed]

System.out.println("****************Scrolled down starts****************"); Thread.sleep(2000); for (int i = 0; i < 12; i++) { JavascriptExecutor ja = (JavascriptExecutor) driver; ja....
0
votes
3answers
109 views

How to resolve NoSuchElementException in Selenium Java?

I've been working on a company project involving Seleniumand I keep getting NoSuchElementException despite putting xpath, cssSelector and linkText. Below is my program. NewCard.java public class ...
1
vote
2answers
31 views

how to send the DB fetched values to frontend using selenium?

I wrote a program where values are coming from sql database.Now i want to send those values to frontend using selenium. say it is an pincode i fetched from Database but now if locate the element where ...
0
votes
1answer
45 views

Web page Not Scroll on mobile using java

I try to scroll two pages of website on mobile but one page is working fine but 2nd page is not scroll on mobile. Both pages working fine on window. Please suggest me how to scroll 2nd page. Below is ...
1
vote
2answers
39 views

Unable to get the list of elements to select a text from the auto-complete text box using Selenium WebDriver

I am trying to enter a keyword to an auto-select box and select the specific text that I'm passing from the populated list. Keyword: text_customer Text needed to select: Constants....
0
votes
0answers
327 views

Appium - 'POST /element' cannot be proxied to UiAutomator2 server because the instrumentation process is not running

I am trying to run an automated test in appium, what happens is that the app does get launched however fails to perform any action. Please see error below: An unknown server-side error occurred while ...
2
votes
2answers
1k views

java.lang.UnsupportedClassVersionError -CucumberJvm4SMFormatter -Java runtime Version error

My testing framework is built with Cucumber, TestNG, Java 1.8 and Maven I recently updated my IntelliJ IDE Details: IDE : IntelliJ IDEA Ultimate 2020.3 - Runtime version : 11.0.9 Cucumber is ...
0
votes
0answers
8 views

In Eclipse only, Cucumber feature steps are not getting recognized with step definitions [duplicate]

This is my runner class: @RunWith(CucumberWithSerenity.class) @CucumberOptions(features = "src/test/resources/features/" ,glue={"stepdefs"} ,dryRun=false ,monochrome=...
1
vote
1answer
69 views

Automated testing of Google Pub/Sub

I'm new to test automation and Google Pub/Sub. I'm developing automation scripts for regression testing. My automation framework is built with Java, Maven, Cucumber and TestNG My application is a ...
0
votes
1answer
30 views

Trouble reaching a text object in DOM with selenium (java)

I have the below element in the page I am currently testing: <li> "At least 4 of the following rules must be satisfied:" <br> "Password should contain at least 1 upper latin ...
0
votes
1answer
995 views

Why is my Feature File failing to find the Step Definition?

I have the following Feature File which is grayed out so I cannot run it from an IntelliJ Run configuration, nor from the right click context in the Feature File, though it runs fine from the Run.java ...

1
2 3 4 5
26