Development

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.

Do you subscribe to Piccalilli? You should. If you’re reading that name for the first time, that would be none…

A look behind the ChainGPT Labs, ChainGPT’s new venture capital and incubator for the next generation of web3 startups. Designed…