4

Get the text and add to a array Convert array to set and compare the size Set will have only unique elements (Removes the duplicates) So if length of set and array are different , it means there where duplicate entries in the array. var arr = [55, 44, 65, 55]; var set = new Set(arr); console.log(set.size === arr.length); set.forEach(x => {console.log(x)});...


3

You won't get blank data as its a IWebElement type list. If you meant that when you try to get text it returns empty for few elements then use: elm = elm.Where(x => !string.IsNullOrEmpty(x.Text)).ToList(); You will get elements for which Text is not Null or empty: Reference: https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.where?view=...


3

You should get the CSS value instead of attribute.Below sample code will print the background colour before and after click WebElement.getCssValue("cssproperty") will return respective css property of the element WebElement body=driver.findElement(By.tagName("body")); WebElement button=driver.findElement(By.id("slide"));...


1

Check if you have correct sheet name. As you can see in stacktrace, error happens in ExcelUtil line 27. Debug/Print the sheet name to see if the value is correct.


1

I think you should click day picker next month arrow 1st, then only your element (Previous Month arrow ) will come and appear in the DOM After that you can verify that element present or not now your are checking not display and not present element in current DOM that's why it is throwing unable to find Such element


1

As per https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium/interactions/Actions.html Actions.clickAndHold(element) Clicks (without releasing) in the middle of the given element. This is equivalent to: Actions.moveToElement(onElement).clickAndHold() Actions.moveToElement() Moves the mouse to the middle of the element. The element is ...


1

driver.get().findElement(By.xpath("//div[@id='example_paginate']/span/a["+outerIndex+"]")).click(); Here when the page-load you are in index tab one already After the first iteration, you are again clicking the same tab as outerIndex is still 1 so it counts page one content twice So for fix, just keep the click action at the start ...


1

While I don't recommend this approach as it does not conform to F.I.R.S.T. (Fast, Isolated/Independent, Repeatable, Self-validating, Thorough) you can accomplish a reusable session by not tearing down after each test. It differs slightly depending on the Test Runner you are using MSTest/VSTest, NUnit, XUnit but are largely the same. For NUnit you would use [...


1

I found the solution to this myself. For anyone who's having the same issue: What I did wrong was I used driver = new ChromeDriver(options); in my code instead of driver = new RemoteWebDriver(new URL("http://my.aws.ip:4444/wd/hub"), options); After making this change, I downloaded selenium-server-standalone.jar to in EC2. Then, before starting the ...


1

if html code is <div value="your expected text"> try: element.getAttribute("value") if html code is <div>your expected text<div> try element.gettext(); or element.getAttribute("innerHTML"); I met one fail case by gettext() but it worked by getAttribute("innerHTML") div is just a tag name used for ...


1

At our company we had about 1000 selenium tests. We ran the tests for every push (as part of a CI process), and what we did to make the tests stable is to simply run the failing tests again, and then again. If after 3 times the same test failed, the build would fail too.


Only top voted, non community-wiki answers of a minimum length are eligible