Hi,
I was wondering if somebody could help me with my test design in relation to a navigation bar which is on every page. Basically on our website which I am going to be running through automation, I'd like to creat some generic functionality to navigate around the site by passing through the link text to click on. So far I have tried using record and play ( please bear in mind that I have come from a fully coded automation system prior to test studio ) but found that the element repository will become very bloated if I have to add an element per navigation link under every single page, especially as the users of the site are able to dynamically create there own pages with navigation links. If you see the attached image "NavigationBar.jpg", this is the navigation bar which displays on every page in it's most basic default form.
The best way I have come up with so far is to create a coded step as follows:
I feel this would keep the functionality re-usable. To test it I removes the productNavLinkToClick argument and created a local data table with one cell/column which contained "hotel" replacing the HtmlFindExpression with Data[0].ToString() so I know the code itself works, but I am struggling to make it re-usable by the QA Manual testers who are not code literate. I was hoping either for them to be able to just drag and drop my coded step and add the value of productNavLinkToClick themselves, or for me to intelligentally work out what page I am on and need to get to and call into this coded step accordingly.
I would be grateful if you could let me know if I am on the right track for a maintenance free navigation test or whether there is some better design? I would be happy to tweak what I have done if required.
Please let me know if you require any further information
Many Thanks
Shane
I was wondering if somebody could help me with my test design in relation to a navigation bar which is on every page. Basically on our website which I am going to be running through automation, I'd like to creat some generic functionality to navigate around the site by passing through the link text to click on. So far I have tried using record and play ( please bear in mind that I have come from a fully coded automation system prior to test studio ) but found that the element repository will become very bloated if I have to add an element per navigation link under every single page, especially as the users of the site are able to dynamically create there own pages with navigation links. If you see the attached image "NavigationBar.jpg", this is the navigation bar which displays on every page in it's most basic default form.
The best way I have come up with so far is to create a coded step as follows:
[CodedStep(@
"Clicks one of the Search tabs"
)]
public
void
Click_Product_Search_Tab(
string
productNavLinkToClick )
{
HtmlFindExpression expression =
new
HtmlFindExpression(
"tagname=a"
,
"id=?searchLink"
,
"textcontent="
+ productNavLinkToClick );
Element eLink =
new
Element( expression, Find, ActiveBrowser );
eLink.Wait.ForExists( 30000 );
HtmlAnchor hotelNavLink =
new
HtmlAnchor( eLink );
if
( hotelNavLink !=
null
)
hotelNavLink.Click();
Assert.IsNull( hotelNavLink );
}
I feel this would keep the functionality re-usable. To test it I removes the productNavLinkToClick argument and created a local data table with one cell/column which contained "hotel" replacing the HtmlFindExpression with Data[0].ToString() so I know the code itself works, but I am struggling to make it re-usable by the QA Manual testers who are not code literate. I was hoping either for them to be able to just drag and drop my coded step and add the value of productNavLinkToClick themselves, or for me to intelligentally work out what page I am on and need to get to and call into this coded step accordingly.
I would be grateful if you could let me know if I am on the right track for a maintenance free navigation test or whether there is some better design? I would be happy to tweak what I have done if required.
Please let me know if you require any further information
Many Thanks
Shane