Libraries & Frameworks

Facing issue to read content after clicking an element in Selenium. I have tried with below code:

if(webElement2.isDisplayed()) {
webElement.explicitWaitToClickElement(4,webElement);
webElement2.click();
}

String tagContent = (String) ((JavascriptExecutor)
BrowserUtilities.getDriver()).executeScript(“return arguments[0].innerText;”, webElement2);

I am trying to get the name and the price information from this website with XPath. When i write my XPath expression down in the search bar it locates correctly in the chrome. But in VSC it doesn’t work. I get nameHtml is null error. This is the only element that has style__Text-sc-__sc-1nwjacj-0 iwTTHJ sc-dd9e2587-8 dsYcan class. Is there a problem with my expression or the code ?
Thanks

my code:
public class Main {

public static HtmlPage getDocument(String url) {
HtmlPage page = null;
try (final WebClient webClient = new WebClient()) {
webClient.getOptions().setCssEnabled(false);
webClient.getOptions().setJavaScriptEnabled(false);
page = webClient.getPage(url);
} catch (IOException e) {
e.printStackTrace();
}
return page;
}

public static void main(String[] args) throws IOException {

WebClient webClient = new WebClient();
webClient.getOptions().setCssEnabled(false);
webClient.getOptions().setJavaScriptEnabled(false);

HtmlPage page = getDocument(“https://getir.com/en/category/fruits-veg-tBYm30SlS9/”);
HtmlElement nameHtml = page.getFirstByXPath(“//div[@class = ‘style__Text-sc-__sc-1nwjacj-0 iwTTHJ sc-dd9e2587-8 dsYcan’]”);

System.out.println(nameHtml.asNormalizedText());}

Workload Automation (WLA) offers a unified solution for managing complex, repetitive tasks, providing significant benefits to IT teams and businesses by improving efficiency and operational accuracy. In this article, we will learn what is workload automation, its advantages, disadvantages, and the following. What is Workload Automation (WLA) Workload Automation (WLA) is the process of using…
The post What is Workload Automation? Detailed Tutorial appeared first on Software Testing Material.

I need to automate a login which uses a fido token. No person can be behind the screen as it is supposed to be automated. I can build a small device which would move the “finger” up and down. My questions is: What can I use to disguise a human finger?

With same code I have tried scrolling, firstly I scrolled to bottom then top and then to element so that element can get loaded properly even though sometimes testcases are failing due to scrolling
public void pageScroller() {
try {
JavascriptExecutor executor = (JavascriptExecutor)driver;
executor.executeScript(“window.scrollTo(0, document.body.scrollHeight)”);
Thread.sleep(2000);
executor.executeScript(“window.scrollTo(0, 0)”);
Thread.sleep(2000);
}
catch(Exception e) {
test.log(Status.FAIL, e);
}
}“`

//Tried below two functions for scrolling

“`private void scrollToElement(WebElement articleSection2) {
// TODO Auto-generated method stub
try {
((JavascriptExecutor) driver).executeScript(“arguments[0].scrollIntoView();”, getWebElement(articleSectionStr));
} catch (Exception e) {
e.printStackTrace();
}
}

public void scrollToSection(WebElement element) {
try {
JavascriptExecutor executor = (JavascriptExecutor) driver;
int loc = element.getLocation().y;
executor.executeScript(“window.scrollTo(0, ” + (loc – 150) + “);”);
} catch (Exception exception) {
exception.printStackTrace();
}
}

I have add transaction controllers to my jmeter test. But still I cant see any transactions at the Grafana dashboard.
Here is the defenition for the transaction variable at Grafana :
SHOW TAG VALUES FROM “jmeter” WITH KEY = “transaction” WHERE “application” =~ /^$application$/ AND “transaction” != ‘internal’ AND “transaction” != ‘all’

Red Team Assessments are crucial for identifying and mitigating cyber threats in SMBs and large enterprises. These assessments reveal vulnerabilities, improve incident responses, and ensure compliance with industry regulations by simulating real-world attacks. The blog discusses how it comprehensively evaluates security measures, helping businesses adapt to evolving threats and maintain robust cybersecurity defenses. Investing in Red Team Assessments protects sensitive data and maintains business continuity.
The post Why Should SMBs and Large Enterprises Invest in Red Team Assessments? first appeared on TestingXperts.

Im using Cucumber BDD framework with Selenium+Java. Now, I have made on BaseClass.Java in which i declare on public static WebDriver driver;
Now, in my .feature file i have many scenarios and in each scenario’s steps: Given, when, then – i need to initialize the PageFactory.initElements(driver, class) again as if i dont do, then i get nullpointer expection.
Now, instead of creating object of each PageObject class and then passing main driver instance in it’s constructor, im extending all PO classes and STep definition class the BaseClass.java. Now, these directly have the driver instance inherited.
There is no need to create object of any class and its working fine as only 1 driver session is maintained throughout my test.
So, none of my class has its own local WebDriver driver; instance as its using the driver , that it inherited by default from the base class.
Is it ok to use such design pattern?

I am trying to access the table row data which is under the table body.
Following is my HTML:
<div class=”panel panel-default” id=”confirmationNotificationPanel”>
<div class=”panel-heading”>
<h3 class=”panel-title pull-left”>Patient Confirmation Notifications</h3>
<button type=”button” class=”btn btn-success btn-xs pull-right” onclick=”createConfirmationNotification()”><i class=”fa fa-plus-circle”></i> Add New</button>
<div class=”clearfix”></div>
</div>
<div class=”table-responsive”>
<table class=”table table-striped table-bordered table-hover”>
<tbody id=”confirmationNotificationTableBody”>
**<tr id=”confirmationNotification49″ data-id=”49″>**
<td style=”width: 180px;”>
<select id=”confirmationNotificationSource49″ class=”form-control” style=”display: inline-block;”>
<option value=”CALL”>CALL</option>
<option value=”SMS”>SMS</option>
<option value=”EMAIL”>EMAIL</option>
<option value=”APP”>APP/SMS</option>
<option value=”WHATSAPP”>WHATSAPP/SMS</option>
</select>
</td>

I only want to get the data-id value of the table row. I am using the CSS Extractor but not able to access that data-id value. I also tried with other extractors but not able to access the same.

Using JMeter I have been trying to produce a CSV of the ID of all the database IDs that my web app creates. I’m simply looking to save one column of strings without any spaces, however when I do that I get inconsistent outcomes in the CSV file. Sometimes there are skipped lines and sometimes there are no skipped lines. I have tried working on this with JSR223 and Flexible File Writer but both give the same result, always the same issue. I thought there was whitespace or a line break in my variable but the debug listener indicates that is not the case (also when I remove the ‘n’ character from Flexible File Writer the entire output prints to a single line, so I think there are no line breaks present)

Lets assume that I have a list of web elements:
private List<WebElement> listOf250Movies;

To action/process the list I need to implement explicit wait.
In accordence to single responsibility principle should I create a method to deal with the wait explicitly:
public void waitForVisibilityOfElement() {
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(5));
wait.until(ExpectedConditions.visibilityOfAllElements(listOf250Movies));
}

OR
Is it acceptable to implement the WebDriverWait into a method that aim to achive the end result – e.g. straming the output into a console?
public void printToConsole() {
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(5));
wait.until(ExpectedConditions.visibilityOfAllElements(listOf250Movies));
for (WebElement movie : listOf250Movies) {
System.out.println(movie.getText());

}
}

Should we decouple waits from the actions or treat them as an inherent part of the process/behaviour?
Side note:
I assume, the wait method might be further decoupled by creating Utilieties class for common actions:
public void waitForVisibilityOfElement(WebDriver driver, WebElement webElement) {
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(5));
wait.until(ExpectedConditions.visibilityOfAllElements(webElement));
}

Question

One can clone a test plan from Microsoft Test Manager 2017 (desktop application).
How is that done from the TFS Test Hub (TFS web interface)?

Context

In Microsoft Test Manager 2017, one can clone a test plan; see documentation Copying and cloning test suites and test cases and screenshot:

Microsoft seems to be moving more and more of the Microsoft Test Manager features into the TFS web interface called TFS Test Hub

However, not all features of Microsoft Test Manager seem to be available in the TFS web interface
Now, I’m not sure whether the clone feature hasn’t been implemented yet, or whether I haven’t found it yet on the UI or whether there is a new concept which replaces the cloning of a test plan

Links

See some TFS Test Hub screenshots here: Planning manual tests using the web portal
Or here: TFS Test Hub: What Does It All Mean? – Benjamin Day Consulting, Inc.

The Statamic team released Statamic 5 this week. This major release focuses on performance improvements, developer experience, and continued modernization of…

I need seleniumGrid to be accessible via localhost (127.0.0.1) and instead of that, it is being offered in address:port 192.168.1.39:4444
What command option can I use to make it use localhost?
The command I’m using, right now is:
java -jar selenium-server-4.2.2.jar standalone
I’m using MacOS, 12.5 (Monterey)

I am very new to Jenkins – I am trying to run a multibranch pipeline script on Jenkins version 2.375.1. The builds are triggered with commits and PR’s filed on Github. On committing a new file or initiating a PR, Jenkins auto triggers a build but consistently stops as it hits this issue.
org.jenkinsci.plugins.workflow.cps.CpsCompilationErrorsException: startup failed:
Script1.groovy: 1: unexpected char: ” @ line 1, column 2.
{rtf1ansiansicpg1252cocoartf2513

I have added a Jenkinsfile.Jenkinsfile and Example.groovy script in my repo with this code ->
Jenkinsfile.Jenkinsfile (note the .Jenkinsfile extension is hidden in the repo)
node {
// Git checkout before load source the file
checkout scm

// To know files are checked out or not
sh ”’
ls -lhrt
”’

def rootDir = pwd()
println(“Current Directory: ” + rootDir)

// point to exact source file
def example = load “${rootDir}/Example.Groovy”

example.exampleMethod()
example.otherExampleMethod()

}
Example.groovy (Note the .groovy extension is hidden in repo)
import hudson.slaves.EnvironmentVariablesNodeProperty
import hudson.EnvVars
import jenkins.model.*
jenkins = Jenkins.instance

EnvironmentVariablesNodeProperty prop = jenkins.getGlobalNodeProperties().get(EnvironmentVariablesNodeProperty.class)
EnvVars env = prop.getEnvVars()

def MY_VAR = env[‘MY_JENKINS_VAR’]
def exampleMethod() {
println(“exampleMethod”)
}

def otherExampleMethod() {
println(“otherExampleMethod”)
}
return this

Test Guild – Automation Testing Tools Community
What is ETL Testing Tutorial Guide
ETL stands for Extraction, Transformation, and Load (ETL). How do you test it? This guide covers what you need to know to get started.
You’re reading What is ETL Testing Tutorial Guide, originally posted on Test Guild – Automation Testing Tools Community – and copyrighted by Joe Colantonio