Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
14 views

How can i close alert message by enter action through keyboard?

I'm looking for different way for closing alert message except accept() or dismiss() methods so how can i close alert message by enter action through keyboard ?
0
votes
1answer
16 views

Capture arguments of onclick() javascript call using Selenium Java

I am writing a selenium script in Java to capture the arguments passed in JavaScript onclick() call/method. Attached is the image in which method/function name is highlighted. Now, In this method ...
0
votes
0answers
10 views

Determine Element type in Jubula Client API

I have to test a JavaFX application and to keep coherence with the existing automation framework I want to create a WebDriver Protocol conform driver API. Now I get the problem that elements within ...
1
vote
1answer
38 views

No Encapsulation in my project

It's been a long time that I am writing Test Automation scripts in Java, but I never had encapsulation in my code (code hiding). Creating Interface, Abstract Classes or Java beans were never part of ...
0
votes
0answers
23 views

How to remove keys from rest-assured ValidatableResponse and assert response with constant json string

In rest-assured test cases I am getting mentioned 'ValidatableResponse response' where I want to remove keys such as "updated_at", "deleted_at", "created_at" and "notice" and assert this object with ...
0
votes
0answers
12 views

How to remove keys from response json and hold remaining json data in an object using java 8 lambda expressions for rest assured test case

In REST-assred test case I am getting ValidatableResponse body as mentioned from which I want to remove 'notice', 'created_at', 'updated_at' and 'deleted_at' keys using java 8 lambda expressions and ...
0
votes
1answer
61 views

Interview Preparation

How can prepare for quality automation analyst (1 yr exp) interview? Actually this is the final round. They've said like there will be a technical discussion and soft skills with the QA lead and ...
0
votes
1answer
27 views

Why can't resolve NaN in Selenium script?

I have recorded some functions using Selenium IDE and exported test into java file. I have used "wait for element visible" condition when performing action in order to assert a notification. ...
-1
votes
0answers
24 views

How to handle java.lang.NullPointerException in testNG? [on hold]

I am getting below issue: java.lang.NullPointerException at org.testng.remote.strprotocol.TestResultMessage.<init>(TestResultMessage.java:127) at org.testng.remote.strprotocol....
2
votes
2answers
55 views

if/else condition is not working as expected

WebElement radio= driver.findElement(By.xpath("//[@id=\"mydiv\"]/form/div[1]/div[3]/label")); if (radio.isSelected()){ Thread.sleep(2000); driver.findElement(By.xpath("//*[@id=\"mydiv\"]/form/...
0
votes
2answers
22 views

How to use assertion to compare both different size of the rows?

I want both size of the rows shouldn't be matched. int firstnum = 0; List<WebElement> preRoutlList = driver.findElements(By.xpath("//*[@id='txBottomTable']/table/tbody/tr")); ...
0
votes
1answer
25 views

How to read data from JSON file , Then Pass these values on web application form with the help of Xpath Locators and Then Write it in Excel file?

Steps : Can you suggest the approach or share some sample script 1.Read data from JSON file - Method to Provide Data (JsonReader.getdata) - Get file location & File Name 2.In @Test(...
0
votes
1answer
22 views

Verify and Assert functions does not work as expected in Selenium IDE?

I'm using Selenium IDE to record steps. Web system has developed using Angular.js I tried to use verify text and assert text functions through IDE. For target elements, xpath is given. Same xpath is ...
-2
votes
0answers
23 views

How to check that field is drop down or a text field. First find that filed by id or class then want to send data into that field [duplicate]

issue is that i have some custom fields and you are not sure that how many field may be there. Secondly your are not sure that field is drop down or text field. Third one is that a field may b ...
0
votes
1answer
58 views

How to read data from multiple excel sheets, where each sheet has Unique Column count - Selenium(Java) - Data Driven Framework [closed]

I am trying to get data from Excel from multiple sheets and assign variable to those data. (For my Data Driven Framework) I am successfully able to get the data, but while running the test, I am ...
2
votes
1answer
43 views

Unable to pass dynamic xpath in repository file?

My code is : for (int z = 0; z < rows.size(); z++) { rows.get(z).findElement(By.xpath("//*[@class='ng-scope'][" + (z + 1) + "]//*[@placeholder='Stop Name']")).sendKeys(shuttleObj.getStopArea()); ...
0
votes
1answer
41 views

Getting nullpointer exception for 2nd test case working fine for login

Driver set to null for 2nd test case, working fine for login. Driver class: public class Driver { private static WebDriver driver;; /** * * @return * @throws Exception */ public static ...
-2
votes
1answer
27 views

Is it possible to setup a Allure reporting server? [closed]

we have various teams across our business unit. I need to consolidate the test results across the teams and display for Business unit leads. So we were thinking allocate a AWS S3 storage location and ...
1
vote
1answer
58 views

Click the last but one checkbox

In a page there are n number of checkboxes. Each time the page refreshes the list of checkboxes will also be refreshed and can be a different size. How do I click the second last (last but one) ...
0
votes
1answer
26 views

Compilation error when extending class and defining a method

I am getting compilation error when I am extending Loginpage class through Loginbusiness, define a method but compilation throws an error to remove illegal identifiers(eg. public) and also for ...
1
vote
2answers
33 views

Chrome Driver - testNG parallel issue

I am trying to run selenium test classes parallel using testNG like this thread-count="3" parallel="classes" . But the issue is at closing the chrome driver and everything else works fine. while ...
0
votes
0answers
43 views

Code can't be executed after running click method

After being run click function , i don't know why but the next sendKeys function can't be executed. eclipse is getting stuck and after a while, i'm facing with "timeout waiting for page to load" error....
-1
votes
1answer
36 views

Email code modifications needed

Below is the email code to send Reports after execution and one method put is used, that's generating error. How to defined that put method to successful Test execution and test report sends ...
0
votes
1answer
47 views

Unable to find the correct xpath for input field?

Unable to locate the element. <div class="col-md-4"> <label class="radio-inline"> <input type="radio" name="routing_option" data-ng-model="generateRoutes" data-ng-value="'...
2
votes
4answers
121 views

Replacement of @Findby in pagefactory for dynamic value with locator

I like to use POM pattern with page factory and in fact I have been using it since long in my various automation frameworks. Some time I am facing issue where I have to write text based xpaths in ...
0
votes
1answer
24 views

Selenium Webdriver fails to load browser through WebDriverManager

We can run our tests in different browsers in selenium Webdriver, previously we need to executable files to run our test in any browser. But now we can achieve without using exe files & with the ...
0
votes
0answers
21 views

How to identify the fields and their values in the listview screen which are inside a recyclerView

I am automating a Mobile screen where I have the details of a particular transaction, in which I have fields(fieldnames like card number, transaction date, Transaction ID., etc.) and the subsequent ...
0
votes
0answers
28 views

I'm facing with “timed out waiting for page to load” error although screen is already loaded

After pressing search button by typing number, a table including just one row related to data that i searched is being displayed on same page and i have to press in the another button which is located ...
0
votes
1answer
41 views

How to Automate the fields that are text and drop downs. You are not sure that how may fields will be and of which type (text/drop down.)

here situation is like that admin set the Specified fields for front end user and its upon admin that how many fields he set for user. One thing is that he can only create 2 types of fields either ...
-2
votes
1answer
51 views

How to assert that particular element is not displayed? [duplicate]

Can someone help me fixing NoSuchElementException. Let me explain what I am trying to do. I am trying to login into an application with multiple sets of data. Lets say, 1) Valid username and ...
0
votes
1answer
29 views

How to handle WebElement Dropdown whose tag starts with <Span>?

Script is selecting country element then entering Text in Search field as "India" which shows 2 values in search result . I am unable to select displayed field value ? Test Case :- 1. Navigate to ...
0
votes
1answer
13 views

Switching to another window if inside inner frame

If I am inside a inner frame and there is button if I click on that button a new window will open. Will it be possible to switch to newly open window doing driver.switchTo().defaultContent(). ?
0
votes
1answer
35 views

Getting error message on webpage but test cases get passed -using testng with selenium

Driver class: package com.deere.gmsr; import java.util.Properties; import java.util.concurrent.TimeUnit; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; ...
1
vote
1answer
46 views

I get find element error when I try to click on footer part whole link

My coding logic: List<WebElement> getelement = driver .findElements(By.xpath("//*[@class='footer__content']//a[@class='footer-nav__link']")); WebDriverWait wait=new ...
0
votes
2answers
35 views

Selenium : How to handle a window which automatically closes and back to parent window & Opens window PopUp

I have a test case with following scenario: Click on global Order Mgmt Super user Click on Sales Order link Which Actually Opens new Window & Closes automatically Focus came back to Parent window ...
1
vote
1answer
21 views

Logging js console when doing selenium test using firefox driver

I'm writing selenium tests which are launch on the firefox (gecko) driver. If a test fails, I want to retrieve the log present on the firefox js console. In order to do that, I have added the ...
0
votes
0answers
44 views

getting null pointer exception for different step definition files with cucumber and selenium

Browser utility: package com.gmsr.utility; import java.util.concurrent.TimeUnit; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class BrowserUtility { ...
0
votes
2answers
38 views

How to Automate using selenium Java if data is there in divs and changes every time

just as in the above image there is use of divs and every time the data (image) in that div changes. You are not even sure that how many divs will be therewith respect to row and columns. Kindly ...
0
votes
2answers
38 views

find xpath for 'PAINEL DE CONTROLE EDITORA'

Facing issues while locating element outside the span please refer the images and post the xpath for it. Update: I have tried the suggestion in Upkar Singh's answer and the xpath below with no ...
-1
votes
1answer
68 views

Caused by: org.openqa.selenium.NoSuchElementException: No such element [closed]

Java Code: @Test public void enterApplicationCerdentials(String userName, String password) { WebElement element; WebDriverWait wait = new WebDriverWait(driver, 100); ...
-1
votes
1answer
39 views

Getting “java.lang.NullPointerException” exception when i try to run my POM test [duplicate]

I have 2 classes in my project First class contains all the webelements Second one for method where i am using this elements package facebook; import org.openqa.selenium.By; import org.openqa....
-1
votes
1answer
48 views

Transition from selenium to protractor - worth it?

Over the last few weeks, We have been experimenting with a protractor+typescript+cucumber framework for our new Angular 6 application. The main reason we thought our present Selenium+Cucumber+java ...
0
votes
1answer
24 views

Unable to find the element within frame

i cant click the menu named biometric check list. there's total five frames and i started to read it from first index. getting unable to locate an element error. What might be the reason any idea. ...
0
votes
1answer
33 views

How to do better performance testing using JMeter for mobile application

I am new to JMeter, Can anyone help me to do better performance testing of mobile application and graph with different ranging. e.g : Thread = 10 Ramp-Up=0 Loop Count =1 The outcome is Throughput ...
0
votes
3answers
52 views

Unable to locate element Selenium Java

My xpath: @FindBy(xpath = ".//div[@class=\"recaptcha-checkbox-checkmark\"]") private WebElement captchaCheckBox; Method: public void clickCaptchaCheckbox() { captchaCheckBox.click(); } ...
0
votes
1answer
37 views

How to close this dialog

This is the code for an opening specific page and after that popup appear which I am unable to handle. I have used alert, switchTo, etc.. //Open Browser WebDriver driver = new ChromeDriver(); //...
0
votes
1answer
34 views

Java Null pointer exception when trying to click on an element that is present in a block and becomes visible when another element is clicked

I am trying to click on an element which is present in a block and the block itself becomes visible when another element "Your Trips" is clicked on. I am able to find the element and click on Your ...
1
vote
3answers
83 views

Unable to find element with xpath within nested framesets

I'm using driver.findElement(By.xpath("//a[@title='A K T İ V A S Y O N']")); to locate the element given below in the screenshots but getting Unable to find element error. There are nested classes ...
0
votes
1answer
29 views

how can i capture src in xml by using cssSelector or Xpath?

how can i capture src in following xml by using cssSelector or Xpath ? <INPUT src="/TelsimGlobal/Menu/image3.gif" type=image> i tried to execute following ones but always faced with "Unable to ...
1
vote
1answer
64 views

How to test the automation of a process?

After "automating" the import of some data, I need to test this. Yet I have no idea how to actually test this. Info about the "automation": We are having an application which has several "jobs". ...