Tag Info

New answers tagged

0

Please check if this link helps. It links to various posts on how to handle modal dialogs with selenium webDriver.


0

Putting a sleep in a selenium test is generally not the best solution. Selenium has keywords to wait for some condition on a page, such as wait for condition, wait until element is visible, wait until page contains, and wait until page contains element. These are preferable, since the wait will usually be as short as possible. With a fixed-time wait, you may ...


0

Following code should be added to robot selenium2 library in order to use this keyword: Wait For | timeout def wait_for(self, timeout): timeout = robot.utils.timestr_to_secs(timeout) maxtime = time.time() + timeout while True: if time.time() > maxtime: break time.sleep(0.2)


0

From the code it looks that you are not initializing the WebDriver correctly. You declared a private member of WebDriver and never used it. In your SetUp method do the following change. public void setUp(){ System.setProperty("webdriver.chrome.driver", "/Applications/chromedriver"); driver = new ChromeDriver(); ...


0

public static void WaitForData (IWebDriver driver) { var dt1 = DateTime.Now; var diff = 0; while (diff < 3) { var dt2 = DateTime.Now; var ts = dt2.Subtract(dt1); diff = (int) ts.TotalSeconds; } }


0

For a quick and dirty method that will be fragile and perform poorly, but will allow you to get your test working, open the page in Firefox, open the development tools, find the element in the source viewer, right click, and there should be an option to create an XPath query. Just noticed the "contains" in the question, if that's important then ignore ...


1

There's an open issue on Selenium's bug tracker for this problem: https://code.google.com/p/selenium/issues/detail?id=8302 It seems a recent Windows security update broke the IEWebDriver. The good news is that today's round of Windows patches includes a fix (though one user reports that it still does not work for headless mode).


1

I'm using something like this with selenium webdriver and firefox so I'm constrained to XPath 1.0 features: xpath("//input[starts-with(@id, 'foo_') and ends-with(@id, '_bar')]") That should in theory catch any id that looks like these that starts-with foo_ and ends-with _bar: <input id="foo_1_bar"/> <input id="foo_2_bar"/> <input ...


1

I have the same issue and have yet to find an answer. As a workaround you can use a loop and: searchBox.SendKeys(Keys.Backspace);


0

You may have to switch to childWindow to do operation on the same. driver.switchTo().window(Childwindow); you will have to use driver switch to. You can switch between windows as below: //Store the current window handle String winHandleBefore = driver.getWindowHandle(); //Perform the click operation that opens new window //Switch to new window opened ...


0

First of all, you don't want the xpath to do a lot of works. So, be little bit more considerate when you the write xpath You don't need to walk down the whole hierarchy to find the element with xpath. Relative xpath would be enough for selenium. Read this //tbody//td[contains(text(),'1-2-3')]


0

Check my reply to this question on how to loop through all values in a dropdown list. That's C# code but you'll get the idea.



Top 50 recent answers are included