Answer the question
In order to leave comments, you need to log in
How to test data on a web page?
The SPA application is written in AngularJs 1.4
Depending on what data comes from the server, certain directives, blocks and data are displayed on the page.
Simulating data from the server is not a problem, but how to check that exactly those directives, blocks and data are displayed on the page?
Answer the question
In order to leave comments, you need to log in
Is the display of data on the page dependent on JavaScript?
If not, then take the source code (HTML) of the page, any HTML parser and go.
If it depends, then take Selenium, open the desired page, take the DOM from it and check the data.
Just an example in Ruby.
There is a page /page on which some data should be (prepared on the server "Simulate data from the server"), for example text foo
.
require 'selenium-webdriver'
driver = Selenium::WebDriver.for :phantomjs
driver.get '/page'
selector = 'div[class="data"] > span[id="foo"]'
element = driver.first selector
puts 'foo' == element.text
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question