-2

I'm doing some UI automation testing at work and I'm not quite sure how to do this

I have a form that asks for a user's name and date of birth before they can click a button to the next page. If they enter anything with invalid characters (a name of '1111' or a DOB in the future) the input boxes are highlighted in red and an error message appears. How can I test that the 'continue' button is clickable only once valid input is entered?

gchan
  • 27
  • 2
  • 9
  • 1
    It depends on the implementation. Show the HTML code of the button when it is clickable and when it is not. – alecxe Sep 11 '14 at 23:38
  • IWebElement has several methods available including enabled and displayed. If the button is being disabled like this: Then IWebElement will be able to tell you. – Brantley Blanchard Sep 12 '14 at 22:10

2 Answers2

-1

Actually, in my project, there are many many "type-of-button".

It can be an input-tage , span-tag or even image!

So in my opinion, you can't verify that button can be clickable.

You should verify what system does after you click on this button for example: page is loaded, image is uploaded...

Hope it helpful :)

-1

First scenario : Username: Valid Password: Valid

button is displayed

use the driver.FindElement(By.Id("id/xpath of the button ")).Displayed returns true (C# code ) for java there is similar display

else you enter the invalid scenario

button is not displayed

the above code would give false

Hope this clears your doubt