New answers tagged

-1

//define method public void WaitFindAndClick(IWebDriver parent, By by, int counter) { bool Displayed = false; for (int v = 0; v < counter; counter++) { try { Thread.Sleep(2000); WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10)); ...


1

In many cases slenium does not get the element eventhough it is present. script works some times and fails as well. This code works when actaul element is present but selenium is not find it. I have create a loop for given count ant it returns true. public static bool waitTillElementisDisplayed(IWebDriver driver, By by, int timeoutInSeconds) { ...


1

What you could do, is try to use an existing profile in the browser, so that way it would actually save the cookies somewhere. Otherwise the webdriver starts up an anonymous profile every time that doesn't save the cookies, it just throws them away when the browser is disposed of. This is mentioned in this SO Answer to Selenium Webdriver not respecting ...


-1

Try the below code to download a file using Selenium C# with autoit using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using OpenQA.Selenium.Firefox; using OpenQA.Selenium; using OpenQA.Selenium.Support; using OpenQA.Selenium.Interactions; using NUnit.Framework; using OpenQA.Selenium.IE; using ...


1

I have been using this line of code when I first create my browser instance [Given(@"I have opened an IE browser")] public void GivenIHaveOpenedAnIEBrowser() { Ie = new InternetExplorerDriver(); Ie.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromMilliseconds(FiveSeconds)); } it's actually the second line in this method, I have a couple of ...


2

To translate your protractor script use the same css selector: int searchResCount = driver.findElements(By.CssSelector("#resultsRepeaterGrid tr[class="row"], tr[class="altrow"]")).Count;


0

Or an xpath that matches your method's solution could be made such as //div[contains(@class, 'col-md-12')]//li (substituting div for whatever the actual tag name is). – Julian Cleary Thanks!


0

A possible solution for this issue could be to find the label control containing the value you are looking to select, then find the child control (which should be the radio button) then selecting the radio button. String labelToFind = "Senior"; BrowserWindow browser = BrowserWindow.Launch(@"pathToHTMLFile"); HtmlLabel theLabelToFind = ...


1

I just want to add some clarity to the confusion in the first part of the question, as I don't think this will be the answer to it. I totally understand the first confusion about test frameworks. The problem is, the phrase test framework is used for almost different purpose products and is overloaded. You can easily create your own basic test framework (...


2

The idea is that most of what you will end up writing has already been written and packaged up into a framework. It will provide the infrastructure to group, tag and set run order. It can groups tests into suites. It will provide output and feedback in useful ways that can be customized. It will help handle the setup, execute, teardown steps. It can help ...


4

No, technically you do not need a unit-testing framework. You could just execute Selenium steps from a C# program and write the results somewhere for you to monitor, but we use them as a runner of the tests. Since this gives standardized results which can be parsed by a continuous integration server to give you nice feedback. I would really advise to use a ...



Top 50 recent answers are included