Selenium problems

I have been using Selenium a lot lately (testing ExtJs applications), and in many ways this is great, there are three things that cause me a lot of grief:

  • You cannot directly click items other than buttons. This made me write a bunch of robot code to move the mouse. It works, but a little fragile, plus, if you touch the mouse during the test, you are screwed. I tried the Selenium forums to find out if there is a better way and haven’t gone anywhere. I think (but not sure) that this is a fundamental limitation of the Selenium JS injection technique.

  • Inability in many cases to control what the attribute 'id' gets in . This happens inside ExtJs, and some elements allow you to set it, and some do not, and some only with an attribute in which you do not expect it. In some cases, you will have to use XPath. Using XPath with ExtJs is pretty awful, because ExtJs creates massive levels of nested DIVs. Sometimes you can also use CSS locators (which are also not amenable to control in ExtJs). (By the way, this is obviously not Selene's problem as such).

  • The time it takes Selenium to run FF is too long ... longer than a typical human FF run, about 2 seconds per test, which leads to tests that take too long in the last few minutes.

I looked briefly at Watij, BadBoy, and a couple of other web applications for functional testing, but none of them looked almost as good as Selenium. (The way Selenium tests can be written in Java, and running through jUnit is really, really nice). There are also several commercial alternatives, but they exceed my budget and there is no certainty that they will work better anyway.

Any thoughts or suggestions appreciated.

+3
source share
6 answers

My thoughts:

  • There are several cases where it’s clicknot enough, but you, of course, should not be limited to buttons. You might want to experiment with your locators.

  • id ? ExtJS, , . -, ExtJS, Selenium. XPath contains, starts-with substring . CSS , .

  • amarsuperstar, Firefox . , browserSessionReuse, . Selenium Grid .

, API WebDriver, Selenium 2. Firefox , , click, .

+3

3: Selenium firefox . , Selenium , , . Startup Firefox '-p' Selenium , . .

: Firefox/Windows:% APPDATA%\Mozilla\Firefox\

+4

, , , . Seleium ( -), , . localhost: 6554, .

script, → p > endinate, .

+2

(, ;)

  • , ExtJS. ExtJS 3.x. , - , ?

: , mousedown/mouseup "click"

  1. CSS (selenium CSS 3). , xpath xpath=id('myid')//div['@class='foo'] ( ).

  2. . , ?

+2

, . , :

  • ExtJS . , "id", , , 2-3-4 DOM , . , -, . Se-ExtJs, . , . , , . ExtJs, , , DIV .

  • , , " ", , , XPath. , , , - , .

!

0

Selenium TestPlan, .

  • . . , , Selenium , .

  • We base everything on XPath, so after a while you just get used to it. There are all kinds of shortcut syntax that you can use in XPath, which can help. However, in TestPlan scripts, you can also use the variable extension in XPaths, which simplifies their support.

  • TestPlan caches browser sessions whenever possible, and is not requested otherwise. This makes the speed a little easier, but only so, because in any case you usually want a new session for each test.

Testplan

0
source

Source: https://habr.com/ru/post/1725168/


All Articles