# I want to test many attempted failed login

**URL:** <https://forum.robotframework.org/t/i-want-to-test-many-attempted-failed-login/4781>\
**Category:** Robot Framework\
**Created:** [4 October 2022 11:26 UTC](https://forum.robotframework.org/t/i-want-to-test-many-attempted-failed-login/4781 "2022-10-04T11:26:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yebubu](https://avatars.discourse-cdn.com/v4/letter/y/e79b87/32.png) [@yebubu](https://forum.robotframework.org/u/yebubu)\
**Post date:** [4 October 2022 11:26 UTC](https://forum.robotframework.org/t/i-want-to-test-many-attempted-failed-login/4781/1 "2022-10-04T11:26:57Z")

</div>

I will like to have this command run as much as 10 times . the problem is that after the first line of code runs it fails since its an invalid username and password(which is what I want), but i will like to test what happens when someone tries entering the fake credentials at least 10 times

```python
${result}= Run special command -k --url https://${url} auth login ${username} -p${password}

```

---

<div class="post-metadata">

**Author:** ![rasjani](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@rasjani](https://forum.robotframework.org/u/rasjani)\
**Post date:** [4 October 2022 11:55 UTC](https://forum.robotframework.org/t/i-want-to-test-many-attempted-failed-login/4781/2 "2022-10-04T11:55:23Z")

</div>

Maybe `Run Keyword And Expect Error`

[https://robotframework.org/robotframework/latest/libraries/BuiltIn.html#Run%20Keyword%20And%20Expect%20Error](https://robotframework.org/robotframework/latest/libraries/BuiltIn.html#Run%20Keyword%20And%20Expect%20Error)

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [4 October 2022 22:22 UTC](https://forum.robotframework.org/t/i-want-to-test-many-attempted-failed-login/4781/3 "2022-10-04T22:22:10Z")

</div>

Hi @yebubu,

I think [Wait Until Keyword Succeeds](https://robotframework.org/robotframework/latest/libraries/BuiltIn.html#Wait%20Until%20Keyword%20Succeeds) is just what you want?

This keyword will retry your `Run special command` until it passes or the retry is exceeded. You can set the time between retries and you can set the number of retries by time or number of times, in your case `10x` will retry up to 10 times.

Hope this helps,

Dave.

---

<div class="post-metadata">

**Author:** ![\_daryl](https://avatars.discourse-cdn.com/v4/letter/_/45deac/32.png) [@\_daryl](https://forum.robotframework.org/u/_daryl)\
**Post date:** [5 October 2022 15:45 UTC](https://forum.robotframework.org/t/i-want-to-test-many-attempted-failed-login/4781/4 "2022-10-05T15:45:37Z")

</div>

[Wait Until Keyword Succeeds], Keyword And Expect Error as mentioned is a solid approach

Just to throw something else out there, you could also take the approach of writing a Date Driven Test as another possibly approach, for example:

> **[Data Driven Testing in Robot Framework | ThinkPalm](https://thinkpalm.com/blogs/data-driven-testing-robot-framework/)**
>
> Data Driven Testing in Robot Framework
