Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switching to a dialog and selecting a button for a customized form #24

Closed
sujaybarooah opened this issue Sep 19, 2017 · 4 comments
Closed

Comments

@sujaybarooah
Copy link

I was trying to extend the tests for a customized form. In my case, before saving a form, a dialog might pop-up in certain conditions. Does the API provide any option to switch to the dialog and accept/ reject the dialog?
Please see the attached screenshots.

dom
screenshot

@dtu11
Copy link
Member

dtu11 commented Sep 19, 2017

Since it looks like the dialog is not within an iFrame, the existing SwitchToDialogFrame will not work. I would add an explicit wait to look for the dialog. Here is a example you can try. You may have to adjust the logic a little but it will wait for 2 seconds and if the dialog becomes visible then it will click the "Ok" button.

xrmBrowser.Driver.WaitUntilVisible(By.XPath("id("alertJs-dialog")"),
new TimeSpan(0, 0, 2),
x => { x.FindElement(By.XPath("id("alertJs-tdDialogFooter")/button[1]")).Click(); });

@dtu11
Copy link
Member

dtu11 commented Sep 24, 2017

Let me know if that worked for you and I will close the issue.

Thanks

@sujaybarooah
Copy link
Author

Hi, thank you for the reply. I followed your suggestion and used WaitUntilVisible. However, it seems the control does not go to the dialog box. The system interacts with UI elements in the background, and closes the entity form after the wait times and the dialog remains hanging. Please see the attachment.

testcase

ScriptExecutionRecording.zip

@sujaybarooah
Copy link
Author

Hi, I am closing this issue.
I have been able to resolve this by switching to DefaultContent() before selecting the button in the custom dialog.
Thanks for your assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants