I'm using ur site as a scenario (http://www.telerik.com/automated-testing-tools.aspx)
IF (Test Studio Link isVisible) Then
Login
Else
Search site
The test failed because it was unable to locate the element. Question is what if the element that i'll be using for our application is not located in the other page it will fail. Is there a way to bypass this? that if the Test Studio Link(unique element) is does not exist go automatically to Else?
Thanks
10 Answers, 1 is accepted
If I understand correctly your use case, you don't want your test to fail if the element doesn't exist. If that is correct you need to change the verification in the IF statement to "Verify Exists" instead of "Verify is Visible". Please check this video. Note that I intentionally changed the Find Settings for the Test Studio link, so that it cannot be found.
Now, if I check for the element visibility I'm getting "Unable to locate Element" exception, but if I change this to Verify Exists it will go to the Else statement and the test will pass.
Hope this helps!
All the best,
Plamen
the Telerik team
I came across this same issue, and was attempting to use your solution of a "Verify Exists" step instead of "Verify is Visible" step, but it doesn't look like that verification option is available anymore. Now you just have "IsVisible", "Content", "Attributes", "Style", "IsEnabled", and "Image".
Has the "Verify Exists" option been removed? Or is there an alternate way to invoke it?
Thanks,
Joey
I ended up using an "If ( wait for element exists )", which seems like it does the same thing as the Verify Exists that Plamen mentioned, but waits a specified amount of time before deciding if the object exists / doesn't exist.
Thank you for contacting us.
Verify exists is not removed from Test Studio. You can add this step either by changing the role of the WaitForExists step or through the Step Builder.
However WaitForExists step is more reliable in some cases so I recommend to use this step as you did.
If you need further assistance please let us know.
Regards,
Boyan Boev
Telerik
Thanks!
--Joey
I am happy I could help.
If you need further assistance please let us know.
Regards,
Boyan Boev
Telerik
Hello Kris,
Thank you for contacting us.
It seems to me that the verification step waits for the full timeout, when you have a successful login. This is expected, because the error message is missing.
I am not sure what is causing the additional execution time. Please share the Test Studio project for me to analyze and I will try to advise you further. If you are not comfortable with sharing your working project, you can record a sample test against www.telerik.com and send that one over.
Please check the one that I attached and analyze its configurations and steps. I did change the "ExpectedString" to make the verification fail and wait for the full timeout.
I am looking forward to hearing from you.
Regards,
Plamen Mitrev
Progress Telerik
Hello Kris,
I assume that you have made some changes to the Execution Timeouts and especially to the "Wait on Elements" setting. Please keep in mind that this is a global configuration and will be applied to all test steps against elements.
I am glad to know that you found a way to speed up the test execution for your test scenario. Please do not hesitate to contact us again, if you need any help.
Regards,
Plamen Mitrev
Progress Telerik