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
-1 votes
0 answers
12 views

How to use arrays while automating dynamic webtables?

I can write program to print total number of rows/columns and data present in each cells of dynamic Webtable. But how to use arrays while automating dynamic webtables? I am using Selenium tool with ...
user avatar
0 votes
0 answers
17 views

SwitchTo method in WebDriver Interface

In the WebDriver interface(Javadoc) we have method SwitchTo and its type is WebDriver.TargetLocator, but when clicked on WebDriver.TargetLocator interface, in that interface SwitchTo method is not ...
user avatar
-1 votes
0 answers
8 views

Anyone Worked on exporting HAR file using CDP/Selenium or Selenium Bidi API? [closed]

Did anyone work on exporting the HAR files using CDP/Selenium or Selenium Bidi API?
user avatar
0 votes
1 answer
22 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="...
user avatar
0 votes
1 answer
33 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 js to Java Below is the code. Can you please help on it ...
user avatar
  • 1
0 votes
1 answer
49 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">&...
user avatar
-2 votes
1 answer
32 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 ?
user avatar
0 votes
0 answers
24 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 ...
user avatar
0 votes
0 answers
12 views

Making Webpage headless is causing issue with finding WebElement through Xpath

I had to make chrome browser headless after which when I try to see the html code by executing below lines ChromeOptions options = new ChromeOptions(); options.addArguments("--headless"); ...
user avatar
0 votes
0 answers
9 views

Unable to click anchor tag in grid again after navigating to another page

In the gridview I click the anchor tag in column KU_Total Qty following which I navigate to Grid in another page. WebElement totalQty = ldriver.findElement(By.xpath("//td[@aria-describedby='...
user avatar
0 votes
1 answer
56 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(&...
user avatar
  • 3
0 votes
1 answer
61 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
user avatar
0 votes
0 answers
48 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 ...
user avatar
0 votes
0 answers
11 views

How can we get an aggregated count of all tests failing for a particular error in Report Portal?

I have multiple scripts failing for a particular assertion error. I need to get a total count of all the tests failing for that error. The logs are enabled in the Report Portal for each test. How can ...
user avatar
  • 23
0 votes
1 answer
43 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 ...
user avatar
0 votes
0 answers
16 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 ...
user avatar
  • 1
0 votes
0 answers
76 views

how to load chrome profile with Selenium

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. ...
user avatar
-1 votes
1 answer
21 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" ...
user avatar
0 votes
0 answers
19 views

Unable to determine element locating strategy for -android uiautomator

I have a method which works perfectly locally, but when I launch it on server I’ve got an error: org.openqa.selenium.InvalidArgumentException: Unable to determine element locating strategy for -...
user avatar
2 votes
2 answers
139 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 ...
user avatar
-1 votes
1 answer
112 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 ...
user avatar
2 votes
1 answer
38 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....
user avatar
-1 votes
2 answers
84 views

Unable to open Jenkins localhost:8080

Kindly help me to resolve the issue as shown in the screenshot.
user avatar
0 votes
0 answers
25 views

How to pass Selenium By in UIselector

I wrote script which is scrolling mobile app view and selects element by resourceId and text. Simple text select doesn't work for me. public void tapOnElementById(String resourceId, String visibleText)...
user avatar
0 votes
0 answers
32 views

Appium 2 (Beta) - How to scroll to an element using Java with Appium 2?

I'm preparing to migrate to Appium 2. There's many things that no longer work in Appium 2. I'm trying to find a way to scroll to an element. Note that in Appium 2, there's no AndriodElement, it's not ...
user avatar
0 votes
2 answers
67 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
24 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 ...
user avatar
  • 1
0 votes
1 answer
148 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....
user avatar
  • 3
1 vote
1 answer
73 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 ...
user avatar
1 vote
3 answers
68 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....
user avatar
-1 votes
1 answer
109 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....
user avatar
  • 11
0 votes
0 answers
36 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. but it is capturing and always gives no such element exception.my xpath looks like below when ...
user avatar
  • 97
0 votes
0 answers
21 views

How to send text to shadow element using javascript in selenium Java

Element is inside shadowroot. Both ways not working Can anyone help here. Shadow element stored in element named variable and need to enter text in the description field. driver.executeScript("...
user avatar
0 votes
1 answer
75 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.
user avatar
  • 121
0 votes
2 answers
74 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 ...
user avatar
  • 1
0 votes
1 answer
45 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 ...
user avatar
0 votes
0 answers
428 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 ...
user avatar
-1 votes
2 answers
2k 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....
user avatar
  • 3
0 votes
1 answer
35 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 ...
user avatar
  • 1
0 votes
1 answer
30 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 ...
user avatar
  • 1
0 votes
1 answer
76 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 ...
user avatar
  • 1
0 votes
0 answers
19 views

ScreenShot when failed not taken Selenium

I am trying to take a screenshot of the page when an exception is triggered. My main Class : @Listeners(CustomListener.class) public class AjoutPanier extends Base { @BeforeTest public void ...
user avatar
0 votes
0 answers
28 views

Target selectors in empty iframe with selenium JAVA

So there is an iframe on my page, I have no troubles switching to the iframe itself. The problem is I can't interact with its (text)fields since the iframe is empty (no source). iframe source code: &...
user avatar
0 votes
0 answers
29 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?...
user avatar
  • 1
0 votes
1 answer
33 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 ...
user avatar
1 vote
4 answers
65 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?
user avatar
0 votes
1 answer
979 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 ...
user avatar
0 votes
1 answer
32 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 ...
user avatar
  • 97
0 votes
2 answers
83 views

How to run java+selenium method continuously

Simply, 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 need to click on that button. this is continuous process and need to ...
user avatar
  • 97
0 votes
1 answer
207 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" ...
user avatar

1
2 3 4 5
28