Libraries & Frameworks

Streamlined integration of OpenAI’s ChatGPT (GPT-3.5, GPT-4) into Laravel applications. Source: Read More 

Dead-simple way to load CSS or JS assets only once per page, when using Laravel 10+. Source: Read More 

I have an application. Different web services gets called when any action is performed. Let me explain my scenario:
When I update a value in application, it also gets updated in LPS system. The LPS is updated by using web-services. If we received success in web-service_receive then it means value is successfully updated in LPS.
I want to check whether I get success or not whenever a web-service gets called.

In database, a new record gets inserted every time a web-service is called. One with webservice_receive and one with webservice_sent.
Is there any way to automate this scenario. Screenshot of database table is attached.

I am new to Selenium, currently am working on selenium webdriver. I want to select a value from the drop-down. But I am not able to do it because of some error. Also, I want to inform you that in my automator viewer I have not found any id of the dropdown element hence I am using with XPath but I am not able to do please guide me. My java code is below:

@Test
public void print() throws Exception

{

WebDriverWait wait = new WebDriverWait(driver, 60);// 1 minute
wait.until(ExpectedConditions.visibilityOfElementLocated(By.className(“android.widget.Button”)));

driver.findElementByClassName(“android.widget.EditText”).sendKeys(“1234567890”);
driver.hideKeyboard();

Select drpCountry = new Select(driver.findElement(By.xpath(“//android.widget.ImageView[@index=’2′]”)));

drpCountry.selectByVisibleText(“+91(IN)”);
drpCountry.selectByIndex(8);

driver.findElementByClassName(“android.widget.Button”).click();
}

I am trying to run an automated test in appium, what happens is that the app does get launched however fails to perform any action. Please see error below:

An unknown server-side error occurred while processing the command. Original error: ‘POST /element’ cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed). Check the server log and/or the logcat output for more details.

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 driver null.
Can someone point out what I am doing wrong?
Class A :
@Listeners(CustomListener.class)
public class AjoutPanier {
public WebDriver driver;

@BeforeTest
public void LaunchWebsite() {
// Launch Chrome
System.setProperty(“webdriver.chrome.driver”, “C:\chromedriver.exe”);
driver = new ChromeDriver();
// Acces Website
driver.get(“https://pileouface.07zr.lu/fr/home/”);
driver.manage().window().maximize();
Reporter.log(FormatMessageSucces + ” Chrome is Opened</font>”);
}…..}

Class B :
public class CustomListener extends AjoutPanier implements ITestListener{

@Override
public void onTestFailure(ITestResult result) {
// TODO Auto-generated method stub
System.out.println(“TestFailure acces”);
File file = ((TakesScreenshot)b.driver).getScreenshotAs(OutputType.FILE);
File ScreenshotName = new File(“.//ScreenShots//test.png”);
System.out.println(“Files done”);
try {
System.out.println(“try”);
FileUtils.copyFile(file, ScreenshotName);
} catch (IOException e) {
// TODO Auto-generated catch block
System.out.println(“catch”);
e.printStackTrace();
}
Reporter.log(“</br><img src='”+ ScreenshotName +”‘/>”);
System.out.println(“*******Screenshot captured********”);
}
}

Our app uses Masonry grid layout. After page_A opens, the tiles keep moving for a second or two.
The test case is: open the page_A and click on the button which opens page_B.
While clicking the button I get either element click intercepted exception or nothing happens. Which I assume the button gets clicked but no event has fired, because it is too soon, maybe not all the functions have finished loading.
I tried explicit waits with
ExpectedConditions.presenceOfElementLocated and
ExpectedConditions.elementToBeClickable but I get results mentioned above.
How to solve this without Thread.sleep?
Preferably I would like to not use the second loading page_B (check the URL or elements on page_B) as a criteria since it is a slow loading page and it has other problems.
Is there a way to know if the click was “successful”? Like if it has fired an onClick action, or started a function (I am not very good at JS).

There is a requirement to performance test the Desktop Based Application and servers are physical servers.
Server hardware configuration is processor: Dual Core Processor and RAM: 4GB.
The requirement is to run with below 50Vusers.
No one will log into the Performance Environment.

How to record this Desktop Based Application?
Which is the best tool to do performance testing?
Which protocol supports Desktop Applications?

Earlier we used LoadRunner Tool which uses the RDP protocol. A LoadRunner license is expensive, and I’m currently searching for any open-source tools.
Could anyone please help me

Generative AI in Software Testing is changing how we do quality assurance. This new technology is revolutionizing software testing, with powerful capabilities in creating test cases, automating documentation, and predicting bugs. As the software industry keeps evolving quickly, GenAI in Software Testing has become a game-changer. It helps QA teams deliver higher-quality software faster than…
The post Generative AI in Software Testing [with Practical Examples] appeared first on Software Testing Material.

I am trying to launch my application in IE browser in selenium using TestNG framework. But, after the IE browser is launched, the Eclipse console shows an error that “Only Local Connection are allowed”.

My IE browser is set to zoom 100%, the Protected mode is set as expected. I am executing the script on Windows 10 64 Bit. Selenium version is 3.0.1 and IEDriverServer.exe is 64-bit as well.

How to identify this button in C#:

<button class=”reward_link_redeem_button_style” onclick=”RedeemRPProduct(‘free_points_1’)”>REDEEM</button>
<button class=”reward_link_redeem_button_style ” onclick=”RedeemRPProduct(‘free_points_50’)”>REDEEM</button>

But there are like 4 buttons called equal, and to differentiate them you need the (‘free_points_1’) as well as (‘free_points_10’), etc.

As per the below code, I navigate to a specified URL and select the values in the from and to field.
The xpaths mentioned in the 3rd and 4th line, each returns 2 instances.
In the third line, findElement selected the first instance.
But in the fourth line, the findElement method selected the second instance.
As per my understanding, findElement method will always select the first instance.

So, is there any specific xpath logic which caused it to select the second instance or what is the difference between 4th and 5th line in this context ?

Below is the code:

driver.get(“https://www.spicejet.com”);
driver.findElement(By.xpath(“//input[@id=’ctl00_mainContent_ddl_originStation1_CTXT’]”)).click();
driver.findElement(By.xpath(“//a[@value=’GOI’]”)).click();
driver.findElement(By.xpath(“//a[@value=’DEL’]”)).click();
driver.findElement(By.xpath(“(//a[@value=’DEL’])[2]”)).click();

Appreciate your help on this.

I just want it to past the first page by selecting “1” from the dropdown menu and clicking on “Weiter” but I couldn’t even get it to find the menu so I tried to make it send the data directly to the server and jump to the next page where the appointments should be then showned. But I am getting the message “Access denied to this page (403)” from Microsoft Edge… What should I do? I have actually no idea of what I am doing… I’ve been using ChatGPT to help me with the code. Thanks!
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.edge.service import Service
from selenium.webdriver.edge.options import Options
import time
Path to the Microsoft Edge WebDriver
webdriver_path = “C:UsersthejaDesktopBotmsedgedriver.exe”
URL of the website
url = “https://stadt.muenchen.de/terminvereinbarung_/terminvereinbarung_abh.html?cts=1000113”
Set up the Edge WebDriver with a custom User-Agent
options = Options()
options.headless = False # Run in normal mode to see the browser
options.add_argument(“user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36”)
service = Service(webdriver_path)
driver = webdriver.Edge(service=service, options=options)
try:
# Open the website
driver.get(url)
# Wait for the page to load completely
wait = WebDriverWait(driver, 20) # Increased wait time
wait.until(EC.presence_of_element_located((By.TAG_NAME, “body”)))

# Execute JavaScript to submit the form
script = “””
var form = document.createElement(‘form’);
form.method = ‘POST’;
form.action = ‘https://stadt.muenchen.de/terminvereinbarung_/terminvereinbarung_abh.html?cts=1000113’;

var token = document.createElement(‘input’);
token.type = ‘hidden’;
token.name = ‘FRM_CASETYPES_token’;
token.value = ‘397017935ccff9a3e347532ef2898855’;
form.appendChild(token);

var step = document.createElement(‘input’);
step.type = ‘hidden’;
step.name = ‘step’;
step.value = ‘WEB_APPOINT_SEARCH_BY_CASETYPES’;
form.appendChild(step);

var caseType = document.createElement(‘input’);
caseType.type = ‘hidden’;
caseType.name = ‘CASETYPES[Notfalltermin UA 35]’;
caseType.value = ‘1’;
form.appendChild(caseType);

document.body.appendChild(form);
form.submit();
“””
driver.execute_script(script)

# Wait for the next page to load
wait.until(EC.presence_of_element_located((By.TAG_NAME, “body”)))

# Keep the browser open for further actions
print(“Browser will remain open. Press Ctrl+C to exit.”)
while True:
time.sleep(1)

except Exception as e:
print(f”An error occurred: {e}”)
driver.save_screenshot(“error_screenshot.png”) # Save a screenshot of the error
Do not close the browser, keep it open for further actions

We use different profiles to test different features of our system. If we open new multiple FF sessions (each with it’s own profile), Selenium Webdriver only uses 1 window handle identifier.

(pseudo code below)

WebDriver driver1 = new FirefoxDriver(Profile1);

WebDriver driver2 = new FirefoxDriver(Profile2);

WebDriver driver3 = new FirefoxDriver(Profile3);

String h1 = driver1.getWindowHandle();

String h2 = driver3.getWindowHandle();

String h3 = driver3.getWindowHandle();

EVERY ONE of the window handles will be identical, even though these were new sessions with unique profiles. (That is, h1 == h2 == h3 )

Am I missing something here? I would have thought that the handles would be unique for each window?

-Dennis

I run a test script where in a pop up window a confirmation needs to be clicked:
css=#mod-fap-search-overview-confirmDialogButton2 > div

Unfortunately, this pop up is not always displayed hence I want Selenium IDE to continue and not wait for it to click it.
What is the trick on doing so ?