webdriver

How to manage failed tests in JUnit5

孤街醉人 提交于 2021-02-07 09:54:38
问题 I'm migrating to JUnit5 and I'd like to know if there is an easy way in JUnit5 to know when a test failed or not, just like we had in JUnit4 with TestWatcher. I did some research and found similar, but open questions, like this one: https://github.com/junit-team/junit5/issues/542 Since most of them are quite old, I'm asking just in case there is a recent solution. The idea is to be able to do a screenshot or add some message into my log. So, is there a listener or extension or something that

Ruby : Watir : How to avoid closing browser from Net::ReadTimeout?

淺唱寂寞╮ 提交于 2021-02-07 08:55:19
问题 I am making an automation program using Watir , that reads links from a file links.txt and then open one by one on chrome browser. When it takes to much time to open then browser and its on loading time it shows me the Net::ReadTimeout . I have tried to rescue and and if its not rescued go to the next link from the list. I have tried this one but when max_retries = 3 it shows again the error. I want to make browser to wait for specific amount of time and then if it is still loading close the

Should Page Objects Return Page Objects?

半城伤御伤魂 提交于 2021-02-07 08:15:51
问题 We're currently working on building up a good test frame in our company. It's for a medium-to-large-sized webapp, perhaps with a couple dozen pages. We're currently writing mostly WebDriver Selenium UI-based tests. We are trying to decide on some coding standards, and one thing we're discussing is whether to use Page Objects (PO) that always return PO (even if the page is the same), only return PO when you leave the current page for a new one, or even to not return PO. I've always thought

Should Page Objects Return Page Objects?

二次信任 提交于 2021-02-07 08:05:30
问题 We're currently working on building up a good test frame in our company. It's for a medium-to-large-sized webapp, perhaps with a couple dozen pages. We're currently writing mostly WebDriver Selenium UI-based tests. We are trying to decide on some coding standards, and one thing we're discussing is whether to use Page Objects (PO) that always return PO (even if the page is the same), only return PO when you leave the current page for a new one, or even to not return PO. I've always thought

Should Page Objects Return Page Objects?

爱⌒轻易说出口 提交于 2021-02-07 08:03:02
问题 We're currently working on building up a good test frame in our company. It's for a medium-to-large-sized webapp, perhaps with a couple dozen pages. We're currently writing mostly WebDriver Selenium UI-based tests. We are trying to decide on some coding standards, and one thing we're discussing is whether to use Page Objects (PO) that always return PO (even if the page is the same), only return PO when you leave the current page for a new one, or even to not return PO. I've always thought

cucumber re-run failed scenarios automatically with a tag?

大城市里の小女人 提交于 2021-02-06 15:29:49
问题 In our build there are certain scenarios that fail for reasons which are out of our control or take too long to debug properly. Things such asynchronous javascript etc. Anyway the point is sometimes they work sometimes they don't, so I was thinking it would be nice to add a tag to a scenario such as @rerun_on_failure or @retry which would retry the scenarion X number of times before failing the build. I understand this is not an ideal solution, but the test is still valuable and we would like

cucumber re-run failed scenarios automatically with a tag?

泄露秘密 提交于 2021-02-06 15:26:11
问题 In our build there are certain scenarios that fail for reasons which are out of our control or take too long to debug properly. Things such asynchronous javascript etc. Anyway the point is sometimes they work sometimes they don't, so I was thinking it would be nice to add a tag to a scenario such as @rerun_on_failure or @retry which would retry the scenarion X number of times before failing the build. I understand this is not an ideal solution, but the test is still valuable and we would like

ChromeDriver does not exist in Selenium WebDriver C# test script

怎甘沉沦 提交于 2021-02-05 18:00:55
问题 I have come across a few people with the same issue that seemed to have solved the problem with System.addProperty("webdriver.chrome.driver", ".../chromedriver.exe"); before instantiating the driver. I have had little luck with this and am still getting the error that the file .../bin/Debug/chromedriver.exe does not exist. Has anyone had any luck getting this to run without putting it in the bin folder? Example code: System.Environment.SetEnvironmentVariable("webdriver.chrome.driver", @"c:

ChromeDriver does not exist in Selenium WebDriver C# test script

纵然是瞬间 提交于 2021-02-05 17:51:08
问题 I have come across a few people with the same issue that seemed to have solved the problem with System.addProperty("webdriver.chrome.driver", ".../chromedriver.exe"); before instantiating the driver. I have had little luck with this and am still getting the error that the file .../bin/Debug/chromedriver.exe does not exist. Has anyone had any luck getting this to run without putting it in the bin folder? Example code: System.Environment.SetEnvironmentVariable("webdriver.chrome.driver", @"c:

Python Selenium - How can I click on the third last element from a group of elements in a table?

半世苍凉 提交于 2021-02-05 12:18:29
问题 Good day everyone, Can someone explain to me how I cant get the number of elements in a table? I am running through multiple tables that all have different lengths and I always need the 3rd last item. I have the xpath of the table that contains those . Using Selenium's Python API - How do I get the number of rows in a table? I found this answer and some other answers that seem to answer my question, but to be honest: At this point I just dont understand how to implement this into my code. I