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
-3
votes
0answers
27 views

Call browser from one step and enter information from another step? [duplicate]

I want to call google in one step, and when it is open I need to enter the information from another step. I am facing problems because I don't want to open the page more than once. In the below code ...
0
votes
0answers
26 views

Stored data in ArrayList of one website to be used in another Website [closed]

Stored data in ArrayList of one website to be used in another Website I am storing data in an arraylist of fields and labels display in website I logout from the browser Now I am opening another web ...
0
votes
1answer
34 views

element is not getting clicked even it got validated from dropdown list in selenium WebDriver

HTML CODE <div id="__test0-defaultXML--idQueueName" data-sap-ui="__test0-defaultXML--idQueueName" style="width: 100%; max-width: 100%;" class="sapMSlt sapMSltDefault sapMSltHoverable ...
1
vote
2answers
44 views

driver.findElement used outside the method throwing Nullpointer Exception in POM model

I have created two class files 'LoginPage.java' and 'orangeHRM.java' Now as part of POM, I have initialized the 'LoginPage' object in 'OrangeHRM' LoginPage LP = new LoginPage(driver); I have ...
0
votes
0answers
29 views

Undefined step reference for import io.cucumber.java8.En on Intellij Idea

I am not able to define reference for java8 cucumber. Using Intellij 2019.1.1 version *.feature file is registered in File Types (Examples in feature files are recognized, but not steps) Cucumber for ...
0
votes
1answer
30 views

WebDriver wait.until using the arrow function throws exception when false

This works if true but fails when it hits false. Is there any way to make this work while it is true? WebDriverWait wait = new WebDriverWait(driver, 30); ExpectedCondition<Boolean&...
0
votes
1answer
44 views

Best model/design technique for test scripts [closed]

What's the best/most advanced classes design/modelling approach when writing selenium webdriver scripts using Java. Example of one modelling approach is TDD and page object. Can we integrate both? ...
0
votes
0answers
22 views

i have written the test script to generate the extent reports but the execution is running success but report is not generating

package com.actitime1.generics; import java.io.File; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; import org.apache.commons.io.FileUtils; import org.openqa....
1
vote
1answer
38 views

How to disable selenium from taking physical mouse on Chrome on user's machine on a different monitor screen?

My issue is related to this question Disable physical mouse and keyboard in selenium but I didn't see an answer for this question. tests are being ran by Java + Selenium + Chrome on the same user's ...
0
votes
1answer
25 views

Jmeter - Unexpected output of Test plan

Test Plan : * Recording Controller#1 > CSV UserName DateSet > HTTP Request#1 > HTTP Request#2 - HttpHeader Manager - Regular Expression Extractor - JSR223 ...
0
votes
1answer
87 views

Automation solution for PDF content validation using Java [closed]

I am doing POC on PDF content validation which will basically validate the content of PDF files. But I didn't find any solutions. Solution which I am looking for: Read the PDF file from a specific ...
2
votes
2answers
59 views

java.lang.NullPointerException problem in Selenium Test

I'm learning Selenium POM with Junit and ran into a problem. java.lang.NullPointerException at MainPage.clickSignIn(MainPage.java:27) at MainPageTest.signInTest(MainPageTest.java:28) My class: ...
2
votes
2answers
147 views

Best strategy to test automatically a web application

I have an application that consist of a web server in Java EE (EJBs and JAX-RS RESTful services) and a client module in Angular that runs in a browser. The components that I can unit test ...
0
votes
1answer
34 views

NullPointerException error in POM code

Setup Class public class Setup { private static AndroidDriver driver = initializeAppiumServer(); public static AndroidDriver initializeAppiumServer() { if (driver == null || ...
0
votes
2answers
62 views

How to add an argument to my BaseTest ChromeDriver Instance?

I have a selenium framework with a BaseTest class. In the BaseTest class we instantiate a ChromeDriver instance which contains various arguments. These are part of the @BeforeMethod (using TestNG). My ...
0
votes
1answer
72 views

Rest-assured. Is it possible to extract JSONObject/JSONArray from response json?

I'm Using RestAssured, and i'm getting the response like this- { "Data": { "Sub": { "SubDetails": [ { "OrgId": 5, ...
16
votes
6answers
4k views

Writing test automation in Java, while the company domain uses C#/.NET

I´ve recently got a job as a automation tester in a company, that basically only have manual testers (except me). The short term plan is to come up with a good test strategy for identifying which of ...
-1
votes
3answers
29 views

How to use Click after getting text of an autogenerated time stamp

Using Java/Selenium and Page Objects, I have to create an item name that is auto generated using the current date and time and entered into a text field. I then have to verify that this item was ...
0
votes
5answers
274 views

Element not found in a runtime

I am encountering a very unusual thing, the one I haven't seen before. There is one element I needed to find for testing purposes, it is visible on the page and I can find its unique relative XPath ...
0
votes
3answers
82 views

Selenium un-enable to find element

I have been through every selenium related page on here but not much else I can really try. I am trying to click on the text link but It gives me 'org.openqa.selenium.WebDriverException: chrome not ...
0
votes
1answer
73 views

Appium Inspector find element with the path but appium for java doesn't

I'm testing a mobile app using appium + selenium + java I have an element that I'm trying to find (in order to click on later) by using an xpath. Here is the xpath: //android.widget.TextView[@text='...
6
votes
5answers
618 views

How to connect Selenium to an existing browser that was opened manually in java?

I want to achieve some use cases in which: I want to perform some tasks that require manual intervention before kicking in automation execution. For instance, I need to manually launch the browser, ...
-1
votes
2answers
53 views

Getting java.lang.NullPointerException while trying to instantiate the Webdriver driver under @ Annotation

Please find the code below and let me know why am I getting NullPointer. I am having no clue. package com.seleniumhybridframework.utility; import java.util.concurrent.TimeUnit; import org.openqa....
3
votes
1answer
68 views

How to resolve NullPointerException error while implementing POM with cucumber framework

I am getting java.lang.NullPointerException while executing my test case, I am using Page Object Modle with cucumber framework in my maven project, following are the code snippets BoxJunitScript.java ...
3
votes
2answers
65 views

Java Selenium click checkbox [duplicate]

I can’t get selenium to click on this checkbox button no matter what I do. Error: no such element: Unable to locate element: I have used sleep thread timers and wait.until(ExpectedConditions....
3
votes
2answers
117 views

Nested explicit wait does not work in Appium

For example, I'm sending a message. While it's being sent to the recipient it has the resource-id "pending_indicator". When it is delivered, it has the resource-id "delivered_indicator". So, I'm ...
3
votes
1answer
402 views

Exception in thread “main” java.lang.AssertionError: expected [3] but found [3]

System.setProperty("webdriver.chrome.driver", "C:\\Users\\srajendran\\Documents\\chromedriver.exe"); WebDriver driver=new ChromeDriver(); driver.get("http://qaclickacademy.com/practice.php"); ...
0
votes
2answers
61 views

How to automate functional regression tests through database data comparisons?

I have a Java batch job application that reads input data from an Oracle database, does a lots of calculations, handles many edge cases, and outputs results back into different database tables. The ...
1
vote
1answer
100 views

How to select a dropdown value in Selenium WebDriver using Java appium?

I am new to Selenium, currently am working on selenium webdriver. I want to select a value from the drop-down. But I am not able to do it because of some error. Also, I want to inform you that in my ...
3
votes
2answers
255 views

Code coverage for Selenium Tests

Is there any tool available to determine the code coverage for my selenium tests? My tests are written in Java having use of selenium WebDriver with BDD-Cucumber implementation in it.
0
votes
1answer
43 views

Find element within another element using explicit wait

I have the following code: List<MobileElement> messages = driver.findElements (By.id ("body_bubble")); //find all messages MobileElement lastMessage = messages.get (messages.size () - 1); //get ...
0
votes
1answer
26 views

Unsuccessful Test Continues to Next Test With No Output

setUp: To save time starting/closing browser, logging in/out, I've started grouping regression tests in common classes. I know there are other ways to do this, this one made most sense for our ...
2
votes
1answer
24 views

Ignoring some test steps depending on variables

I'm using Cucumber + Java + Selenium to UI test an application. I'm using the same set of tests whether my application is deployed in qualification (for tests) or in production. However, when I'm ...
0
votes
1answer
45 views

Count all elements with the specific resource ID on the scrollable view

Here is the question. How can I count all the elements with the resource ID body_bubble on a scrollable view ? When I use the driver.findElements (By.id ("body_bubble")).size() method, it gets only ...
0
votes
1answer
103 views

Webdriver setup error in Eclipse, Mac OS X Catalina

After upgrading Mac OS X to Catalina, I have been trying to execute a very basic script written in Java for Firefox in Eclipse IDE 2018. I've installed Gecko driver already through terminal and it's ...
0
votes
0answers
27 views

How to apply a 'Loop' to map the row element where XPath changes whenever page get's loaded [duplicate]

How to map on to a particular row element say " NCC "where the number of the row containing that element changes whenever page get's loaded. Reference website-guru99 for(int i=0;i<19;i++) ...
0
votes
0answers
34 views

Get list of all hover menus and and their all nested hover menus using selenium

@Test public void MedicineList() throws InterruptedException { driver.get(sitedata.getProperty("Medication_url")); WebElement mainmenu = isElementPresentt("dog_xpath"); ...
0
votes
1answer
124 views

Cannot find an element with Xpath in Appium

I'm new to Appium. Sorry if the question is duplicated, but I did not find the solution. I have a problem - I cannot locate an element using Xpath, but I have no problems locating it using the ID ...
1
vote
1answer
29 views

Cucumber-jvm - Retrieving embedded image from TestCaseFinished event

I have a cucumber plugin where I post my test case results to TestRail using the TestCaseFinished event. It works so far, but on failed steps, I use the scenario.embed method to add a screenshot of ...
0
votes
2answers
66 views

Avoid default selection when selecting random value from dropdown

I have a method below that selects a random item from a dropdown list. This works well mostly, but on occasion it will reselect the default option which is usually "Please Select" or a blank value. ...
1
vote
1answer
58 views

Verifing pdf using Selenium + Java

How can one verify pdf using Selenium + Java? Until recently, I was verifying pdf using Firefox (making sure that the pdf file wasn't empty). This was nice and working fine, but it's not multi-...
0
votes
2answers
37 views

How to rerun failed test from where they instead of from beginning? (TestNG)

Is there any way to re run the failed testcase from the page where it got failed instead of running the testcase from beginning in Selenium Java ?
0
votes
0answers
68 views

Why doesn't 'this.driver = driver', do the same as 'PageFactory.initElements(driver,this)'?

I have a page object with im trying to instantiate so that I can perform methods on it in my tests like goto etc. But when I try to use it with PageFactory.initElements(driver,this);. The browser ...
4
votes
1answer
268 views

Selenium PageFactory vs Page Object Model

I've created a framework in C# using the Page Object Model for fun and am now creating a framework in Java to learn Jenkins etc... also for fun. I have come across the PageFactory concept for Java ...
0
votes
3answers
298 views

Selenium Webdriver sendKeys method sending value twice

I have 6 selenium tests (TestNG) running on chrome and firefox (both up to date versions) which connect to Browser stack to run. the problem is that 1 of the test fails intermittently on Chrome as ...
1
vote
3answers
128 views

One Selenium framework to rule them all (or an actively maintained collection of frameworks)

I am looking for most universal, up to date, open source, selenium framework for test automation. Or at least a number of frameworks for different languages. I am surprised as how every company and ...
0
votes
7answers
115 views

How to handle changing absolute XPath?

/html/body/div/main/div/div/div[2]/div/div/div/div[1]/div/div***[4]***/div/div[2] The div[4] element keeps changing. If a new item comes into the web, the div number changes. How do I handle this?
0
votes
0answers
22 views

Looking for a java library automate third party Java-Swing application without access to the source code

I'm looking to automate a third party java swing application that my company uses. I don't have access to it's source code so a lot of the swing testing libraries like Assert-J won't work. I'd like to ...
0
votes
2answers
284 views

Chromedriver quit() method doesn't close all chrome.exe processes

When I am trying to close the chrome browser using driver.quit() and driver.close(), browser is getting closed but chromedriver.exe process is not getting closed. How can we remove these processes ...
0
votes
0answers
27 views

Java/JNA desktop Application Testing

I am a web developer, so I know what kind of tests need to run on web application before sending it to production. First time I have developed a service for desktop application. That newly developed ...

1 2 3 4 5 24