4 Answers, 1 is accepted
Hi Simon,
Blazor can be successfully automated with both Selenium WebDriver and Telerik Test Studio.
Test Studio provides some useful abstractions of Blazor components that can make it much easier for testing.
If you decide to use WebDriver you may want to implement such abstractions by yourself.
Once you have those abstractions you can reuse them in any project you have.
Regards,
Dimitar
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Hi Dimitar thanks for the response.
The issue for me is I am not able to convince my company to purchase the Test Studio due to the very uncertain times we find ourselves in at the moment. So I am trying to automate the testing without Studio, however I don't understand how I can access the grid inside a test. I can get the currently visible data on the page by treating the grid just like an html table like this:
[Fact]
public
void
SearchGridForText()
{
Driver.Navigate()
.GoToUrl(HotfixHistoryUrl);
var gridContainer = Wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementExists(By.Id(
"hotfixGridContainer"
)));
Assert.NotNull(gridContainer);
var rows = gridContainer.FindElements(By.TagName(
"tr"
));
Assert.NotEmpty(rows);
foreach
(var row
in
rows)
{
_testOutputHelper.WriteLine(row.Text);
}
}
This way does not give me access to the grid component nor the whole dataset. What I would really like is to create end-to-end testing to validate the grid is loading data, filters and search are working properly etc
So I guess my question is can I do this with the WebDriver or do I need the Test Studio?
Hope that all makes sense, thanks for your time
Simon
Telerik's Blazor components provide productivity for developers.
In the same way, TestStudio provides productivity for people who develop test automation.
All the abstractions that TestStudio provide can be implemented in WebDriver, there are no technical limitations.
Here is an example of how you can access grid cells:
gridContainer.FindElement(By.CssSelector(".k-master-row:nth-of-type(3) td:nth-of-type(3)"))
This will return the cell on the 3rd row and 3rd column.
Another example of how you can find the number of items in the grid:
gridContainer.FindElement(By.CssSelector(".k-pager-info")).Text
It will return the text of the pager's info element.
Regards,
Dimitar
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Hello all,
Since you expressed interest in testing with Selenium, you may find interesting this request: https://feedback.telerik.com/blazor/1513117-translators-for-selenium-testing-for-the-telerik-ui-for-blazor-components. If so, Vote for it and Follow it so we can know there is interest, and so you can get status updates.
Regards,
Marin Bratanov
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.