TruClient 12.02, Javascript and Same Origin Policy
Question ID: 107243
1
0

I am attempting to count some dynamic objects on a search result page. The window has three frames. Using the developer console in IE and Chrome, I am able to find the objects using *document.querySelectorAll(‘button’)* if I change the location to be searched to the iframe where those contents reside. If I change the location to the navigation frame, I get different objects that do not include the objects for which I am searching.

Lastly, if I narrow the search by class while in the navigation frame, I get the message "Permission Denied," indicating a same-origin policy issue in locating the objects from outside the iframe in which they reside.

When I implement the javascript in TruClient, I get the erroneous result, making it obvious that it is searching the navigation frame. I tested this further by searching by class instead of by tag, and I get 0.

**Is there any way to get around this in TruClient?** I’ve tried implementing the code in an Evaluate JavaScript step and also in the Object Ordinal step of the object. I would like to implement a loop so that the script can test the object to find the button I need to select.

Marked as spam
Posted by (Questions: 1, Answers: 0)
Asked on November 1, 2016 2:41 pm
132 views
Answers (1)
1
Private answer

I Recommend upgrading to LR 12.53 patch 4 Or LR 12.55 and then use the ''description'' option to identify the object correctly

Marked as spam
Posted by (Questions: 231, Answers: 18)
Answered on October 26, 2017 4:56 pm
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top