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
1 answer
482 views

Get Time taken to change between two elements

I'm trying to get the scroll time of a carousel. I tried to take time when 1st element is selected and time when 2nd element is selected, then deduct 2nd time from 1st time and get the duration. Below ...
Darshani Kaushalya's user avatar
-1 votes
2 answers
71 views

How to create new user defined method for picking date from .csv file as param and automate script through Selenium with Java?

I need to create a method to read a date from a CSV file as a parameter. I also need to automate selecting that date from the calendar tool whose HTML is below. I'm using Selenium with Java. <div ...
QA Team's user avatar
0 votes
2 answers
546 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" ...
Darshani Kaushalya's user avatar
1 vote
2 answers
422 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: ...
Tester_at_work's user avatar
0 votes
2 answers
2k views

How can I store a value as global variable from an API response and pass it to another API as parameter in Cucumber feature file using REST assured

I am designing automation scripts using the Cucumber BDD framework for REST APIs using RestAssured. I have one API which generates the "Token" and then there is another API for order ...
iAutomate's user avatar
  • 359
0 votes
1 answer
82 views

Different boolean results for same scenario - selenium java

I'm trying to verify whether profile image is present after uploading an image. Image uploads successfully. I have try to verify image with two different ways. profileImage= driver.findElement(By....
Darshani Kaushalya's user avatar
0 votes
1 answer
433 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. ...
Bajrangi_Tj's user avatar
0 votes
1 answer
2k views

How to handle disable button?

In my script below code when Thread.sleep() is not used, then it throws an exception "element click intercepted: Element <button _ngcontent-yyo-c131="" class="btn btn-sm btn-...
James P.'s user avatar
0 votes
2 answers
219 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 ...
IAmMilinPatel's user avatar
0 votes
1 answer
2k views

Button element found but click() action not performed

I am trying to verify close button using selenium java page object model. Close button is located in a pop up window. Below is the html code for the button. <div class="...
Darshani Kaushalya's user avatar
0 votes
1 answer
904 views

JMeter + Webdriver : Java code is not taking screenshot and it is giving ERROR c.g.j.p.w.s.WebDriverSampler: Sourced file: inline evaluation of:

I am new to JMeter + WebDriver + Java. JavaScript code is working as expected for screenshot. Due to recent upgrade of Java, we are moving from JavaScript to Java. Below is the code. Can you please ...
Pavan's user avatar
  • 1
0 votes
1 answer
775 views

Compilation stuck at find element by xpath without giving any error

I'm trying to automate a project using selenium page object model. Below is the html code <div class="type-1 overflow-hidden card"><div class="col-xl-8 offset-xl-2">&...
Darshani Kaushalya's user avatar
-2 votes
1 answer
84 views

Which can be better in automation framework designing for an organisation, Python or Java? [closed]

I want to start automation testing with selenium webdriver(need to design the framework for the same), so which would be better to start with Java or Python ?
Swapnil Kale's user avatar
0 votes
1 answer
370 views

Selenium controlled Chrome and Edge can't both access webcams

I am using Selenium 4 in java to control Chrome and Edge and other browsers in order to test a video call app. I have a test where I'm starting up 2 different browsers at once in order to get them to ...
Joelle Boulet's user avatar
0 votes
1 answer
4k views

XPath contains(text(), 'string') does not work, but partialLinkText('sameString') works

I'm trying to learn Selenium on Java, can't for the life of me figure out why xpath contain can't find the right element. Here's the whole case: @Test public void test1_FluentWait() { driver.get(&...
Eddie's user avatar
  • 3
0 votes
1 answer
192 views

Bad inspector exception in chrome selenium

Has anyone handled a bad inspector exception ? One quick turnaround is by using Firefox but does any one know a way around chrome
Ekansh Pathak's user avatar
0 votes
0 answers
1k views

How to display the number of pages in Pagination WebTable using Selenium Webdriver

I wan to display the number of pages in count in Pagination WebTable using FOR Loop, please find the code of FOR Loop condition. But not able to display the total number count of pages. When clicking ...
user3172464's user avatar
0 votes
1 answer
126 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 ...
user52764's user avatar
0 votes
0 answers
117 views

How to select date from PickerWheel on browser UI similar to iOS style using Selenium Java

I am trying to select start and end dates from PickerWheel on the browser. But click and select methods are not working. Because to select date we need to move like in iOS devices date picker wheel. I ...
Mukha's user avatar
  • 1
0 votes
2 answers
4k views

How to load chrome profile with Selenium correctly?

So I am trying to write a test in which the first step is logging in, but it is denying me access as it detected automation tools because the javascript has not been enabled and there is no profile. ...
Yamarai Akizuki's user avatar
-1 votes
1 answer
164 views

How to return more than one isDisplayed results inside a single method?

I am trying to create a single method to return some boolean values that check whether some of the elements are visible on a webpage. In that case, I am getting an "unreachable statement" ...
Gaveen Nayanajith's user avatar
3 votes
2 answers
5k 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 ...
chinmay k's user avatar
0 votes
3 answers
7k views

I am not able to ctrl + click on feature file in Cucumber step definition, definition not found error

Help Me I have installed Cucumber and Natural but my feature file is not getting highlighted after clicking ctrl + click. Also, it has highlighted with yellow color While running Test Runner, it says ...
Surbhi Agarwal's user avatar
2 votes
1 answer
266 views

How to wait for either element on different pages without violating Single Responsibility Principle

I have some code that currently sits in my Steps class (I am using Cucumber BDD). DriverExtensions.WaitForEitherElement(BasePage.getDriver(), this.page1.uniqueLocator(), this.page2....
R Brandon's user avatar
-1 votes
2 answers
2k views

Unable to open Jenkins localhost:8080

Kindly help me to resolve the issue as shown in the screenshot.
Salman Gorentla's user avatar
0 votes
2 answers
508 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 ...
user avatar
-1 votes
1 answer
207 views

Automating a DOB text field GURU 99 Banking Application

New here and need some advice if you would be so kind. So I am getting the hang of automation testing and am attempting to automate the registration process by providing an excel CSV and have the ...
andy's user avatar
  • 1
0 votes
1 answer
884 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....
Nandy's user avatar
  • 3
1 vote
1 answer
521 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 ...
praveen kumar's user avatar
1 vote
4 answers
211 views

Window handling in java selenium

Successfully handled the child window in java selenium but the cursor is not moving forward to the password field. My code is below package perfect; //import java.util.Set; import org.openqa....
Bug Hunter's user avatar
-1 votes
1 answer
422 views

Custom Framework for Writing a Test that Reads a CSV File into a HashMap

I am trying to complete a lab where we are asked to write a unit test that can read a csv file into a hashmap. So far I have this: import java.io.BufferedReader; import java.io.FileReader; import java....
Seeth's user avatar
  • 11
1 vote
2 answers
319 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 ...
Rush910's user avatar
  • 137
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.
Asmoun's user avatar
  • 133
1 vote
2 answers
1k views

How to execute Selenium script from Linux terminal

I created a .bat file in Windows and launching it from the Windows console and it worked perfectly. Now I got a requirement to execute it from Linux so the .bat file doesn't work, after searching I ...
Yan's user avatar
  • 11
0 votes
1 answer
388 views

Keyboard shortcuts using Selenium

I have tried using actions class but still not working Actions action=new Actions(getDriver()); String ctrlY=Keys.chord(Keys.CONTROL,"y"); action.sendKeys(ctrlY); Actions action=new ...
Subramanyam's user avatar
0 votes
0 answers
2k views

Chrome Driver Maven Error "org.openqa.selenium.SessionNotCreatedException: Could not start a new session."

I am trying to run a selenium-based java test application on Intellij using maven. The problem is that if I run the test in IntelliJ the chrome driver starts and run successfully whereas if I Exeecute ...
Azeem Baloch's user avatar
-1 votes
2 answers
18k views

I am stuck with null pointer exception in page object class

Base class package resources; import java.io.FileInputStream; import java.io.IOException; import java.time.Duration; import java.util.Properties; import org.openqa.selenium.By; import org.openqa....
Varun's user avatar
  • 3
0 votes
1 answer
145 views

ScreenShot taken isn't of what's showing in the screen, but rather that of the header until a page size

When I try to take a screenshot, I added a scroll so that it can take a significant screenshot and not only the header. Right now, the picture is still taken from the header/top of the page. Am I ...
Yan's user avatar
  • 11
0 votes
1 answer
109 views

Override Static Method for TestNg Class

Is there a way to add a screenshot in this Assert method? When my softAssert fails, I need it to take a screenshot here. Method of Assert.class : static public void fail(String message) { throw ...
Yan's user avatar
  • 11
0 votes
1 answer
2k views

Driver switching from one class to another

In the following code, I am trying to get my driver from the class A to class B. Class B can't have a constructor and I tried making a base class, but either Class A gets driver null or Class B gets ...
Yan's user avatar
  • 11
0 votes
0 answers
250 views

I have a list with Incident numbers. I want to run a test case for each of the incident. How to pass the values from list into Cucumber feature file?

I have a list with Incident numbers. I want to run a test case for each of the incident. I get the list from an excel file during execution. How to pass the values from list into Cucumber feature file?...
Mithra's user avatar
  • 1
0 votes
1 answer
117 views

Selenium Couldn't identify App crashes Android

Sometimes app crashes. But Selenium can only handle "noSuchElementException" or "TimeOutException". Does Appium runs a listener or something which tracks if the app is crashed? I ...
Rashad Nasirli's user avatar
2 votes
6 answers
95 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?
punk code's user avatar
0 votes
1 answer
7k views

New pc setup and keep getting WebDriverException: unknown error: Failed to create Chrome process

Any new leads on this issue? I recently switched PC and now facing the same problem so many users faced. It was usually solved with downloading the latest chromedriver.exe or by moving the chrome.exe ...
Haris Psarropoulos's user avatar
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 ...
Rush910's user avatar
  • 137
0 votes
2 answers
241 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 ...
Rush910's user avatar
  • 137
0 votes
1 answer
880 views

Jmeter + Java: Error generating dashboard report in dynamic folder

I'm trying to execute performance with Jmeter from Java. My code is written below. I'm facing an issue generating dashboard report. I want to dashboard report to be written in "Target" ...
IAmMilinPatel's user avatar
-1 votes
2 answers
417 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 ...
Nijesh Manuel's user avatar
1 vote
0 answers
139 views

Capture Google Analytics data from Charles Proxy using automation

Currently we are using Charles Proxy to capture Google Analytics data for our web site testing. Each page we navigate will have a POST created and request data as shown in the attached screenshot. We ...
M Thurman's user avatar
1 vote
2 answers
521 views

Parallel selenium UI test failure rate has increase when compared to sequential execution

Recently I have implemented parallel selenium UI test execution by increasing Jenkins node count and creating multiple Jenkins jobs with different regression.xml files pointing to them. In a nutshell ...
ChathuD's user avatar
  • 2,147

1 2
3
4 5
30