What is the type of the data returned back from executeScript()

191 views
Skip to first unread message

Debanjan Bhattacharjee

unread,
Mar 17, 2018, 9:22:39 AM3/17/18
to Selenium Users
Hello Everyone,

Can someone help me to decode the type of the data returned back from executeScript() as below ?

Using Selenium-Java Clients when I retrieve some performance statistics from Chrome Development Tools as follows :

    System.out.println(((JavascriptExecutor)driver).executeScript(scriptToExecute));

I am receiving the following data :

    [{redirectCount=0, encodedBodySize=64518, unloadEventEnd=0, responseEnd=4247.699999992619, domainLookupEnd=2852.7999999932945, unloadEventStart=0, domContentLoadedEventStart=4630.699999994249, type=navigate, decodedBodySize=215670, duration=5709.000000002561, redirectStart=0, connectEnd=3203.5000000032596, toJSON={}, requestStart=3205.499999996391, initiatorType=beacon}]

The JavaDocs of executeScript() mentions :

If the script has a return value (i.e. if the script contains a return statement), then the following steps will be taken:

  • For an HTML element, this method returns a WebElement
  • For a decimal, a Double is returned
  • For a non-decimal number, a Long is returned
  • For a boolean, a Boolean is returned
  • For all other cases, a String is returned.
  • For an array, return a List<Object> with each object following the rules above. We support nested lists.
  • For a map, return a Map<String, Object> with values following the rules above.
  • Unless the value is null or there is no return value, in which null is returned
Any suggestions/pointer will be helpful.

Thanks and Regards
Debanjan-B

⇜Krishnan Mahadevan⇝

unread,
Mar 17, 2018, 10:41:22 AM3/17/18
to seleniu...@googlegroups.com
Looks like it's a map. Have you tried casting it to a map and see what happens ?

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/a397e4d5-efc5-4e03-b442-d86a97f56c7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

David

unread,
Mar 17, 2018, 4:23:17 PM3/17/18
to Selenium Users
Actually, in terms of JSON, doesn't that look like a List of Maps, except in this case it's only a list of 1 map. And when accessing map items, cast the value to the desired data type.

Debanjan Bhattacharjee

unread,
Mar 20, 2018, 1:23:21 AM3/20/18
to seleniu...@googlegroups.com
Hello All,

@David, I tried to stripoff the initial and trailing ' [{ ' & ' }] ' . But it still wont resolve to a Map.


Regards
Dev

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/lN2Ld3oN2ws/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/f3284636-0689-445f-84b7-f60b28647065%40googlegroups.com.

⇜Krishnan Mahadevan⇝

unread,
Mar 20, 2018, 1:26:04 AM3/20/18
to seleniu...@googlegroups.com
When you assign it to a Object variable and try printing it's type via get class() what do you see ? 

The "[" indicates it's perhaps an array or a list and the "{" indicates it's a map. 

To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.

To post to this group, send email to seleniu...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Jim Evans

unread,
Mar 20, 2018, 1:39:38 AM3/20/18
to Selenium Users
The data being returned is an array, as indicated by the square brackets (“[]”). Inside the array is an object, indicated by curly braces (“{}”). When the Java language bindings parse that returned value, it should be a List<Object>, where the zeroth element will be a Map<String, Object>. You’ll need to cast things accordingly to resolve the types in your Java code.

Jim Evans

unread,
Mar 20, 2018, 1:46:20 AM3/20/18
to Selenium Users
Not to reply to my own post, but what you want is:

// WARNING! Untested code, written from memory without the aid of an IDE.
// May not even compile without modification.
List<Object> list = (List<Object>)((JavascriptExecutor)driver).executeScript(“script here”);
Map<String, Object> map = (Map<String, Object>)(list.get(0));

Debanjan Bhattacharjee

unread,
Mar 20, 2018, 12:56:32 PM3/20/18
to seleniu...@googlegroups.com
Hello,

@krishnan Thanks for the reply. I tried to tread the string as a 'Map' but it won't. Observe the string ' toJSON={} '. There are may such in the actual string.

Regards
-Dev

On Sat, Mar 17, 2018 at 8:10 PM, ⇜Krishnan Mahadevan⇝ <krishnan.ma...@gmail.com> wrote:
Looks like it's a map. Have you tried casting it to a map and see what happens ?

On Sat, Mar 17, 2018, 18:53 Debanjan Bhattacharjee <debanjan.bhattacharjee@ariatech.in> wrote:
Hello Everyone,

Can someone help me to decode the type of the data returned back from executeScript() as below ?

Using Selenium-Java Clients when I retrieve some performance statistics from Chrome Development Tools as follows :

    System.out.println(((JavascriptExecutor)driver).executeScript(scriptToExecute));

I am receiving the following data :

    [{redirectCount=0, encodedBodySize=64518, unloadEventEnd=0, responseEnd=4247.699999992619, domainLookupEnd=2852.7999999932945, unloadEventStart=0, domContentLoadedEventStart=4630.699999994249, type=navigate, decodedBodySize=215670, duration=5709.000000002561, redirectStart=0, connectEnd=3203.5000000032596, toJSON={}, requestStart=3205.499999996391, initiatorType=beacon}]

The JavaDocs of executeScript() mentions :

If the script has a return value (i.e. if the script contains a return statement), then the following steps will be taken:

  • For an HTML element, this method returns a WebElement
  • For a decimal, a Double is returned
  • For a non-decimal number, a Long is returned
  • For a boolean, a Boolean is returned
  • For all other cases, a String is returned.
  • For an array, return a List<Object> with each object following the rules above. We support nested lists.
  • For a map, return a Map<String, Object> with values following the rules above.
  • Unless the value is null or there is no return value, in which null is returned
Any suggestions/pointer will be helpful.

Thanks and Regards
Debanjan-B

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
--

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/lN2Ld3oN2ws/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANikZLnvi5v1ihGWiWD1mZ-Yo%2B0MmhVbtD2bY9J%2BzA0%3DELasig%40mail.gmail.com.

David

unread,
Mar 20, 2018, 3:43:03 PM3/20/18
to Selenium Users
Jim's response should be appropriate for the answer, and a good Java IDE will help fix up any syntax issues with the suggested code.

Debanjan, striping the starting and ending "[{", "}]" will mess up your data type casting, because then you just have a string of items that don't translate to any type because you striped out the array [] and map/object {} identifiers, and since you have a comma separated list now, they don't translate to a string, number, etc. either. You should leave the string "as is" and not strip anything out.

And as a last resort, if you have trouble parsing/casting this into an object, could treat the output like JSON string in Java and parse the string into a Java JSON object (if you're familiar with how to do that).


On Tuesday, March 20, 2018 at 9:56:32 AM UTC-7, Debanjan Bhattacharjee wrote:
Hello,

@krishnan Thanks for the reply. I tried to tread the string as a 'Map' but it won't. Observe the string ' toJSON={} '. There are may such in the actual string.

Regards
-Dev
On Sat, Mar 17, 2018 at 8:10 PM, ⇜Krishnan Mahadevan⇝ <krishnan.ma...@gmail.com> wrote:
Looks like it's a map. Have you tried casting it to a map and see what happens ?

On Sat, Mar 17, 2018, 18:53 Debanjan Bhattacharjee <debanjan.bh...@ariatech.in> wrote:
Hello Everyone,

Can someone help me to decode the type of the data returned back from executeScript() as below ?

Using Selenium-Java Clients when I retrieve some performance statistics from Chrome Development Tools as follows :

    System.out.println(((JavascriptExecutor)driver).executeScript(scriptToExecute));

I am receiving the following data :

    [{redirectCount=0, encodedBodySize=64518, unloadEventEnd=0, responseEnd=4247.699999992619, domainLookupEnd=2852.7999999932945, unloadEventStart=0, domContentLoadedEventStart=4630.699999994249, type=navigate, decodedBodySize=215670, duration=5709.000000002561, redirectStart=0, connectEnd=3203.5000000032596, toJSON={}, requestStart=3205.499999996391, initiatorType=beacon}]

The JavaDocs of executeScript() mentions :

If the script has a return value (i.e. if the script contains a return statement), then the following steps will be taken:

  • For an HTML element, this method returns a WebElement
  • For a decimal, a Double is returned
  • For a non-decimal number, a Long is returned
  • For a boolean, a Boolean is returned
  • For all other cases, a String is returned.
  • For an array, return a List<Object> with each object following the rules above. We support nested lists.
  • For a map, return a Map<String, Object> with values following the rules above.
  • Unless the value is null or there is no return value, in which null is returned
Any suggestions/pointer will be helpful.

Thanks and Regards
Debanjan-B

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
--

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/lN2Ld3oN2ws/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

Serguei Kouzmine

unread,
Mar 21, 2018, 9:29:25 PM3/21/18
to Selenium Users
i have the project that deals with building a  Map<String, Double> from the window.performance.timing payload like yours , completely home brewed. Do you like it to  be shared ?


it parses payload you provided into
```
redirectCount=1.521681747888E9
decodedBodySize=1.521681532218E9
duration=1.521681742179E9
encodedBodySize=1.52168168337E9
redirectStart=1.521681747888E9
unloadEventEnd=1.521681747888E9
connectEnd=1.5216817446845E9
responseEnd=1.5216817436403E9
requestStart=1.5216817446825E9
domainLookupEnd=1.5216817450351999E9
unloadEventStart=1.521681747888E9
domContentLoadedEventStart=1.5216817432573001E9
``` 


the "code" of method is  less than 30 lines long :-(

```
public Map<String, Double> CreateDateMap(String payload) {
Map<String, Double> eventData = new HashMap<>();
Date currDate = new Date();

payload = payload.substring(1, payload.length() - 1);
String[] pairs = payload.split(",");

for (String pair : pairs) {
String[] values = pair.split("=");

if (values[0].trim().toLowerCase().compareTo("tojson") != 0
&& values[0].trim().toLowerCase().compareTo("initiatortype") != 0
&& values[0].trim().toLowerCase().compareTo("type") != 0) {
if (debug) {
System.err.println("Collecting: " + pair);
}
try {
eventData.put(values[0].trim(),
((currDate.getTime() - Double.valueOf(values[1]))) / 1000.0);
} catch (NumberFormatException e) {
// ignore
System.err.println(String.format("Exception (ignored) %s for %s = %s",
e.toString(), values[0], values[1]));
}
}
}
return eventData;
}

```

David

unread,
Mar 22, 2018, 12:38:17 PM3/22/18
to Selenium Users
Serguei, as you have this kind of code, does that mean you weren't able to cast it naturally from executeScript return value, and had to parse the results (return value) as string into object manually?

Serguei Kouzmine

unread,
Mar 22, 2018, 6:45:23 PM3/22/18
to Selenium Users
sure . it is just 30 lines of code plus a  record splitter.

```
String payload = "{stuff} , {more stuff}, {some other stuff}";
String splitter = "(?<=\\}) *, *(?=\\{)";
Pattern pattern = Pattern.compile(splitter);
Matcher matcher = pattern.matcher(payload);
if (matcher.find()) {
new ArrayList<String>(Arrays.asList(payload.split(splitter))).stream()
.forEach(System.err::println);

}

```

On Saturday, March 17, 2018 at 9:22:39 AM UTC-4, Debanjan Bhattacharjee wrote:

Serguei Kouzmine

unread,
Mar 22, 2018, 6:46:40 PM3/22/18
to Selenium Users
it felt naturally enough to me, ymmv

David

unread,
Mar 22, 2018, 7:25:32 PM3/22/18
to Selenium Users
Um, Serguei, just wanted to mention your recent comments aren't clear. Were they in response to my question to you or to the OP's original post? If to me, it doesn't really answer my question (i.e. just casting didn't work for you, or you preferred not to cast the return value but instead parse it?).

IMHO, just casting the return value in Java to appropriate object seems the more natural and least line of code way to do it than write a custom parser to map the string into object. But of course, everyone is free to do things as they prefer, whatever works.

Debanjan Bhattacharjee

unread,
Mar 26, 2018, 3:35:27 AM3/26/18
to Selenium Users
Hello Jim Evans,

Thanks a ton for the excellent analysis to help me understand the Data Type and Structure.

Thanks
Debanjan-B

Debanjan Bhattacharjee

unread,
Mar 26, 2018, 3:41:17 AM3/26/18
to Selenium Users
@Jim Evans,

Take a bow. Your solution was amazing. 

Here is what I did as per your guidelines :

     System.out.println(((JavascriptExecutor)driver).executeScript(scriptToExecute).getClass());
    List<Object> list = (List<Object>)((JavascriptExecutor)driver).executeScript(scriptToExecute);
    System.out.println(list.size());
    for (int i=0;i<list.size();i++)
    System.out.println(list.get(i));
    Map<String, Object> map = (Map<String, Object>)(list.get(0));
        for ( Map.Entry<String, ?> entry : map.entrySet()) 
        {
            System.out.println(entry.getKey() + " value is " + entry.getValue());
        }

Console Output :

class java.util.ArrayList
14
{redirectCount=0, encodedBodySize=65254, unloadEventEnd=0, responseEnd=1352.3000000004686, domainLookupEnd=584.9999999991269, unloadEventStart=0, domContentLoadedEventStart=1555.1999999988766, type=navigate, decodedBodySize=217906, duration=2521.8000000004395, redirectStart=0, connectEnd=1093.9999999991414, toJSON={}, requestStart=1098.3999999989464, startTime=0, fetchStart=1352.600000000166, serverTiming=[], domContentLoadedEventEnd=1567.1000000002095, entryType=navigation, workerStart=0, responseStart=1244.0999999998894, domInteractive=1555.0999999995838, domComplete=2512.399999999616, domainLookupStart=584.9999999991269, redirectEnd=0, transferSize=65894, connectStart=584.9999999991269, loadEventStart=2513.1000000001222, secureConnectionStart=632.2000000000116, name=http://www.google.com/, nextHopProtocol=h2, initiatorType=navigation, loadEventEnd=2521.8000000004395}
{encodedBodySize=3668, entryType=resource, responseEnd=1547.499999998763, workerStart=0, responseStart=1439.0999999995984, domainLookupEnd=1387.0999999999185, domainLookupStart=1387.0999999999185, redirectEnd=0, decodedBodySize=3668, duration=160.39999999884458, transferSize=3840, redirectStart=0, connectEnd=1387.0999999999185, toJSON={}, connectStart=1387.0999999999185, requestStart=1389.4000000000233, secureConnectionStart=0, name=https://www.google.co.in/logos/doodles/2018/45th-anniversary-of-the-chipko-movement-4881238832709632-s.png, startTime=1387.0999999999185, fetchStart=1387.0999999999185, serverTiming=[], nextHopProtocol=h2, initiatorType=img}
{encodedBodySize=57097, entryType=resource, responseEnd=1548.0999999999767, workerStart=0, responseStart=1456.7999999999302, domainLookupEnd=1387.800000000425, domainLookupStart=1387.800000000425, redirectEnd=0, decodedBodySize=57097, duration=160.2999999995518, transferSize=57238, redirectStart=0, connectEnd=1387.800000000425, toJSON={}, connectStart=1387.800000000425, requestStart=1389.999999999418, secureConnectionStart=0, name=https://www.google.co.in/logos/doodles/2018/45th-anniversary-of-the-chipko-movement-4881238832709632-l.png, startTime=1387.800000000425, fetchStart=1387.800000000425, serverTiming=[], nextHopProtocol=h2, initiatorType=img}
{encodedBodySize=0, entryType=resource, responseEnd=1755.6000000004133, workerStart=0, responseStart=0, domainLookupEnd=0, domainLookupStart=0, redirectEnd=0, decodedBodySize=0, duration=340.1000000012573, transferSize=0, redirectStart=0, connectEnd=0, toJSON={}, connectStart=0, requestStart=0, secureConnectionStart=0, name=https://ssl.gstatic.com/gb/images/i1_1967ca6a.png, startTime=1415.499999999156, fetchStart=1415.499999999156, serverTiming=[], nextHopProtocol=h2, initiatorType=css}
{encodedBodySize=0, entryType=resource, responseEnd=1692.299999998795, workerStart=0, responseStart=0, domainLookupEnd=0, domainLookupStart=0, redirectEnd=0, decodedBodySize=0, duration=250.59999999939464, transferSize=0, redirectStart=0, connectEnd=0, toJSON={}, connectStart=0, requestStart=0, secureConnectionStart=0, name=https://www.google.com/gen_204?dml=1, startTime=1441.6999999994005, fetchStart=1441.6999999994005, serverTiming=[], nextHopProtocol=h2, initiatorType=img}
{duration=0, entryType=paint, toJSON={}, name=first-paint, startTime=1442.6999999996042}
{duration=0, entryType=paint, toJSON={}, name=first-contentful-paint, startTime=1442.6999999996042}
{encodedBodySize=0, entryType=resource, responseEnd=1724.3999999991502, workerStart=0, responseStart=1723.7999999997555, domainLookupEnd=1554.2999999997846, domainLookupStart=1554.2999999997846, redirectEnd=0, decodedBodySize=0, duration=170.09999999936554, transferSize=47, redirectStart=0, connectEnd=1554.2999999997846, toJSON={}, connectStart=1554.2999999997846, requestStart=1555.6999999989785, secureConnectionStart=0, name=https://www.google.co.in/gen_204?s=webaft&atyp=csi&ei=OaK4WtvaBIb3vgTB2KCQDQ&rt=wsrt.1375,aft.178,prt.178, startTime=1554.2999999997846, fetchStart=1554.2999999997846, serverTiming=[], nextHopProtocol=h2, initiatorType=beacon}
{encodedBodySize=151589, entryType=resource, responseEnd=1757.499999999709, workerStart=0, responseStart=1619.3999999995867, domainLookupEnd=1569.099999998798, domainLookupStart=1569.099999998798, redirectEnd=0, decodedBodySize=436278, duration=188.40000000091095, transferSize=151827, redirectStart=0, connectEnd=1569.099999998798, toJSON={}, connectStart=1569.099999998798, requestStart=1569.999999999709, secureConnectionStart=0, name=https://www.google.co.in/xjs/_/js/k=xjs.s.en.Kx7yxJxwd4c.O/m=sx,sb,cdos,cr,elog,hsm,jsa,r,d,csi/am=wCJ0xz8A-f_BgCLRCkZYgGjBMDQ/rt=j/d=1/t=zcms/rs=ACT90oHijDTO4BdK_dV6OLntORv7XtH4Ng, startTime=1569.099999998798, fetchStart=1569.099999998798, serverTiming=[], nextHopProtocol=h2, initiatorType=script}
{encodedBodySize=0, entryType=resource, responseEnd=1995.600000000195, workerStart=0, responseStart=0, domainLookupEnd=0, domainLookupStart=0, redirectEnd=0, decodedBodySize=0, duration=222.90000000066357, transferSize=0, redirectStart=0, connectEnd=0, toJSON={}, connectStart=0, requestStart=0, secureConnectionStart=0, name=https://www.gstatic.com/og/_/js/k=og.og2.en_US.yvx_Tot7HP4.O/rt=j/m=def/exm=in,fot/d=1/ed=1/rs=AA2YrTulH-59-jRxgdSXRcZIBFga0YdnfA, startTime=1772.6999999995314, fetchStart=1772.6999999995314, serverTiming=[], nextHopProtocol=h2, initiatorType=script}
{encodedBodySize=33250, entryType=resource, responseEnd=1999.099999999089, workerStart=0, responseStart=1987.199999999575, domainLookupEnd=1897.7999999988242, domainLookupStart=1897.7999999988242, redirectEnd=0, decodedBodySize=100348, duration=101.30000000026484, transferSize=33385, redirectStart=0, connectEnd=1897.7999999988242, toJSON={}, connectStart=1897.7999999988242, requestStart=1906.6000000002532, secureConnectionStart=0, name=https://www.google.co.in/xjs/_/js/k=xjs.s.en.zoCHZa_eIk0.O/m=aa,abd,async,dvl,foot,fpe,ipv6,lu,m,mu,sf,sonic,spch,d3l,udlg/am=wCJ0xz8A-f_BgCLRCkZYgGjBMDQ/exm=sx,sb,cdos,cr,elog,hsm,jsa,r,d,csi/rt=j/d=1/ed=1/t=zcms/rs=ACT90oFNBAxj7vT_uPY2AcjrFiYSLr5Xxg?xjs=s1, startTime=1897.7999999988242, fetchStart=1897.7999999988242, serverTiming=[], nextHopProtocol=h2, initiatorType=script}
{encodedBodySize=0, entryType=resource, responseEnd=1998.4999999996944, workerStart=0, responseStart=0, domainLookupEnd=0, domainLookupStart=0, redirectEnd=0, decodedBodySize=0, duration=56.50000000059663, transferSize=0, redirectStart=0, connectEnd=0, toJSON={}, connectStart=0, requestStart=0, secureConnectionStart=0, name=https://www.google.com/textinputassistant/tia.png, startTime=1941.9999999990978, fetchStart=1941.9999999990978, serverTiming=[], nextHopProtocol=h2, initiatorType=img}
{encodedBodySize=0, entryType=resource, responseEnd=2459.7999999987223, workerStart=0, responseStart=0, domainLookupEnd=0, domainLookupStart=0, redirectEnd=0, decodedBodySize=0, duration=335.2999999988242, transferSize=0, redirectStart=0, connectEnd=0, toJSON={}, connectStart=0, requestStart=0, secureConnectionStart=0, name=https://apis.google.com/_/scs/abc-static/_/js/k=gapi.gapi.en.qJZuTTuHcJE.O/m=gapi_iframes,googleapis_client,plusone/rt=j/sv=1/d=1/ed=1/am=AAE/rs=AHpOoo8glyl83aQK4S9K5v-KraVNbM7RrQ/cb=gapi.loaded_0, startTime=2124.499999999898, fetchStart=2124.499999999898, serverTiming=[], nextHopProtocol=h2, initiatorType=script}
{encodedBodySize=0, entryType=resource, responseEnd=2512.1999999992113, workerStart=0, responseStart=2506.099999998696, domainLookupEnd=2416.799999999057, domainLookupStart=2416.799999999057, redirectEnd=0, decodedBodySize=0, duration=95.40000000015425, transferSize=54, redirectStart=0, connectEnd=2416.799999999057, toJSON={}, connectStart=2416.799999999057, requestStart=2418.4000000004744, secureConnectionStart=0, name=https://www.google.co.in/gen_204?atyp=i&ct=&cad=udla=1&ei=OaK4WtvaBIb3vgTB2KCQDQ&di=239700&lt=-12332321&ln=-18715210&zx=1522049593681, startTime=2416.799999999057, fetchStart=2416.799999999057, serverTiming=[], nextHopProtocol=h2, initiatorType=beacon}
redirectCount value is 0
encodedBodySize value is 65254
unloadEventEnd value is 0
responseEnd value is 1352.3000000004686
domainLookupEnd value is 584.9999999991269
unloadEventStart value is 0
domContentLoadedEventStart value is 1555.1999999988766
type value is navigate
decodedBodySize value is 217906
duration value is 2521.8000000004395
redirectStart value is 0
connectEnd value is 1093.9999999991414
toJSON value is {}
requestStart value is 1098.3999999989464
startTime value is 0
fetchStart value is 1352.600000000166
serverTiming value is []
domContentLoadedEventEnd value is 1567.1000000002095
entryType value is navigation
workerStart value is 0
responseStart value is 1244.0999999998894
domInteractive value is 1555.0999999995838
domComplete value is 2512.399999999616
domainLookupStart value is 584.9999999991269
redirectEnd value is 0
transferSize value is 65894
connectStart value is 584.9999999991269
loadEventStart value is 2513.1000000001222
secureConnectionStart value is 632.2000000000116
nextHopProtocol value is h2
initiatorType value is navigation
loadEventEnd value is 2521.8000000004395

Thanks and Regards
Debanjan-B

Debanjan Bhattacharjee

unread,
Mar 26, 2018, 3:49:44 AM3/26/18
to Selenium Users
@David,

Thank you so much. Apart from Jim's way as initially I suspected the return type as a JSON, stripping did cause some concerns but was able to form the Map some how :)

Here is the code snippet which strips off the  "[{", "}]", trims-off the error prone entries and creates/prints the Map.

Code Block :

     String netData = ((JavascriptExecutor)driver).executeScript(scriptToExecute).toString();
    System.out.println(netData);
    String my_text = netData.replaceAll ("[\\[\\]{}]", "");
    System.out.println(my_text);
    String[] items = my_text.split(",");
    Map<String, String> my_array = new HashMap<String,String>();

    for (String s: items){

        String[] item = s.split("=");
        if(item.length == 2){
            my_array.put(item[0].trim(), item[1].trim());
        }else{
            System.out.println("Error with: "+ s);
        }
    }
        for ( Map.Entry<String, ?> entry : my_array.entrySet()) 
        {
            System.out.println(entry.getKey() + " value is " + entry.getValue());
        }

Console Output :

[{redirectCount=0, encodedBodySize=28082, unloadEventEnd=0, responseEnd=3856.4000000005763, domainLookupEnd=3150.500000001557, unloadEventStart=0, domContentLoadedEventStart=3987.700000001496, type=navigate, decodedBodySize=217911, duration=4867.100000001301, redirectStart=0, connectEnd=3519.400000001042, toJSON={}, requestStart=3523.5000000011496, startTime=0, fetchStart=3800.8000000008906, serverTiming=[], domContentLoadedEventEnd=3995.9000000017113, entryType=navigation, workerStart=0, responseStart=3709.100000000035, domInteractive=3987.600000000384, domComplete=4857.6000000011845, domainLookupStart=3150.4000000004453, redirectEnd=0, transferSize=65897, connectStart=3150.500000001557, loadEventStart=4858.200000000579, secureConnectionStart=3192.1000000002095, name=http://www.google.com/, nextHopProtocol=h2, initiatorType=navigation, loadEventEnd=4867.100000001301}, {encodedBodySize=3668, entryType=resource, responseEnd=3899.700000001758, workerStart=0, responseStart=3886.400000001231, domainLookupEnd=3838.500000001659, domainLookupStart=3838.500000001659, redirectEnd=0, decodedBodySize=3668, duration=61.20000000009895, transferSize=3840, redirectStart=0, connectEnd=3838.500000001659, toJSON={}, connectStart=3838.500000001659, requestStart=3840.9000000010565, secureConnectionStart=0, name=https://www.google.co.in/logos/doodles/2018/45th-anniversary-of-the-chipko-movement-4881238832709632-s.png, startTime=3838.500000001659, fetchStart=3838.500000001659, serverTiming=[], nextHopProtocol=h2, initiatorType=img}, {encodedBodySize=57097, entryType=resource, responseEnd=3975.6000000015774, workerStart=0, responseStart=3899.200000001656, domainLookupEnd=3839.5000000000437, domainLookupStart=3839.5000000000437, redirectEnd=0, decodedBodySize=57097, duration=136.10000000153377, transferSize=57238, redirectStart=0, connectEnd=3839.5000000000437, toJSON={}, connectStart=3839.5000000000437, requestStart=3841.600000001563, secureConnectionStart=0, name=https://www.google.co.in/logos/doodles/2018/45th-anniversary-of-the-chipko-movement-4881238832709632-l.png, startTime=3839.5000000000437, fetchStart=3839.5000000000437, serverTiming=[], nextHopProtocol=h2, initiatorType=img}, {encodedBodySize=0, entryType=resource, responseEnd=4128.40000000142, workerStart=0, responseStart=0, domainLookupEnd=0, domainLookupStart=0, redirectEnd=0, decodedBodySize=0, duration=257.10000000071886, transferSize=0, redirectStart=0, connectEnd=0, toJSON={}, connectStart=0, requestStart=0, secureConnectionStart=0, name=https://ssl.gstatic.com/gb/images/i1_1967ca6a.png, startTime=3871.3000000007014, fetchStart=3871.3000000007014, serverTiming=[], nextHopProtocol=h2, initiatorType=css}, {encodedBodySize=0, entryType=resource, responseEnd=4856.900000000678, workerStart=0, responseStart=0, domainLookupEnd=0, domainLookupStart=0, redirectEnd=0, decodedBodySize=0, duration=957.6999999990221, transferSize=0, redirectStart=0, connectEnd=0, toJSON={}, connectStart=0, requestStart=0, secureConnectionStart=0, name=https://www.google.com/gen_204?dml=1, startTime=3899.200000001656, fetchStart=3899.200000001656, serverTiming=[], nextHopProtocol=h2, initiatorType=img}, {duration=0, entryType=paint, toJSON={}, name=first-paint, startTime=3900.000000001455}, {duration=0, entryType=paint, toJSON={}, name=first-contentful-paint, startTime=3900.000000001455}, {encodedBodySize=0, entryType=resource, responseEnd=4144.900000001144, workerStart=0, responseStart=4144.100000001345, domainLookupEnd=3987.200000001394, domainLookupStart=3987.200000001394, redirectEnd=0, decodedBodySize=0, duration=157.6999999997497, transferSize=56, redirectStart=0, connectEnd=3987.200000001394, toJSON={}, connectStart=3987.200000001394, requestStart=3988.500000001295, secureConnectionStart=0, name=https://www.google.co.in/gen_204?s=webaft&atyp=csi&ei=w6W4WpH0HofJvgSPxI3ICQ&rt=wsrt.3825,aft.158,prt.158, startTime=3987.200000001394, fetchStart=3987.200000001394, serverTiming=[], nextHopProtocol=h2, initiatorType=beacon}, {encodedBodySize=151589, entryType=resource, responseEnd=4145.800000000236, workerStart=0, responseStart=4042.700000001787, domainLookupEnd=3998.5000000015134, domainLookupStart=3998.5000000015134, redirectEnd=0, decodedBodySize=436278, duration=147.29999999872234, transferSize=151827, redirectStart=0, connectEnd=3998.5000000015134, toJSON={}, connectStart=3998.5000000015134, requestStart=3999.7000000003027, secureConnectionStart=0, name=https://www.google.co.in/xjs/_/js/k=xjs.s.en.Kx7yxJxwd4c.O/m=sx,sb,cdos,cr,elog,hsm,jsa,r,d,csi/am=wCJ0xz8A-f_BgCLRCkZYgGjBMDQ/rt=j/d=1/t=zcms/rs=ACT90oHijDTO4BdK_dV6OLntORv7XtH4Ng, startTime=3998.5000000015134, fetchStart=3998.5000000015134, serverTiming=[], nextHopProtocol=h2, initiatorType=script}, {encodedBodySize=33250, entryType=resource, responseEnd=4312.000000001717, workerStart=0, responseStart=4294.300000001385, domainLookupEnd=4247.9000000003, domainLookupStart=4247.9000000003, redirectEnd=0, decodedBodySize=100348, duration=64.10000000141736, transferSize=33385, redirectStart=0, connectEnd=4247.9000000003, toJSON={}, connectStart=4247.9000000003, requestStart=4249.000000001615, secureConnectionStart=0, name=https://www.google.co.in/xjs/_/js/k=xjs.s.en.zoCHZa_eIk0.O/m=aa,abd,async,dvl,foot,fpe,ipv6,lu,m,mu,sf,sonic,spch,d3l,udlg/am=wCJ0xz8A-f_BgCLRCkZYgGjBMDQ/exm=sx,sb,cdos,cr,elog,hsm,jsa,r,d,csi/rt=j/d=1/ed=1/t=zcms/rs=ACT90oFNBAxj7vT_uPY2AcjrFiYSLr5Xxg?xjs=s1, startTime=4247.9000000003, fetchStart=4247.9000000003, serverTiming=[], nextHopProtocol=h2, initiatorType=script}, {encodedBodySize=0, entryType=resource, responseEnd=4837.100000000646, workerStart=0, responseStart=0, domainLookupEnd=0, domainLookupStart=0, redirectEnd=0, decodedBodySize=0, duration=547.5000000005821, transferSize=0, redirectStart=0, connectEnd=0, toJSON={}, connectStart=0, requestStart=0, secureConnectionStart=0, name=https://www.google.com/textinputassistant/tia.png, startTime=4289.600000000064, fetchStart=4289.600000000064, serverTiming=[], nextHopProtocol=h2, initiatorType=img}, {encodedBodySize=0, entryType=resource, responseEnd=4404.600000001665, workerStart=0, responseStart=0, domainLookupEnd=0, domainLookupStart=0, redirectEnd=0, decodedBodySize=0, duration=112.20000000139407, transferSize=0, redirectStart=0, connectEnd=0, toJSON={}, connectStart=0, requestStart=0, secureConnectionStart=0, name=https://www.gstatic.com/og/_/js/k=og.og2.en_US.yvx_Tot7HP4.O/rt=j/m=def/exm=in,fot/d=1/ed=1/rs=AA2YrTulH-59-jRxgdSXRcZIBFga0YdnfA, startTime=4292.400000000271, fetchStart=4292.400000000271, serverTiming=[], nextHopProtocol=h2, initiatorType=script}, {encodedBodySize=0, entryType=resource, responseEnd=4777.200000000448, workerStart=0, responseStart=0, domainLookupEnd=0, domainLookupStart=0, redirectEnd=0, decodedBodySize=0, duration=336.19999999973516, transferSize=0, redirectStart=0, connectEnd=0, toJSON={}, connectStart=0, requestStart=0, secureConnectionStart=0, name=https://apis.google.com/_/scs/abc-static/_/js/k=gapi.gapi.en.qJZuTTuHcJE.O/m=gapi_iframes,googleapis_client,plusone/rt=j/sv=1/d=1/ed=1/am=AAE/rs=AHpOoo8glyl83aQK4S9K5v-KraVNbM7RrQ/cb=gapi.loaded_0, startTime=4441.000000000713, fetchStart=4441.000000000713, serverTiming=[], nextHopProtocol=h2, initiatorType=script}, {encodedBodySize=0, entryType=resource, responseEnd=4885.700000000725, workerStart=0, responseStart=4884.9000000009255, domainLookupEnd=4770.300000000134, domainLookupStart=4770.300000000134, redirectEnd=0, decodedBodySize=0, duration=115.40000000059081, transferSize=54, redirectStart=0, connectEnd=4770.300000000134, toJSON={}, connectStart=4770.300000000134, requestStart=4776.300000001356, secureConnectionStart=0, name=https://www.google.co.in/gen_204?atyp=i&ct=&cad=udla=1&ei=w6W4WpH0HofJvgSPxI3ICQ&di=239700&lt=-12332321&ln=-18715210&zx=1522050499998, startTime=4770.300000000134, fetchStart=4770.300000000134, serverTiming=[], nextHopProtocol=h2, initiatorType=beacon}]
redirectCount=0, encodedBodySize=28082, unloadEventEnd=0, responseEnd=3856.4000000005763, domainLookupEnd=3150.500000001557, unloadEventStart=0, domContentLoadedEventStart=3987.700000001496, type=navigate, decodedBodySize=217911, duration=4867.100000001301, redirectStart=0, connectEnd=3519.400000001042, toJSON=, requestStart=3523.5000000011496, startTime=0, fetchStart=3800.8000000008906, serverTiming=, domContentLoadedEventEnd=3995.9000000017113, entryType=navigation, workerStart=0, responseStart=3709.100000000035, domInteractive=3987.600000000384, domComplete=4857.6000000011845, domainLookupStart=3150.4000000004453, redirectEnd=0, transferSize=65897, connectStart=3150.500000001557, loadEventStart=4858.200000000579, secureConnectionStart=3192.1000000002095, name=http://www.google.com/, nextHopProtocol=h2, initiatorType=navigation, loadEventEnd=4867.100000001301, encodedBodySize=3668, entryType=resource, responseEnd=3899.700000001758, workerStart=0, responseStart=3886.400000001231, domainLookupEnd=3838.500000001659, domainLookupStart=3838.500000001659, redirectEnd=0, decodedBodySize=3668, duration=61.20000000009895, transferSize=3840, redirectStart=0, connectEnd=3838.500000001659, toJSON=, connectStart=3838.500000001659, requestStart=3840.9000000010565, secureConnectionStart=0, name=https://www.google.co.in/logos/doodles/2018/45th-anniversary-of-the-chipko-movement-4881238832709632-s.png, startTime=3838.500000001659, fetchStart=3838.500000001659, serverTiming=, nextHopProtocol=h2, initiatorType=img, encodedBodySize=57097, entryType=resource, responseEnd=3975.6000000015774, workerStart=0, responseStart=3899.200000001656, domainLookupEnd=3839.5000000000437, domainLookupStart=3839.5000000000437, redirectEnd=0, decodedBodySize=57097, duration=136.10000000153377, transferSize=57238, redirectStart=0, connectEnd=3839.5000000000437, toJSON=, connectStart=3839.5000000000437, requestStart=3841.600000001563, secureConnectionStart=0, name=https://www.google.co.in/logos/doodles/2018/45th-anniversary-of-the-chipko-movement-4881238832709632-l.png, startTime=3839.5000000000437, fetchStart=3839.5000000000437, serverTiming=, nextHopProtocol=h2, initiatorType=img, encodedBodySize=0, entryType=resource, responseEnd=4128.40000000142, workerStart=0, responseStart=0, domainLookupEnd=0, domainLookupStart=0, redirectEnd=0, decodedBodySize=0, duration=257.10000000071886, transferSize=0, redirectStart=0, connectEnd=0, toJSON=, connectStart=0, requestStart=0, secureConnectionStart=0, name=https://ssl.gstatic.com/gb/images/i1_1967ca6a.png, startTime=3871.3000000007014, fetchStart=3871.3000000007014, serverTiming=, nextHopProtocol=h2, initiatorType=css, encodedBodySize=0, entryType=resource, responseEnd=4856.900000000678, workerStart=0, responseStart=0, domainLookupEnd=0, domainLookupStart=0, redirectEnd=0, decodedBodySize=0, duration=957.6999999990221, transferSize=0, redirectStart=0, connectEnd=0, toJSON=, connectStart=0, requestStart=0, secureConnectionStart=0, name=https://www.google.com/gen_204?dml=1, startTime=3899.200000001656, fetchStart=3899.200000001656, serverTiming=, nextHopProtocol=h2, initiatorType=img, duration=0, entryType=paint, toJSON=, name=first-paint, startTime=3900.000000001455, duration=0, entryType=paint, toJSON=, name=first-contentful-paint, startTime=3900.000000001455, encodedBodySize=0, entryType=resource, responseEnd=4144.900000001144, workerStart=0, responseStart=4144.100000001345, domainLookupEnd=3987.200000001394, domainLookupStart=3987.200000001394, redirectEnd=0, decodedBodySize=0, duration=157.6999999997497, transferSize=56, redirectStart=0, connectEnd=3987.200000001394, toJSON=, connectStart=3987.200000001394, requestStart=3988.500000001295, secureConnectionStart=0, name=https://www.google.co.in/gen_204?s=webaft&atyp=csi&ei=w6W4WpH0HofJvgSPxI3ICQ&rt=wsrt.3825,aft.158,prt.158, startTime=3987.200000001394, fetchStart=3987.200000001394, serverTiming=, nextHopProtocol=h2, initiatorType=beacon, encodedBodySize=151589, entryType=resource, responseEnd=4145.800000000236, workerStart=0, responseStart=4042.700000001787, domainLookupEnd=3998.5000000015134, domainLookupStart=3998.5000000015134, redirectEnd=0, decodedBodySize=436278, duration=147.29999999872234, transferSize=151827, redirectStart=0, connectEnd=3998.5000000015134, toJSON=, connectStart=3998.5000000015134, requestStart=3999.7000000003027, secureConnectionStart=0, name=https://www.google.co.in/xjs/_/js/k=xjs.s.en.Kx7yxJxwd4c.O/m=sx,sb,cdos,cr,elog,hsm,jsa,r,d,csi/am=wCJ0xz8A-f_BgCLRCkZYgGjBMDQ/rt=j/d=1/t=zcms/rs=ACT90oHijDTO4BdK_dV6OLntORv7XtH4Ng, startTime=3998.5000000015134, fetchStart=3998.5000000015134, serverTiming=, nextHopProtocol=h2, initiatorType=script, encodedBodySize=33250, entryType=resource, responseEnd=4312.000000001717, workerStart=0, responseStart=4294.300000001385, domainLookupEnd=4247.9000000003, domainLookupStart=4247.9000000003, redirectEnd=0, decodedBodySize=100348, duration=64.10000000141736, transferSize=33385, redirectStart=0, connectEnd=4247.9000000003, toJSON=, connectStart=4247.9000000003, requestStart=4249.000000001615, secureConnectionStart=0, name=https://www.google.co.in/xjs/_/js/k=xjs.s.en.zoCHZa_eIk0.O/m=aa,abd,async,dvl,foot,fpe,ipv6,lu,m,mu,sf,sonic,spch,d3l,udlg/am=wCJ0xz8A-f_BgCLRCkZYgGjBMDQ/exm=sx,sb,cdos,cr,elog,hsm,jsa,r,d,csi/rt=j/d=1/ed=1/t=zcms/rs=ACT90oFNBAxj7vT_uPY2AcjrFiYSLr5Xxg?xjs=s1, startTime=4247.9000000003, fetchStart=4247.9000000003, serverTiming=, nextHopProtocol=h2, initiatorType=script, encodedBodySize=0, entryType=resource, responseEnd=4837.100000000646, workerStart=0, responseStart=0, domainLookupEnd=0, domainLookupStart=0, redirectEnd=0, decodedBodySize=0, duration=547.5000000005821, transferSize=0, redirectStart=0, connectEnd=0, toJSON=, connectStart=0, requestStart=0, secureConnectionStart=0, name=https://www.google.com/textinputassistant/tia.png, startTime=4289.600000000064, fetchStart=4289.600000000064, serverTiming=, nextHopProtocol=h2, initiatorType=img, encodedBodySize=0, entryType=resource, responseEnd=4404.600000001665, workerStart=0, responseStart=0, domainLookupEnd=0, domainLookupStart=0, redirectEnd=0, decodedBodySize=0, duration=112.20000000139407, transferSize=0, redirectStart=0, connectEnd=0, toJSON=, connectStart=0, requestStart=0, secureConnectionStart=0, name=https://www.gstatic.com/og/_/js/k=og.og2.en_US.yvx_Tot7HP4.O/rt=j/m=def/exm=in,fot/d=1/ed=1/rs=AA2YrTulH-59-jRxgdSXRcZIBFga0YdnfA, startTime=4292.400000000271, fetchStart=4292.400000000271, serverTiming=, nextHopProtocol=h2, initiatorType=script, encodedBodySize=0, entryType=resource, responseEnd=4777.200000000448, workerStart=0, responseStart=0, domainLookupEnd=0, domainLookupStart=0, redirectEnd=0, decodedBodySize=0, duration=336.19999999973516, transferSize=0, redirectStart=0, connectEnd=0, toJSON=, connectStart=0, requestStart=0, secureConnectionStart=0, name=https://apis.google.com/_/scs/abc-static/_/js/k=gapi.gapi.en.qJZuTTuHcJE.O/m=gapi_iframes,googleapis_client,plusone/rt=j/sv=1/d=1/ed=1/am=AAE/rs=AHpOoo8glyl83aQK4S9K5v-KraVNbM7RrQ/cb=gapi.loaded_0, startTime=4441.000000000713, fetchStart=4441.000000000713, serverTiming=, nextHopProtocol=h2, initiatorType=script, encodedBodySize=0, entryType=resource, responseEnd=4885.700000000725, workerStart=0, responseStart=4884.9000000009255, domainLookupEnd=4770.300000000134, domainLookupStart=4770.300000000134, redirectEnd=0, decodedBodySize=0, duration=115.40000000059081, transferSize=54, redirectStart=0, connectEnd=4770.300000000134, toJSON=, connectStart=4770.300000000134, requestStart=4776.300000001356, secureConnectionStart=0, name=https://www.google.co.in/gen_204?atyp=i&ct=&cad=udla=1&ei=w6W4WpH0HofJvgSPxI3ICQ&di=239700&lt=-12332321&ln=-18715210&zx=1522050499998, startTime=4770.300000000134, fetchStart=4770.300000000134, serverTiming=, nextHopProtocol=h2, initiatorType=beacon
Error with:  toJSON=
Error with:  serverTiming=
Error with:  toJSON=
Error with:  serverTiming=
Error with:  toJSON=
Error with:  serverTiming=
Error with:  toJSON=
Error with:  serverTiming=
Error with:  toJSON=
Error with:  serverTiming=
Error with:  toJSON=
Error with:  toJSON=
Error with:  toJSON=
Error with: aft.158
Error with: prt.158
Error with:  serverTiming=
Error with:  toJSON=
Error with: sb
Error with: cdos
Error with: cr
Error with: elog
Error with: hsm
Error with: jsa
Error with: r
Error with: d
Error with: csi/am=wCJ0xz8A-f_BgCLRCkZYgGjBMDQ/rt=j/d=1/t=zcms/rs=ACT90oHijDTO4BdK_dV6OLntORv7XtH4Ng
Error with:  serverTiming=
Error with:  toJSON=
Error with: abd
Error with: async
Error with: dvl
Error with: foot
Error with: fpe
Error with: ipv6
Error with: lu
Error with: m
Error with: mu
Error with: sf
Error with: sonic
Error with: spch
Error with: d3l
Error with: udlg/am=wCJ0xz8A-f_BgCLRCkZYgGjBMDQ/exm=sx
Error with: sb
Error with: cdos
Error with: cr
Error with: elog
Error with: hsm
Error with: jsa
Error with: r
Error with: d
Error with: csi/rt=j/d=1/ed=1/t=zcms/rs=ACT90oFNBAxj7vT_uPY2AcjrFiYSLr5Xxg?xjs=s1
Error with:  serverTiming=
Error with:  toJSON=
Error with:  serverTiming=
Error with:  toJSON=
Error with: fot/d=1/ed=1/rs=AA2YrTulH-59-jRxgdSXRcZIBFga0YdnfA
Error with:  serverTiming=
Error with:  toJSON=
Error with: googleapis_client
Error with: plusone/rt=j/sv=1/d=1/ed=1/am=AAE/rs=AHpOoo8glyl83aQK4S9K5v-KraVNbM7RrQ/cb=gapi.loaded_0
Error with:  serverTiming=
Error with:  toJSON=
Error with:  serverTiming=
redirectCount value is 0
encodedBodySize value is 0
unloadEventEnd value is 0
responseEnd value is 4885.700000000725
domainLookupEnd value is 4770.300000000134
unloadEventStart value is 0
domContentLoadedEventStart value is 3987.700000001496
type value is navigate
decodedBodySize value is 0
duration value is 115.40000000059081
redirectStart value is 0
connectEnd value is 4770.300000000134
requestStart value is 4776.300000001356
startTime value is 4770.300000000134
fetchStart value is 4770.300000000134
domContentLoadedEventEnd value is 3995.9000000017113
entryType value is resource
workerStart value is 0
responseStart value is 4884.9000000009255
domInteractive value is 3987.600000000384
domComplete value is 4857.6000000011845
domainLookupStart value is 4770.300000000134
redirectEnd value is 0
transferSize value is 54
connectStart value is 4770.300000000134
loadEventStart value is 4858.200000000579
secureConnectionStart value is 0
nextHopProtocol value is h2
initiatorType value is beacon
loadEventEnd value is 4867.100000001301

Thanks and Regards
DebanjanB

Debanjan Bhattacharjee

unread,
Mar 26, 2018, 3:54:25 AM3/26/18
to Selenium Users
@Serguei,

Your solution seems quite promising. Can you please share the exact usecase on window.performance.timing and the solution you are using (possibly in an attachment)

Thanks
DebanjanB

Debanjan Bhattacharjee

unread,
Mar 26, 2018, 7:10:30 AM3/26/18
to seleniu...@googlegroups.com
Hello Krishnan,

Thanks a ton !!!

Your question "When you assign it to a Object variable and try printing it's type via get class() what do you see ?" nails all the confusion.

It's a "class java.util.ArrayList"

Thanks everyone for your valuable time helping me out.

Regards
Debanjan-B


On Tue, Mar 20, 2018 at 10:55 AM, ⇜Krishnan Mahadevan⇝ <krishnan.ma...@gmail.com> wrote:
When you assign it to a Object variable and try printing it's type via get class() what do you see ? 

The "[" indicates it's perhaps an array or a list and the "{" indicates it's a map. 

To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
--

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/lN2Ld3oN2ws/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANikZLnotmyOtX1pq0%3DfAPHFn1kkCvsRyJf2-bqht8bBX5W2oA%40mail.gmail.com.

Serguei Kouzmine

unread,
Mar 31, 2018, 9:30:45 AM3/31/18
to Selenium Users
@Debanjan Bhattacharjee welcome   
Note there are many alternative ways to collect page element timings 
these days

it you like it - *star it*


On Saturday, March 17, 2018 at 9:22:39 AM UTC-4, Debanjan Bhattacharjee wrote:

Debanjan Bhattacharjee

unread,
Apr 4, 2018, 4:17:14 AM4/4/18
to Selenium Users
@Serguei Kouzmine Excellent Stuff !!!

 Just went through one of the README.md . Will explore the contents soon.

Thanks a lot.

Regards
Debanjan-B
Reply all
Reply to author
Forward
0 new messages