Skip to main content
added 39 characters in body
Source Link

My answer is not directly to your question. It is advice. You should not use try catch for logic realization. Program languages (Java, c#, python etc) have if ... else statements. And you can use them for your problem.

not debugged code, simply for example

if(slogin.passwordField1.Existed)
{ 
return slogin.passwordField1;
} else 
{
return slogin.passwordField2;
}
if(slogin.passwordField1.Existed)
{ 
  return slogin.passwordField1;
} 
else 
{
  return slogin.passwordField2;
}

You can find how realize existed property in Internet (it is easy) and you will levelup you developer skills

My answer is not directly to your question. It is advice. You should not use try catch for logic realization. Program languages (Java, c#, python etc) have if ... else statements. And you can use them for your problem.

not debugged code, simply for example

if(slogin.passwordField1.Existed)
{ 
return slogin.passwordField1;
} else 
{
return slogin.passwordField2;
}

You can find how realize existed property in Internet (it is easy) and you will levelup you developer skills

My answer is not directly to your question. It is advice. You should not use try catch for logic realization. Program languages (Java, c#, python etc) have if ... else statements. And you can use them for your problem.

not debugged code, simply for example

if(slogin.passwordField1.Existed)
{ 
  return slogin.passwordField1;
} 
else 
{
  return slogin.passwordField2;
}

You can find how realize existed property in Internet (it is easy) and you will levelup you developer skills

Source Link

My answer is not directly to your question. It is advice. You should not use try catch for logic realization. Program languages (Java, c#, python etc) have if ... else statements. And you can use them for your problem.

not debugged code, simply for example

if(slogin.passwordField1.Existed)
{ 
return slogin.passwordField1;
} else 
{
return slogin.passwordField2;
}

You can find how realize existed property in Internet (it is easy) and you will levelup you developer skills