Pregunta

I have to test content of webpages . My mentor says to use selenium . I looked up and found it is tool used for testing and thought that 'll do .I tried Selenium IDE and found it repeat our action in web browser. But couldn't understand how to use it as tester.

ToDo : Search of some string in HTML source code of webpage and if they are there in source code then consider the page as ok.

How to do it ? : I have links and source code of webpages and can do string searching in it. Do i need to do it using selenium ? if yes , how ?

Please bear with me if that sound as silly question . I am noob to selenium .

PS : I have to do that in Java.

¿Fue útil?

Solución

I also recommend http://code.google.com/p/selenium/wiki/GettingStarted

For your tests try following the Arrange, Act, Assert model. This helped make my tests a bit easier to setup.

Arrange the page to your required test state. You could use past tests to do this eg Login, GoToMenuItem, GoToSecondMenuItem.

Act by finding the text you want to find and perform an operation on the website. If you don't need to perform an operation then you don't really need to worry about this step.

Assert by checking the text element still exists on the page. You could use findElement(By.locater)

If you are using Java you could try using JUnit as it makes tests easier to organise. Here is some information on using JUnit with Selenium http://www.codeproject.com/Articles/143430/Test-your-web-application-s-UI-with-JUnit-and-Sele

Otros consejos

I'm sure this page will help you get started with selenium. http://code.google.com/p/selenium/wiki/GettingStarted

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top