Hi Sir, await myElement.selectOption(testData.type) --> input value await myElement.click() -> submit o/p : getting output value with type name Please let me know how to validate(compare) input value is equal to the output value
Great videos! Got a simple question. I noticed that sometimes a semi-colon is included at the end of sentence but sometimes its not. I believe they are ignored as they didn't cause any error. Is there a reason to include them, or not? Thanks.
Semicolons are an essential part of JavaScript code. They are read and used by the compiler to distinguish between separate statements so that statements do not leak into other parts of the code. The good news is that JavaScript includes an automatic semicolon feature. Due to this feature, sometimes one can go without adding the semicolon in the end.
To handle toggle switches with Playwright in C#: 1.Identify the toggle switch using a selector. 2.Check its state, which could be based on: - A CSS class (e.g., 'active'). - An attribute (e.g., 'checked' for checkboxes). - Textual content (e.g., "ON" or "OFF").
@@LambdaTest thanks for the reply Sir. The funny thing is the element doesnt have any of such attribute. It has background-color: rgb(255, 255, 255), thinking to use that, any idea how to capture it using C#?
Hey Sandeep, You're welcome! If the element has a CSS style with background-color: rgb(255, 255, 255), you can capture this in C# using Selenium. Here's how: // Assuming you have initialized your WebDriver as 'driver' IWebElement element = driver.FindElement(By.YourSelector("your-element-selector")); string backgroundColor = element.GetCssValue("background-color"); The backgroundColor variable will now hold the value rgb(255, 255, 255). Ensure you replace By.YourSelector("your-element-selector") with the appropriate method to locate your element (e.g., By.Id, By.ClassName, etc.). Let us know if this helps
Hey Dhananjay There are a number of extension you can use. Please refer to the blog to choose from the list www.lambdatest.com/blog/chrome-extensions-to-find-xpath-in-selenium