Development

I want to compare my data in CSV with the web content. The data in CSV file comprises of multiple rows and column. How can I verify that the data inputted on the web is correct comparing it with the CSV using Jmeter?

There is a search bar on the website I write any character I get the location of particular dealers along with the details and I have data in CSV and now I want to compare the data entered on the web is correct or not

EDIT: the data on the web is called through AJAX.

For single web element in that row i got index..for multiple column in a single row how to get the index:

IWebElement colelement = driver.FindElement(By.XPath(“//div[@id=’grdBooking’]//table//tr/
th[contains(text(),’Case#’)]”));
String colidx = colelement.GetAttribute(“idx”);
Console.WriteLine(“Colelement index is =” + colidx);

I have a Website were I want to click a button, but I can’t find in the button in the HTML script, what I have to write in my Python script?
Later I want to have something like

driver.find_element_by_css_selector()

Now I don’t know what I have to put in there

<div class=”custom-col” onclick=”Ajax(‘routes.php’,’main’);mainMenuLoad(‘mainMenuRoutes’);” style=”width: 20%;”>
<img src=”assets/img/icons/route-icon-shade.png” class=”btn-action” id=”mainMenuRoutes” style=”height:40px;”>
</div>

I hope you understood my question because I am not a native speaker

When I hover over login text there are list of links, i need to select Infostore using Page Object model approach. I am new to Selenium could any one help. I have the outer HTML for you:

<div class=”desktop-login”>
LOGIN
<ul class=”no-bullet list-nav-child sub-menu-lv”>
<li class=”nav-child-item”>
<a href=”https://infostore.saiglobal.com/”>Infostore</a>
</li>
</ul>
</div>

How to fetch text for

<h1 _ngcontent-gtj-c13=””> Site-2
<span _ngcontent-gtj-c13=”” class=”seprator”>|</span>
Building-1 <!—-> </h1>

I have used attribute innerhtml,value,outerhtml,javascript
Not able to fetch site name with building name

getting text= Site-2 |
expected = Site-2 | Building-1

Folksm I’m using TestNG 7.5 and Selenium 4.2.2, with IntelliJ and Java 11.
I’ve got all my bits imported and my tests will run individually, but I’m trying to get my setup and cleanup methods to work with the before and after annotations. Here’s a code sample:
public static class RunTest {
WebDriver driver;
WaitUtils waitUtils;
Actions actions;
StateUtils stateUtils;

public RunTest(WebDriver givenDriver){
this.driver = givenDriver;
this.actions = new Actions(givenDriver);
this.waitUtils = new WaitUtils(givenDriver);
this.stateUtils = new StateUtils(givenDriver);
}

@BeforeMethod(alwaysRun = true)
public void login(){
System.out.println(“test_++++++++++++”);
boolean firstLoginPageFound = true;

driver.navigate().to(“http://www.amazon.ca”);
InteractionUtils interactionUtils = new InteractionUtils(driver);
try{
interactionUtils.clickOnElementByXpath(“//div[@class=’nav-bb-right’]/a[text()=’Your Account’]”);
} catch (NoSuchElementException e){
firstLoginPageFound = false;
}

interactionUtils.clickOnElementByXpath(“//span[@id=’nav-link-accountList-nav-line-1′]”);

byte[] decodedBytes = Base64.getDecoder().decode(“”);

waitUtils.waitForVisibilityOfLocator(“//input[@id=’ap_email’]”).sendKeys(new String(decodedBytes));

interactionUtils.clickOnElementByXpath(“//input[@id=’continue’]”);

decodedBytes = Base64.getDecoder().decode(“”);
waitUtils.waitForVisibilityOfLocator(“//input[@id=’ap_password’]”).sendKeys(new String(decodedBytes));

interactionUtils.clickOnElementByXpath(“//input[@id=’signInSubmit’]”);
}

@Test
public void checkLandingPage(){
System.out.println(“REST++++++++++++”);
Assert.assertTrue(stateUtils.verifyElementIsVisible(“//div[@id=’nav-xshop’]//a[contains(@class, ‘nav-a’) and text()=’Buy Again’]”), “Buy again button is missing”);
}

@AfterMethod(alwaysRun = true)
public void cleanUp(){
System.out.println(“BEST++++++++++++”);
driver.close();
}
}

If I run something like:
RunTest test = new RunTest(new SetUpUtils().getDriver());
test.checkLandingPage();

the checkLandingPage method will run, and fail, but the login and cleanup methods won’t run. I’ve tried a few variations on the annotations, but no luck so far.
The imports used are :
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.interactions.Interaction;
import org.openqa.selenium.support.ui.*;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import java.time.Duration;
import java.util.Base64;