Forum Discussion
21 Replies
- npaisley
Staff
Hi SK2!
You can access objects within iFrames by specifying some specific command line flags for Chrome/Edge that disable security restrictions for frames.
Below is the document that will walk you through starting your browser with the required flags;
https://support.smartbear.com/testcomplete/docs/app-testing/web/common-tasks/frames.html
I hope this helps!
- SK2Contributor
Hi Nick,
As stated in the link above I have entered below line in the command-line, however receiving pop up window as "Failed to Create Data Directory". I am assuming some permission issue.
"--disable-web-security --user-data-dir=\"C:\\Users\\Tester\\AppData\\Local\\Google\\Chrome\\User Data\\Default\" --disable-site-isolation-trials"
- SK2Contributor
Hi Nick,
Looks like this issue is not completely resolved. I can open the chrome browser with my code, however I still get the dialog box with Failed to Create Data Directory message while executing my script but once I manually click on OK button then the script continues and enters the URL that open the browser with disabled security version and it performs other actions and access the iFrame object as well.
Browsers.Item("chrome").RunOptions = "--disable-web-security --user-data-dir=\"C:\Users\MyUser\AppData\Local\Google\Chrome\User Data\Default\" --disable-site-isolation-trials";
Browsers.Item(btChrome).Run("myAppURL");FYI - bold text has real data
- SK2Contributor
Does anyone has any resolution for my issue above? I am adding my query again below:
I can open the chrome browser to access iFrame with my code, however I still get the dialog box with 'Failed to Create Data Directory' message but once I manually click on OK button the script continues and enters the URL that open the browser with disabled security version and it performs other actions and access the iFrame object fine. However, how can I avoid getting the dialog box in the beginning?
Browsers.Item("chrome").RunOptions = "--disable-web-security --user-data-dir=\"C:\Users\MyUser\AppData\Local\Google\Chrome\User Data\Default\" --disable-site-isolation-trials";
Browsers.Item(btChrome).Run("myAppURL");FYI - bold text has real data
- Marsha_R
Champion Level 3
If you google this:
google chrome cannot read and write to its data directory
there are many different suggestions for a fix. I don't know which one(s) would work for you.
- npaisley
Staff
Hey SK2,
I'm very sorry for the confusion, all of my code samples have been in Python, not JS.
Unfortunately the iFrame JS example is working as expected on my machine by simply swapping out the username as we discussed. This does open Chrome with the correct settings to identify objects in frames within Salesforce.
I might move forward here by taking a step back and going over the documentation one more time and try the sample again. If you still receive the error about creating the user data information I would take a hard look at the permissions of your machine. Getting this to launch from the CLI with the required flags would be a good start to eliminate TestComplete from the troubleshooting process.
Accessing Object Frames in Chrome and Edge;
https://support.smartbear.com/testcomplete/docs/app-testing/web/common-tasks/frames.html