Libraries & Frameworks

i have written this code in which i am able to get the Shadow element. package org.example; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; public class Main { public static void main(String[] args) { System.out.println(“Hello and welcome!”); System.setProperty(“webdriver.chrome.driver”, “chromedriver.exe”); WebDriver driver= new ChromeDriver(); driver.get(“https://shop.mercedes-benz.com/en-au/shop/vehicle/srp/demo”); JavascriptExecutor jse = (JavascriptExecutor) driver; WebElement agreeBtn= (WebElement) jse.executeScript(“return document.querySelector(‘cmm-cookie-banner’).shadowRoot.querySelector(‘div’).querySelector(‘div’).querySelector(‘cmm-buttons-wrapper’).querySelector(‘wb7-button:nth-of-type(2) ‘).shadowRoot.querySelector(‘button.button’)”); ((JavascriptExecutor)driver).executeScript(“arguments[0].click();”, agreeBtn); } } the below is the output when i run this program:Nov 05, 2024 10:03:15 PM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch WARNING: Unable to find an exact match for CDP version 130, returning the closest version; found: 129; Please update to a Selenium version that supports CDP version 130 Exception in thread “main” org.openqa.selenium.JavascriptException: javascript error: Cannot read properties of null (reading ‘shadowRoot’) (Session info: chrome=130.0.6723.92) Build info: version: ‘4.25.0’, revision: ‘030fcf7918’ System info: os.name: ‘Windows 11’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘17.0.8’ Driver info: org.openqa.selenium.chrome.ChromeDriver Command: [647d6b65e33549f28a4ea4e137e0a4f5, executeScript {script=return document.querySelector(‘cmm-cookie-banner’).shadowRoot.querySelector(‘div’).querySelector(‘div’).querySelector(‘cmm-buttons-wrapper’).querySelector(‘wb7-button:nth-of-type(2) ‘).shadowRoot.querySelector(‘button.button’), args=[]}] Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 130.0.6723.92, chrome: {chromedriverVersion: 129.0.6668.9 (ab04602ab643c…, userDataDir: C:UsersusAppDataLocalT…}, fedcm:accounts: true, goog:chromeOptions: {debuggerAddress: localhost:54013}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: windows, proxy: Proxy(), se:cdp: ws://localhost:54013/devtoo…, se:cdpVersion: 130.0.6723.92, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true} Session ID: 647d6b65e33549f28a4ea4e137e0a4f5 at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480) at org.openqa.selenium.remote.ErrorCodec.decode(ErrorCodec.java:167) at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:138) at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:50) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:190) at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:216) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:174) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:545) at org.openqa.selenium.remote.RemoteWebDriver.executeScript(RemoteWebDriver.java:476) at org.example.Main.main(Main.java:20)
Process finished with exit code 1 Also, when i check for the dom element into browser, i am able to locate.: PFA the image as well. Can you please advise how can i resolve this? I am really in need to solve this. I will be obliged of your help. Thanks

In today’s gaming world, giving players a great experience is very important. Game testing is a key part of making sure video games are high quality and work well. It helps find and fix bugs, glitches, and performance issues. The goal is to ensure players have a fun and smooth time. This article looks at
The post Overcoming Challenges in Game Testing appeared first on Codoid.

If you have ever had a need to implement search into your application you’ve probably heard of Apache Solr. Solr…

The blog discusses how cloud-managed services offer a strategic solution for businesses aiming to streamline IT processes, enhance security, and reduce costs. These services, managed by third-party providers, provide cost savings, cybersecurity, disaster recovery, and scalability. Essential best practices, including phased cloud migration and efficient cost management, help maximize the benefits.
The post Why Businesses Should Shift to Cloud Managed Services   first appeared on TestingXperts.

In today’s quick software development world, it is important to keep apps high quality. A key part of this is software testing. Tosca automation is a strong tool that helps with this task. This blog, titled “Tosca Automation Tutorial: Model-Based Approach,” will cover the main points about Tosca. We will look into its new model-based
The post Tosca Automation Tutorial: Model-Based Approach appeared first on Codoid.

I have below code and it will dynamically inject optionName to a xpath.
And try to click on it.
getSortOptionByName(optionName: string) {
return $(`//android.widget.Button[@content-desc=”${optionName}”]`);
}

Below is the full code.
public async selectingEachSortOption(): Promise<void>
{
const sortOptions = await this.getAllTheAvailableSortOptions();
for(const sortItem of sortOptions){

await (await this.getSortOptionByName(sortItem)).waitForDisplayed({ timeout: 5000 });
await (await this.getSortOptionByName(sortItem)).waitForEnabled({ timeout: 5000 });
await (await this.getSortOptionByName(sortItem)).click();
this.clickOnSortByDropDown();
}
}

When I use this code in my test, It will iterate through the 1st loop.(I have 4 loops)
But at the 2nd loop, it will end with no errors and the test will mark as pass.
What are the possible mistakes I’m doing here?

Data breaches can cost organizations millions in direct damages, lost business and legal fees. But beyond those immediate costs, breaches damage trust, leading to long-term revenue losses. An effective SaaS application security testing mitigates these risks, increasing the bottom line. Read to know more!
The post From Compliance to Competitive Advantage: How SaaS Application Security Testing Boosts Market Position  first appeared on TestingXperts.

OpenID Connect support to the PHP League’s OAuth2 Server. Compatible with Laravel Passport. Source: Read More 

Bento is an Email Marketing & Automation Platform for Startups and their team recently created an official Laravel SDK. If…

Welcome to the November edition of the Laravel Roundup. This covers recent highlights, community events, Laravel jobs, and more! Recent…

> #shadow-root (open)
> …
> …
> …
> …

Mercedes-Benz Australia/Pacific Pty Ltd uses cookies for various purposesWe, Mercedes-Benz Australia/Pacific Pty Ltd and Mercedes-Benz AG, do this so that we can make our webpages more user-friendly, continuously improve them, and show offers and advertisements that are suited to you. We work with selected partners (including Google, Facebook and Salesforce) to show you user-based content and advertising on this website and other websites. In addition, we share the data collected on the website with other Mercedes-Benz AG Group companies (i.e., Mercedes-AMG GmbH) and Mercedes-Benz Mobility AG, so that they can improve their own offers and show you advertising tailored to you.
You can revoke your consent at any time. To manage your preferences and consents or for further information (including data transmissions) please refer to our Cookie Policy and our Privacy Policy.Important: If you have already provided Mercedes-Benz Australia/Pacific Pty Ltd (MBAuP) with personally identifiable information, by clicking “Agree to all” you consent to MBAuP combining the personally identifiable information that MBAuP already possesses with your browsing activity including on non MBAuP websites.Cookie Policy – Manage Preferences
Agree to all
Privacy Policy

Select allTechnically requiredRequired web technologies and cookies make our website technically accessible to and usable for you. This applies to fundamental base functionalities such as navigation on the website, correct display in your internet browser or requesting your consent. Without these web technologies and cookies our website does not work.Usercentrics Consent Management Platform | AUAkamai | AUAmazon Web Services | AUGoogle Tag Manager | AUMercedes Me LoginContent-Management-SystemVehicle Accident ManagementDigital Service Drive PaymentDatadog Real User Monitoring | AUMercedes-Benz StoreVan Online ConfiguratorAkamai Bot Manager | AUAnalysis and statisticsWe are constantly improving the user-friendliness and performance of our websites. For this reason, we use analysis technologies (including cookies) which pseudonymously measure and evaluate which functions and content of our websites are used, how, and how often. On this basis we can improve our websites for users and only display the content of interest to the average user.Google Analytics | AUQualtrics | AUA/B-TestingContext DataMarketingWe use web technologies (also cookies) from selected partners in order to be able to show you content and advertising specially tailored to you on websites and social media sites. This content is selected and displayed on the basis of your usage behaviour to you across websites.YouTube Video | AUTradeDesk | AUPersonalization ComponentMeta Pixel | AUWhisbi | AUGoogle Marketing Products | AUGoogle Analytics Advertising | AUConversions APISalesforce Marketing Cloud Personalisation | AUUse also by certain Mercedes-Benz companies*We also pass on the data collected on the basis of your consent to *Mercedes-AMG GmbH and Mercedes-Benz Mobility AG, which in turn use it for the purposes accepted by you above.Mercedes-Benz Data-SharingHide DetailsSave settingsAgree to all