Open Navitimex opened 1 year ago
From what you're describing, it sounds like you don't even need an if
statement and you should be able to achieve this without using any JavaScript code:
- description: Verify that the Submit button exists
action: org.getopentest.selenium.AssertElementVisible
args:
locator: { xpath: "//input[@id='edit-submit']" }
- description: Insert username
action: org.getopentest.selenium.SendKeys
args:
locator: { id: edit-name }
text: automation
If the Submit button doesn't exist, the test will fail at the AssertElementVisible
action and never execute the SendKeys
action. Let me know if this did the trick.
I have tried to create an if but have not succeeded. If I write a simple condition like (3>4) it does the steps. But the condition I want is that if something is visible to perform another action, if it is not visible break the test case. I am planning to create a delete test case so I need to check that it exists before I can delete it.
// I have tried many ways, but I can't succeed.