-2

I have an android app. in which verification for Login can only be done using the email-element's "focusable" attribute which changes from 'false' to 'true' on login.

I am using webdriver for automation and want to verify the email-element's focusable attribute so that I can verify login functionality .

Ex: if(abc.getAttribute('focusable')=='true') // verify login success else // login fail

But the above condition never works i.e. the script does not enter the if block due to which else block gets executed .

I am new to Android app and not sure if focusable can be used like above .

Pls help!!!

Mandy
  • 433
  • 2
  • 8
  • 25

1 Answers1

0

If I had the HTML I might be able to provide a better answer but a couple things I noticed...

Since this is Java, your conditional won't work. It should be

if(abc.getAttribute("focusable").equals("true"))

You can't use == with Strings. Read this for more info.

Also you are using single quotes (') instead of double quotes (") around Strings. Java won't like that. Single quotes are for char.

Community
  • 1
  • 1
JeffC
  • 22,180
  • 5
  • 32
  • 55