Libraries & Frameworks

XPath extractor response assertion passed first run but in second run it is getting failed because <name>pc</name> is not coming in API. How to skip this element if it is not coming in second run without failing response assertion or any suggestions for this?

API response first run:

API response in second run: missing element < name > pc < /name >

Response assertion – DB values(name_1)using jdbc request match with xml element(name) in API response

I am trying to get the value displayed against the Total using the below code:

driver.get(“https://www.cricbuzz.com/live-cricket-scorecard/20137/sl-vs-eng-4th-odi-england-tour-of-sri-lanka-2018”);

String textextras = driver.findElement(By.cssSelector(“div[class=’cb-col cb-col-100 cb-ltst-wgt-hdr’]”)).findElement(By.cssSelector(“div:nth-last-child(3) div:nth-child(2)”)).getText();
System.out.println(textextras);

String textsum = driver.findElement(By.cssSelector(“div[class=’cb-col cb-col-100 cb-ltst-wgt-hdr’]”)).findElement(By.cssSelector(“div:nth-last-child(2) div:nth-child(2)”)).getText();
System.out.println(textsum);

Output:

19 Batsman R B 4s 6s SR

Can anyone please help me why it is not working for textsum, but it is working fine for textextras variable ?

I want to add today’s count. I am new to selenium, and am not getting how to add using selenium. Can anyone suggest a solution?

This is my code:

package testpk;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

import java.awt.List;

import org.openqa.selenium.*;

public class Form {

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

// declaration and instantiation of objects/variables

WebDriver driver = new FirefoxDriver();

driver.manage().window().maximize();
driver.get(“http://beta-app.1bridge.in/#/auth/login”);
Thread.sleep(6000);

driver.findElement(By.xpath(“//input[@type=’text’]”)).sendKeys(“RB0764”,Keys.ENTER);
Thread.sleep(3000);
driver.findElement(By.xpath(“//input[@type=’password’]”)).sendKeys(“kanna123”,Keys.ENTER);

Thread.sleep(7000);
driver.findElement(By.xpath(“//*[@data-id=’dashboard’]”)).click();
Thread.sleep(5000);
WebElement table = driver.findElement(By.xpath(“//*[@id=”pcoded”]/div[2]/div/div/div/div/div/div/app-default/div/app-modal-basic/div/div/div/div/div/div/table/tbody/tr[1]/td[1]/p”));

List listOfRows = (List) table.findElements(By.tagName(“tr”));

System.out.println(“Rows: “+listOfRows.size());

//List<WebElement> listOfCols = listOfRows.get(0).findElements(By.tagName(“td”)); //If first row is normal row

List<WebElement> listOfCols = ((WebDriver) listOfRows).get(0).findElements(By.tagName(“th”)); //If first row is header row

System.out.println(“Columns: “+listOfCols.size());
}
}

I have to use multiple URLs in same script in Selenium (Java) and have to visit one at a time, perform some operations on the page take a screenshot at the end, and then move one to the next page and repeat the same steps. Is this task doable with Selenium? I know it can be done through loops otherwise but can I do it with Selenium?
P.S. I’m a beginner in Selenium and I have searched the internet thoroughly before posting the question without finding a solution.

I am writing a program that must screen some charts, the issue is that I do not know how much time a graph expends to load, it could be seconds or minutes.
How can I make an appropriate wait, that only continues executing whenever the chart is fully loaded?
I have thought about waiting for the load event, but I am not sure how to approach that.

Read about our Tx’s suite of accelerators – covering digital assurance, automation, data analytics, and security – provides businesses with a powerful toolkit to navigate this journey
The post Digital Frameworks to Propel Your Digital Transformation Journey  first appeared on TestingXperts.

Artificial Intelligence (AI) has transformed how we live, work, and interact with technology. From virtual assistants to advanced robotics, AI is all about speed, logic, and efficiency. Yet, one thing it lacks is the ability to connect emotionally. Enter Artificial Empathy—a groundbreaking idea that teaches machines to understand human emotions and respond in ways that
The post Artificial Empathy vs Artificial Intelligence appeared first on Codoid.

Problem : I used to view/analyze Appium server Console logs during any test cases execution. But the problem is Appium server console always Auto scroll to top which result hiding latest logs. I have to manually scroll to down to see the latest log.

How should I manage to make Console log show latest logs and always scroll to down like eclipse console. I am looking for permanent solution.

Appium Windows 1.4.16.1

Refer screen shot (hide some workspace and apk details using pen)

Here I’m assigning CSV file on the basis of loop count so that done by using __iterationNum() JMeter custom function (custom JMeter Function plugin added to JMeter) But this stuff is not working for me so I used this function like this:

> D:dataslatandlongIndiaAddressaddress${__iterationNum}.cs‌v FilePath name in CSV dataset config but not getting a result is there any other way to use this function I don’t know about that.

So how to use this function if anybody having an idea please tell me.

Added same execution script on master and slave
Change the property file of master by adding slave IP address and uncommenting
uncomment this on property file: server.rmi.create=false
Run server file on slave command prompt
: jmeter-server -Djava.rmi.server.hostname=”SlaveIP”
Run on Master command prompt
: jmeter -n -t F:jmeter3.3apache-jmeter-3.3binHubdataposting_Test.jmx -l
F:jmeter3.3apache-jmeter-3.3binoutput.jtl -R “slaveIP” –
Djava.rmi.server.hostname=”MasterIP”
Communication get established, output file get created but it create as empty file.

When tried running individually on both servers like master and slave, it works as expected and creates output file as a result.
but when tried with master-slave execution it gives an empty output file

I am automating my windows application. My applications are sports related reporter software. In baseball reporter application i will do testing by the following way : I do enter the commentary from mlb site and check the results while I enter the commentaries are correct.

Here I am automating this process. But actual issue is I can automate only particular match only. I am trying to find a solution for one single script can automate the entire matches. My senior who suggested me to take an excel contain a match commentary details , player names, umpires names and write the script for entire code.

My friend who suggested me : you need to follow data driven approach for this

Create a generic script that gets the actual values from the
application..
Place all the expected values in an excel sheet.
Compare the actual and expected.
For every game u can change the values in the excel sheet. with this u can have one script automating all the games.

Still I’m unable to start writing the code. Can anyone help me on this?

I am trying to automate UI for a site designed in Angular and when I inspect the browser (Chrome) with UISpy.exe, I find that certain controls do not exist in the tree at all, even though I can see them in the browser.

In certain cases, multiple fields (e.g. Transaction Date, Delivery Date, their labels, text and icons) exist as one control on the UI tree.

Here is an example of controls that seem to exist as a single control in the UI tree

I used Developer tools to extract HTML for this and here it is.

<div class=”input-daterange form-group right-inner-addon” ng-class=”{‘has-error’: submitted &amp;&amp; requisitionForm.transactionDate.$invalid}”>
<label for=”transactionDate” class=”ng-binding”>Transaction Date<span class=”asterisk_input”> </span></label>
<input date-picker=”” type=”text” id=”transactionDate” today=”” class=”form-control date-picker input-lg ng-isolate-scope hasMultiCalendarPicker ng-valid ng-valid-required ng-valid-valid-date-format ng-dirty” name=”transactionDate” ng-model=”requisition.transactionDate” aria-label=”Transaction Date” aria-required=”true” required=”” autocomplete=”off” placeholder=”MM/DD/YYYY” title=”Press F9 to open the calendar”><span class=”calendar-icon calendar-img”></span>
</div>

However the UI tree in UISpy shows just a single control on the UI tree.

How can I automate and access individual items on the screen, e.g. Transaction Date Label, the value for Transaction date only etc..?

Website: https://myir.ird.govt.nz/eservices/home/?link=RWTEXREG
I’m attempting to download this file. It looks like the request is handled server side so there isn’t any download link per se.
I’ve tried a bunch of things, including:
result = driver.find_element_by_xpath(“//span[contains(@class,’CaptionLinkText’)]”).text

But I really feel like I’m out of my element (no pun intended) with this.

I have a JMeter script in which I’m extracting value from the response of first request via Regular Expression Extractor and sending it in the second request.

This mechanism works fine 80 percent of times but fails for the remaining 20 percent! When it fails the value passed in the second request displays as “NOT FOUND” in the ‘View Results Tree’ Request Body section. Although, the preceding first request gave the response in the exact expected manner.

I am currently working on integrating Cypress e2e tests in our existing CI/CD pipeline (I’m not an automation engineer but a developer). Our application is a fintech app which involves the typical process of registering a new business, and after the business has been registered, to go through the process of requesting a credit with it.
So far we only have a few e2e tests for registering the business, which are fine. And then we are creating a few e2e tests for the business credit request flow. But then, we want to create other tests that comprises the whole flow of creating a business + requesting a credit. However I’m just wondering what is the best way to reuse the code from the tests where the business is created instead of repeating the code in the new tests.
Just wondering what is the most elegant way to do it, either if Cypress itself offers some sort of functionality to reuse that, or just encapsulate the test code in utility functions that can be called from several tests.

I have imported all web3J library and using tried using java_version 16,17 and 20. Every time I am facing issue. When I compiled that script in VSCode. I am facing the same issue. Can someone please help me with groovy script?
import org.web3j.protocol.Web3j
import org.web3j.protocol.core.DefaultBlockParameterName
import org.web3j.protocol.http.HttpService
import org.web3j.tx.RawTransactionManager
import org.web3j.tx.Transfer
import org.web3j.utils.Convert
import org.web3j.protocol.core.methods.response.TransactionReceipt
import org.web3j.crypto.Credentials

def web3 = Web3j.build(new HttpService(“API_URL”))
String PRIVATE_KEY = ‘b33ccb143751577968f32575ee690eb3873e49f27935708dbdea52fe36b6ba76’
RawTransactionManager rawTransactionManager = new RawTransactionManager(web3, Credentials.create(PRIVATE_KEY))
Transfer transfer = new Transfer(web3, rawTransactionManager)
println “transfer: ${transfer}”

TransactionReceipt receipt = transfer.sendFunds(“0x7de3280c66ecee8f4cbd8fb78850229d8f10d22f”, (Convert.toWei(“1”, Convert.Unit.ETHER).toBigInteger()), Convert.Unit.WEI, 30000, 1000000108).send()

println(“Transaction Hash: ${receipt.transactionHash}”)
println(“Block Hash: ${receipt.blockHash}”)
println(“Block Number: ${receipt.blockNumber}”)
println(“Gas Used: ${receipt.gasUsed}”)
println(“Contract Address: ${receipt.contractAddress}”)