Bootstrap modals are not iFrames, and as such, there is no need to "switch" the driver context to them. You should have no problem locating modal elements as you would any other element in the DOM.
If you want to locate elements within the modal, I have found the following approach to be useful.
WebElement modal = driver.findElement(By.xpath("<xpath to modal container here>"));
WebElement child = modal.findElement(By.xpath("<relative xpath to child element here"));
Where the child xpath begins with
.//. The leading dot indicates to "search from the current node". Since we are calling
findElement from the context of the modal container, the search will only return matches that are children of the modal.
By.className, etc. will do the same when called from the context of an element.
The portion of your XPath
@class type = 'radio' isn't quite right.
@type is the attribute you should be trying to match on.
@class appears to be empty (I would have to see the actual HTML to be sure).
Try the following
The final issue is that the text you are searching for actually belongs to the
<label> element that is the direct parent of the radio button, so we first must locate the label based on the specified text, and then get the child radio element. The code below should do what you're looking for.
WebElement modal = driver.findElement(By.xpath("//div[contains(@class,'modal-body')]"));
WebElement radio = modal.findElement(By.xpath(".//label[@class='radiogroup-element' and contains(@style,'block') and text()='Create the account myself']/input[@type='radio']"));
As in the generic example above, it will first locate the modal. Then it will find the intended radio button from the context of the modal and click it.