Robot framework and modal

1,249 views
Skip to first unread message

Yogini Upadhye

unread,
Jul 20, 2017, 4:48:41 PM7/20/17
to robotframework-users
I am facing issue while interacting with elements inside the modal. I have tried


Wait Until Element Is Visible    <locator> but no luck.


Starting test: Asap.ASAPSuites.AddNewReceipt
20170720 19:23:36.314 :  INFO : Opening browser 'Google Chrome' to base url 'https://jupiter.valueaddsofttech.com:3000/login/'
20170720 19:23:57.946 :  INFO : Slept 10 seconds
20170720 19:24:04.121 :  INFO : Slept 5 seconds
20170720 19:24:04.121 :  INFO : Typing text 'man...@classicview.com' into text field 'id=email'
20170720 19:24:04.311 :  INFO : Typing text 'goldfish' into text field 'id=password'
20170720 19:24:06.432 :  INFO : Slept 2 seconds
20170720 19:24:06.432 :  INFO : Clicking button 'css=.inputbutton.ladda-button'.
20170720 19:24:08.523 :  INFO : Slept 2 seconds
20170720 19:24:13.526 :  INFO : Slept 5 seconds
20170720 19:24:13.526 :  INFO : Clicking link 'id=receipts'.
20170720 19:24:18.648 :  INFO : Slept 5 seconds
20170720 19:24:18.648 :  INFO : Clicking link 'id=newReceipt'.
20170720 19:24:28.755 :  INFO : Slept 10 seconds
20170720 19:24:49.106 :  INFO : </td></tr><tr><td colspan="3"><a href="selenium-screenshot-1.png"><img src="selenium-screenshot-1.png" width="800px"></a>
20170720 19:24:49.106 :  FAIL : Element locator 'html/body/div[9]/div/div/ng-include/div[2]/div/form/div/ng-include/div/div/div/div[1]' did not match any elements after 20 seconds
Ending test:   Asap.ASAPSuites.AddNewReceipt


Can someone help please?

Alex Payne

unread,
Jul 20, 2017, 4:57:22 PM7/20/17
to robotframework-users
The locator you are using has many index references and has much of the page hierarchy.

Pick the id or class of the modal element and build an XPath locator based on that.

For example

//*[contains(@class, "<modal class>")]
or
//*[@id="<modal id>"]

Also, you put your password in plain text so you should consider if that is what you wanted to do.
Reply all
Reply to author
Forward
0 new messages