
I am using EasyRepro to automate tests in google chrome. What is happening is the iframe is being created with the function call
"var webresourceurl = Mscrm.CrmUri.create("/webresources/new_Dialoghtml");". This function is called when a radio button is clicked in an entity form.
When the iframe is created then I use the following code to select the OK button.
var radioButton = xrmBrowser.Driver.FindElement(By.Id("radiobuttonID"));
radioButton.Click();
xrmBrowser.ThinkTime(2000);
var iframes = xrmBrowser.Driver.FindElements(By.TagName("iframe"));
var iframe = iframes[2];
xrmBrowser.Driver.SwitchTo().Frame(iframe);
var btnOK= xrmBrowser.Driver.FindElement(By.Id("btnOK"));
btnOK.Click();
The problem is I can't find the button with id btnOK. I also looked at the iframes and none of them had a name and they all had generated id's.(I checked using google chrome inspector and all the iframes had names and actual id's not generated).
So what I am asking is how do I find the iframe and click OK on the dialog and how come I don't see the name and id's of the iframes that I see from the google chrome inspector.
Thanks in advance!
This is the iframe I want. Note I also tried using the full XPath copied from chrome inspector.
ID's of the iframes I got which have none of them have a name.
Here I did a query for all the iframes in the same window. They all have id's and names which don't show up in EasyRepro when I query for all iframes.
The iframe at index 2 is what I want but I didn't find the button in that iframe and I can't tell if it is the correct iframe since it has no name and id is generated.