You can also use regular selenium bindings to test AngularJS applications. You would need to use Explicit Waits to wait for elements to appear, disappear, title/url to change etc - for any actions that would let you continue with testing the page.
Example (waiting for textarea
element to appear):
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
wait = WebDriverWait(driver, 10)
wait.until(EC.visibility_of_element_located((By.TAG_NAME, "myaccount")))
There is one important thing that pytractor
(as protractor
itself) provides - it knows when AngularJS
is settled and ready - models are updated, there are no outstanding async requests etc. It doesn't mean you have to use it to test AngularJS
applications, but it gives you an advantage.
Additionally, pytractor
provides you with new locators, e.g. you can find an element by model or binding. It also doesn't mean you cannot find the same element using other location techniques which regular selenium python provides out-of-the-box.
Note that pytractor
is not actively developed and maintained at the moment.