selenium

How to get the value of an element in Python + Selenium?

你说的曾经没有我的故事 提交于 2021-02-07 03:01:22
问题 I have got this HTML element in my Python (3.6.3) code (as Selenium webelement of course): <span class="ocenaCzastkowa masterTooltip" style="color:#000000;" alt="Kod: pd1<br/>Opis: praca domowa<br/>Waga: 2,00<br/>Data: 12.09.2017<br/>Nauczyciel: (NAME CENSORED)">5</span> and I want to get the value at the end (which is 5 in this case) and I have got no idea how to get it. obviously I can't use webelement.get_attribute() cause I don't know the name of the attribute. 回答1: Try the following code

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

How do I send a DELETE keystroke to a text field using Selenium with Python?

倾然丶 夕夏残阳落幕 提交于 2021-02-06 15:19:15
问题 How do I send a Keys.DELETE keystroke to a text field with the Selenium web tester? I'm trying to simulate the user typing in a field and then deleting what they typed to test the interactive autosuggestion feature. It should filter the list to items beginning with their query, then show all the possible suggestions again when they delete their query. Unfortunatley sending a .clear() doesn't work to un-filter the list again. Neither does send_keys('\127'). def get_suggestions(): driver.get(

C# Code Coverage with Selenium

和自甴很熟 提交于 2021-02-06 12:12:09
问题 Does anyone know of a way to create Code Coverage reports for C#/.NET projects tested via Selenium? 回答1: I was able to find the following article "Code Coverage of ASP.NET Applications on IIS" from the folks at NCover, not free, which supports IIS instrumentation and code coverage. This would enable you to run Selenium and gather coverage results. That ASP.NET applications are fairly difficult to test may be the understatement of the century. In this article, we’re going to show you how to

C# Code Coverage with Selenium

主宰稳场 提交于 2021-02-06 12:11:30
问题 Does anyone know of a way to create Code Coverage reports for C#/.NET projects tested via Selenium? 回答1: I was able to find the following article "Code Coverage of ASP.NET Applications on IIS" from the folks at NCover, not free, which supports IIS instrumentation and code coverage. This would enable you to run Selenium and gather coverage results. That ASP.NET applications are fairly difficult to test may be the understatement of the century. In this article, we’re going to show you how to

selenium change language browser chrome / firefox

前提是你 提交于 2021-02-06 11:53:50
问题 I'm trying to test my website with selenium but I don't manage to change the language of the browser. I tried with firefox, changing the profile also but it's not working. That's a pity because many of my content is changing regarding the language. Here is my python code : @classmethod def setUpClass(cls): super(SeleniumTestCase, cls).setUpClass() options = Options() options.add_argument('--lang=en') cls.selenium = WebDriver(chrome_options=options) So normally I change the language but

selenium change language browser chrome / firefox

随声附和 提交于 2021-02-06 11:52:36
问题 I'm trying to test my website with selenium but I don't manage to change the language of the browser. I tried with firefox, changing the profile also but it's not working. That's a pity because many of my content is changing regarding the language. Here is my python code : @classmethod def setUpClass(cls): super(SeleniumTestCase, cls).setUpClass() options = Options() options.add_argument('--lang=en') cls.selenium = WebDriver(chrome_options=options) So normally I change the language but

selenium change language browser chrome / firefox

孤街醉人 提交于 2021-02-06 11:52:24
问题 I'm trying to test my website with selenium but I don't manage to change the language of the browser. I tried with firefox, changing the profile also but it's not working. That's a pity because many of my content is changing regarding the language. Here is my python code : @classmethod def setUpClass(cls): super(SeleniumTestCase, cls).setUpClass() options = Options() options.add_argument('--lang=en') cls.selenium = WebDriver(chrome_options=options) So normally I change the language but

selenium change language browser chrome / firefox

北城以北 提交于 2021-02-06 11:52:14
问题 I'm trying to test my website with selenium but I don't manage to change the language of the browser. I tried with firefox, changing the profile also but it's not working. That's a pity because many of my content is changing regarding the language. Here is my python code : @classmethod def setUpClass(cls): super(SeleniumTestCase, cls).setUpClass() options = Options() options.add_argument('--lang=en') cls.selenium = WebDriver(chrome_options=options) So normally I change the language but