Open liubin-acn opened 7 years ago
Apologies, I incorrect answered this question.
What is the error in the simulator log?
# Terminal A
$ run-loop simctl tail
# Terminal B
$ < run your test >
If the page is reloading (after changing languages), you must wait for the page to load.
options = {:timeout => timeout}
wait_for(wait_options('Delegate says page is done loading', options)) do
query('WKWebView', :UIDelegate, :loading).first != 1
end
Hi @jmoody
Sorry for reply late and I have to hide my application name
The Simulator log as follow
Mar 13 10:36:55 P37926 (My Application Name)[6113]: INFO LPRouter:160 | POST: [LPMapRoute] {
operation = {
arguments = (
);
"method_name" = query;
};
query = "WKWebView xpath:'//*[@id=\\\"formSection\\\"]/form/p[contains(@class,\\\"buttons\\\")]/button'";
}
Mar 13 10:36:55 P37926 (My Application Name)[6113]: DEBUG LPMapRoute:134 | Map POST, /map Parsed UIScript as
(
"view:'WKWebView'",
"with xpath:'//*[@id=\\\"formSection\\\"]/form/p[contains(@class,\\\"buttons\\\")]/button'"
)
Mar 13 10:36:55 P37926 XCTRunner[6102]: 2017-03-13 10:36:55.792 DEBUG RoutingHTTPServer:218 | POST /1.0/dismiss-springboard-alerts {
}
Mar 13 10:36:55 P37926 XCTRunner[6102]: 2017-03-13 10:36:55.794 DEBUG RoutingHTTPServer:218 | POST /1.0/gesture {
gesture = touch;
options = {
};
specifiers = {
coordinate = {
x = "187.5";
y = 590;
};
};
}
Mar 13 10:36:55 P37926 XCTRunner[6102]: 2017-03-13 10:36:55.794 DEBUG Gesture:88 | WARNING: Testing on daemonProtocolVersion 6
Mar 13 10:36:55 P37926 XCTRunner[6102]: 2017-03-13 10:36:55.794 DEBUG Touch:103 | touch event: #<CBXTouchEvent orientation: 1
gesture:
<XCSynthesizedEventRecord:0x608000236340 name:'CBXTouchEvent_XCSynthesizedEventRecord'> paths:
Path 1:
<XCPointerEvent:0x60800005daf0 type:1 coordinate:(188,590) offset:0.00s>
<XCPointerEvent:0x60800024c4b0 type:3 coordinate:(188,590) offset:0.21s>
Mar 13 10:36:56 P37926 com.apple.WebKit.Networking[6121]: [] nw_host_stats_add_src recv too small, received 24, expected 28
Mar 13 10:36:56 P37926 com.apple.WebKit.Networking[6121]: [] __nwlog_err_simulate_crash simulate crash already simulated "nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available"
Mar 13 10:36:56 P37926 com.apple.WebKit.Networking[6121]: [] nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available, dumping backtrace:
[x86_64] libnetcore-856.30.16
0 libsystem_network.dylib 0x000000010536d666 __nw_create_backtrace_string + 123
1 libnetwork.dylib 0x000000010564b006 nw_socket_add_input_handler + 3164
2 libnetwork.dylib 0x0000000105628555 nw_endpoint_flow_attach_protocols + 3768
3 libnetwork.dylib 0x0000000105627572 nw_endpoint_flow_setup_socket + 563
4 libnetwork.dylib 0x0000000105626298 -[NWConcrete_nw_endpoint_flow startWithHandler:] + 2612
5 libnetwork.dylib 0x0000000105641ae1 nw_endpoint_handler_path_change + 1261
6 libnetwork.dylib 0x0000000105641510 nw_endpoint_handler_start + 570
7 libnetwork.dylib 0x00000001056591f9 nw_endpoint_resolver_start_next_child + 2240
8 libdispatch.dylib 0x0000
Mar 13 10:36:56 P37926 XCTRunner[6102]: 2017-03-13 10:36:56.102 DEBUG RoutingHTTPServer:218 | POST /1.0/dismiss-springboard-alerts {
}
Mar 13 10:36:56 P37926 (My Application Name)[6113]: INFO LPRouter:160 | POST: [LPMapRoute] {
operation = {
arguments = (
);
"method_name" = query;
};
query = "WKWebView xpath:'//*[@id=\\\"step\\\"]/li[contains(@class,\\\"current\\\")]/span[contains(text(),\\\"2.\U78ba\U8a8d\\\")]'";
}
Mar 13 10:36:56 P37926 (My Application @Name)[6113]: DEBUG LPMapRoute:134 | Map POST, /map Parsed UIScript as
(
"view:'WKWebView'",
"with xpath:'//*[@id=\\\"step\\\"]/li[contains(@class,\\\"current\\\")]/span[contains(text(),\\\"2.\U78ba\U8a8d\\\")]'"
)
Mar 13 10:36:56 P37926 com.apple.WebKit.Networking[6121]: [] nw_host_stats_add_src recv too small, received 24, expected 28
Mar 13 10:36:56 P37926 com.apple.WebKit.Networking[6121]: [] __nwlog_err_simulate_crash simulate crash already simulated "nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available"
Mar 13 10:36:56 P37926 com.apple.WebKit.Networking[6121]: [] nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available, dumping backtrace:
[x86_64] libnetcore-856.30.16
0 libsystem_network.dylib 0x000000010536d666 __nw_create_backtrace_string + 123
1 libnetwork.dylib 0x000000010564b006 nw_socket_add_input_handler + 3164
2 libnetwork.dylib 0x0000000105628555 nw_endpoint_flow_attach_protocols + 3768
3 libnetwork.dylib 0x0000000105627572 nw_endpoint_flow_setup_socket + 563
4 libnetwork.dylib 0x0000000105626298 -[NWConcrete_nw_endpoint_flow startWithHandler:] + 2612
5 libnetwork.dylib 0x0000000105641ae1 nw_endpoint_handler_path_change + 1261
6 libnetwork.dylib 0x0000000105641510 nw_endpoint_handler_start + 570
7 libnetwork.dylib 0x00000001056591f9 nw_endpoint_resolver_start_next_child + 2240
8 libdispatch.dylib 0x0000
Mar 13 10:36:56 P37926 com.apple.WebKit.Networking[6121]: [] nw_host_stats_add_src recv too small, received 24, expected 28
Mar 13 10:36:56 P37926 com.apple.WebKit.Networking[6121]: [] __nwlog_err_simulate_crash simulate crash already simulated "nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available"
Mar 13 10:36:56 P37926 com.apple.WebKit.Networking[6121]: [] nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available, dumping backtrace:
[x86_64] libnetcore-856.30.16
0 libsystem_network.dylib 0x000000010536d666 __nw_create_backtrace_string + 123
1 libnetwork.dylib 0x000000010564b006 nw_socket_add_input_handler + 3164
2 libnetwork.dylib 0x0000000105628555 nw_endpoint_flow_attach_protocols + 3768
3 libnetwork.dylib 0x0000000105627572 nw_endpoint_flow_setup_socket + 563
4 libnetwork.dylib 0x0000000105626298 -[NWConcrete_nw_endpoint_flow startWithHandler:] + 2612
5 libnetwork.dylib 0x0000000105641ae1 nw_endpoint_handler_path_change + 1261
6 libnetwork.dylib 0x0000000105641510 nw_endpoint_handler_start + 570
7 libnetwork.dylib 0x00000001056591f9 nw_endpoint_resolver_start_next_child + 2240
8 libdispatch.dylib 0x0000
Mar 13 10:36:56 P37926 com.apple.WebKit.Networking[6121]: [] nw_host_stats_add_src recv too small, received 24, expected 28
Mar 13 10:36:56 P37926 com.apple.WebKit.Networking[6121]: [] __nwlog_err_simulate_crash simulate crash already simulated "nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available"
Mar 13 10:36:56 P37926 com.apple.WebKit.Networking[6121]: [] nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available, dumping backtrace:
[x86_64] libnetcore-856.30.16
0 libsystem_network.dylib 0x000000010536d666 __nw_create_backtrace_string + 123
1 libnetwork.dylib 0x000000010564b006 nw_socket_add_input_handler + 3164
2 libnetwork.dylib 0x0000000105628555 nw_endpoint_flow_attach_protocols + 3768
3 libnetwork.dylib 0x0000000105627572 nw_endpoint_flow_setup_socket + 563
4 libnetwork.dylib 0x0000000105626298 -[NWConcrete_nw_endpoint_flow startWithHandler:] + 2612
5 libnetwork.dylib 0x0000000105641ae1 nw_endpoint_handler_path_change + 1261
6 libnetwork.dylib 0x0000000105641510 nw_endpoint_handler_start + 570
7 libnetwork.dylib 0x00000001056591f9 nw_endpoint_resolver_start_next_child + 2240
8 libdispatch.dylib 0x0000
Mar 13 10:36:56 P37926 com.apple.WebKit.Networking[6121]: [] nw_host_stats_add_src recv too small, received 24, expected 28
Mar 13 10:36:56 --- last message repeated 10 times ---
Mar 13 10:36:56 P37926 com.apple.WebKit.Networking[6121]: [] __nwlog_err_simulate_crash simulate crash already simulated "nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available"
Mar 13 10:36:56 P37926 com.apple.WebKit.Networking[6121]: [] nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available, dumping backtrace:
[x86_64] libnetcore-856.30.16
0 libsystem_network.dylib 0x000000010536d666 __nw_create_backtrace_string + 123
1 libnetwork.dylib 0x000000010564b006 nw_socket_add_input_handler + 3164
2 libnetwork.dylib 0x0000000105628555 nw_endpoint_flow_attach_protocols + 3768
3 libnetwork.dylib 0x0000000105627572 nw_endpoint_flow_setup_socket + 563
4 libnetwork.dylib 0x0000000105626298 -[NWConcrete_nw_endpoint_flow startWithHandler:] + 2612
5 libnetwork.dylib 0x0000000105641ae1 nw_endpoint_handler_path_change + 1261
6 libnetwork.dylib 0x0000000105641510 nw_endpoint_handler_start + 570
7 libnetwork.dylib 0x00000001056591f9 nw_endpoint_resolver_start_next_child + 2240
8 libdispatch.dylib 0x0000
Mar 13 10:37:16 P37926 com.apple.WebKit.Networking[6121]: [] nw_endpoint_handler_add_write_request [7.1 104.78.4.43:443 failed socket-flow (satisfied)] cannot accept write requests
Mar 13 10:37:16 P37926 com.apple.WebKit.Networking[6121]: [] __tcp_connection_write_eof_block_invoke Write close callback received error: [22] Invalid argument
Mar 13 10:40:45 P37926 photoanalysisd[6130]: objc[6130]: Class PLBuildVersion is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x10a35b998) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x106b64880). One of the two will be used. Which one is undefined.
Mar 13 10:40:45 P37926 logd[5986]: metadata shared cached uuid is null (using logd's shared cache info) photoanalysisd (6130)
Mar 13 10:40:45 P37926 logd[5986]: Failed to harvest strings for pathless uuid '00000000-0000-0000-0000-000000000000'
@jmoody By the way I try to use follow function to track webview loading state
options = {:timeout => timeout}
wait_for(wait_options('Delegate says page is done loading', options)) do
query('WKWebView', :UIDelegate, :loading).first != 1
puts "#{query('WKWebView', :UIDelegate, :loading)}"
end
but I got "["*****"]" in Terminal. It is a loop
["*****"]
["*****"]
["*****"]
["*****"]
...
query('WKWebView', :UIDelegate, :loading)
The UIDelegate
is an artifact of implementation.
Try:
query('WKWebView', :loading)
@jmoody
Thank you for your reply. I added log in previous comment, Could you please help me to resolve this issue.
Hi, @jmoody
Could you please help me to resolve this issue.
@jmoody
If the page is reloading (after changing languages), you must wait for the page to load. ---> Actually, page is not reloading, I think simulator is crash, because I can not tap any button on the simulator and this page loads forever.
Can you reproduce in a sample project?
Hi,
I met a problem when I tested WKWebView on iOS 10 Simulator.
I entered all of necessary information into registration web page, then I tried to use follow touch function to tap "register button" to redirect to next page.
then Console show the error:
This test case will wait forever, I already disabled all of NSLog. this issue only on iOS 10 Simulator
Environment information: