vmi / selenese-runner-java

Selenium IDE native format (selenese and side) interpreter.
Other
140 stars 83 forks source link

It doesn't support to navigate to another opened tab #301

Closed JackJiaJJ closed 5 years ago

JackJiaJJ commented 5 years ago

It doesn't support to navigate to another tab

Firefox 60.6.2 ESR selenese-runner: 3.23.0 geckodriver : 0.23.0 selenium: 3.14.59

I record a script which will open another tab on firefox, and then it tries to go to this newly opened tab, on IDE, it can be playbacked successfully, but it failed to work on gecko, I can see the screenshot which is still on the original tab.

image

I got below error:

Error: selectFrame("index=0")==>[Failure: org.openqa.selenium.NoSuchFrameException: Unable to locate frame:...."

JackJiaJJ commented 5 years ago

Screenshot:

image

JackJiaJJ commented 5 years ago

{ "id": "404516bf-2dfc-43f5-988b-4aa1c06737f6", "version": "2.0", "name": "PSIC-002", "url": "https://www.ontario.ca", "tests": [{ "id": "2f9c5fd2-0544-4cad-8495-decb750ab01c", "name": "PSIC-002", "commands": [{ "id": "aa05b825-859a-4161-9ace-0317b2379d14", "comment": "", "command": "open", "target": "/page/serviceontario", "targets": [], "value": "" }, { "id": "429c2683-f0e2-44cc-80bd-e9530e229536", "comment": "", "command": "click", "target": "linkText=Private security and investigators", "targets": [ ["linkText=Private security and investigators", "linkText"], ["css=.medium-4:nth-child(1) > .no-bullet:nth-child(4) > li:nth-child(2) > a", "css:finder"], ["xpath=//a[contains(text(),'Private security and investigators')]", "xpath:link"], ["xpath=//div[@id='pagebody']/div/div/ul[2]/li[2]/a", "xpath:idRelative"], ["xpath=//a[contains(@href, '/page/security-guards-and-private-investigators')]", "xpath:href"], ["xpath=//ul[2]/li[2]/a", "xpath:position"], ["xpath=//a[contains(.,'Private security and investigators')]", "xpath:innerText"] ], "value": "" }, { "id": "22fbf176-e796-44ef-878e-6f3ab1d401c6", "comment": "", "command": "runScript", "target": "window.scrollTo(0,0)", "targets": [], "value": "" }, { "id": "ff054d3f-aea9-4184-acf5-57c1a00e37aa", "comment": "", "command": "click", "target": "linkText=an individual", "targets": [ ["linkText=an individual", "linkText"], ["css=#pagebody li:nth-child(1) > a", "css:finder"], ["xpath=//a[contains(text(),'an individual')]", "xpath:link"], ["xpath=//div[@id='pagebody']/ul/li/a", "xpath:idRelative"], ["xpath=//a[contains(@href, '/page/security-guard-or-private-investigator-licence-individuals')]", "xpath:href"], ["xpath=//div[2]/ul/li/a", "xpath:position"], ["xpath=//a[contains(.,'an individual')]", "xpath:innerText"] ], "value": "" }, { "id": "297113d7-9cb1-40a9-b10f-0fa90c0da654", "comment": "", "command": "click", "target": "linkText=Apply online", "targets": [ ["linkText=Apply online", "linkText"], ["css=.cols > li:nth-child(2) > a", "css:finder"], ["xpath=//a[contains(text(),'Apply online')]", "xpath:link"], ["xpath=//div[@id='toc']/ol/li[2]/a", "xpath:idRelative"], ["xpath=//a[contains(@href, '/page/security-guard-or-private-investigator-licence-individuals#section-1')]", "xpath:href"], ["xpath=//ol/li[2]/a", "xpath:position"], ["xpath=//a[contains(.,'Apply online')]", "xpath:innerText"] ], "value": "" }, { "id": "9d2f8742-5d40-4089-a37d-21f8b3af6fb3", "comment": "", "command": "click", "target": "linkText=new private investigator licence", "targets": [ ["linkText=new private investigator licence", "linkText"], ["css=p:nth-child(17) > .button", "css:finder"], ["xpath=//a[contains(text(),'new private investigator licence')]", "xpath:link"], ["xpath=//div[@id='pagebody']/p[12]/a", "xpath:idRelative"], ["xpath=//a[contains(@href, 'https://www.appmybizaccount.gov.on.ca/wps85/osb/public/destinationRouting?type=p817727')]", "xpath:href"], ["xpath=//p[12]/a", "xpath:position"], ["xpath=//a[contains(.,'new private investigator licence ')]", "xpath:innerText"] ], "value": "", "opensWindow": true, "windowHandleName": "win785", "windowTimeout": 2000 }, { "id": "ce42a161-4578-4423-8d0f-41b25fd398ca", "comment": "", "command": "storeWindowHandle", "target": "root", "targets": [], "value": "" }, { "id": "0689dfef-4d44-428b-862b-e0607d7504f9", "comment": "", "command": "selectWindow", "target": "handle=${win785}", "targets": [], "value": "" }, { "id": "6585c633-1f80-43af-971d-b4f242f195c4", "comment": "", "command": "selectFrame", "target": "index=0", "targets": [ ["index=0"] ], "value": "" }, { "id": "6f328ebc-5fe9-49d2-8dcc-8088c85795b4", "comment": "", "command": "click", "target": "id=ldap_user", "targets": [ ["id=ldap_user", "id"], ["name=ldap_user", "name"], ["css=#ldap_user", "css:finder"], ["xpath=//input[@id='ldap_user']", "xpath:attributes"], ["xpath=//div[@id='id-entry']/input", "xpath:idRelative"], ["xpath=//div[2]/input", "xpath:position"] ], "value": "" }] }], "suites": [{ "id": "d644a46b-3b80-4947-8c8c-6756ce58108c", "name": "Default Suite", "persistSession": false, "parallel": false, "timeout": 300, "tests": ["2f9c5fd2-0544-4cad-8495-decb750ab01c"] }], "urls": ["https://www.ontario.ca/"], "plugins": [] }

JackJiaJJ commented 5 years ago

Above is my testcase

JackJiaJJ commented 5 years ago

@vmi , any update for this issue ? thanks a lot !

vmi commented 5 years ago

I understood the cause of this problem, but I do not understand the behavior of Selenium IDE, so I continue investigation.

JackJiaJJ commented 5 years ago

Thanks a lot ! @vmi

vmi commented 5 years ago

Hi,

I fixed this problem and released 3.24.0. Please test it.

JackJiaJJ commented 5 years ago

Hello,

Today I tried to very this issue with 3.24.0, I can see it can navigate to the newly opened tab, I got another issue, from the UI (firefox), I could see at first the newly opened tab is [about:blank] / Title [], and then it turned to the actual url very soon, but actually we caught [about:blank] / Title [], please see below log:

[2019-06-16 23:06:29.530 -07:00] [INFO] Start: Selenese Runner 3.24.0 [2019-06-16 23:06:29.961 -07:00] [INFO] No capabilities. [2019-06-16 23:06:32.841 -07:00] [INFO] Detected dialect: W3C [2019-06-16 23:06:32.858 -07:00] [INFO] Initial window size: system default [2019-06-16 23:06:32.858 -07:00] [INFO] Initialized: FirefoxDriver [2019-06-16 23:06:32.893 -07:00] [INFO] Timeout: 30000 ms [2019-06-16 23:06:32.893 -07:00] [INFO] Max retries: 0 [2019-06-16 23:06:33.285 -07:00] [INFO] Start: TestProject[PSIC-002] (/root/PSIC-for-github.side) [2019-06-16 23:06:33.296 -07:00] [INFO] Existing driver found. [2019-06-16 23:06:33.305 -07:00] [INFO] Current speed: 0 ms/command [2019-06-16 23:06:33.305 -07:00] [INFO] Start: TestSuite[Default Suite] (/root/PSIC-for-github.side) [2019-06-16 23:06:33.309 -07:00] [INFO] Existing driver found. [2019-06-16 23:06:33.318 -07:00] [INFO] Current speed: 0 ms/command [2019-06-16 23:06:33.318 -07:00] [INFO] Start: TestCase[PSIC-002] (/root/PSIC-for-github.side) [2019-06-16 23:06:33.319 -07:00] [INFO] baseURL: https://www.ontario.ca [2019-06-16 23:06:33.331 -07:00] [INFO] <1> ### ### [2019-06-16 23:06:33.355 -07:00] [INFO] - [Success] URL: [about:blank] / Title: [] [2019-06-16 23:06:33.357 -07:00] [INFO] <2> Command#2: open("/page/serviceontario") [2019-06-16 23:06:39.925 -07:00] [INFO] - [Success] URL: [https://www.ontario.ca/page/serviceontario] / Title: [ServiceOntario | Ontario.ca] [2019-06-16 23:06:39.926 -07:00] [INFO] - Cookie: _ga=[GA1.2.272511548.1560751599] (domain=.ontario.ca, path=/, expire=2021-06-15 23:06:39 -07:00) [2019-06-16 23:06:39.926 -07:00] [INFO] - Cookie: _gat=[1] (domain=.ontario.ca, path=/, expire=2019-06-16 23:07:39 -07:00) [2019-06-16 23:06:39.927 -07:00] [INFO] - Cookie: _gat_ServiceOntario=[1] (domain=.ontario.ca, path=/, expire=2019-06-16 23:07:39 -07:00) [2019-06-16 23:06:39.927 -07:00] [INFO] - Cookie: _gid=[GA1.2.211889455.1560751599] (domain=.ontario.ca, path=/, expire=2019-06-17 23:06:39 -07:00) [2019-06-16 23:06:39.927 -07:00] [INFO] <3> ### ### [2019-06-16 23:06:39.946 -07:00] [INFO] - [Success] [2019-06-16 23:06:39.947 -07:00] [INFO] <4> Command#4: click("linkText=Private security and investigators") [2019-06-16 23:06:40.366 -07:00] [INFO] - [Success] URL: [https://www.ontario.ca/page/security-guards-and-private-investigators] / Title: [Security guards and private investigators | Ontario.ca] [2019-06-16 23:06:40.367 -07:00] [INFO] <5> ### ### [2019-06-16 23:06:40.376 -07:00] [INFO] - [Success] [2019-06-16 23:06:40.377 -07:00] [INFO] <6> Command#6: runScript("window.scrollTo(0,0)") [2019-06-16 23:06:40.656 -07:00] [INFO] - [Success] [2019-06-16 23:06:40.656 -07:00] [INFO] <7> ### ### [2019-06-16 23:06:40.668 -07:00] [INFO] - [Success] [2019-06-16 23:06:40.668 -07:00] [INFO] <8> Command#8: click("linkText=an individual") [2019-06-16 23:06:41.346 -07:00] [INFO] - [Success] URL: [https://www.ontario.ca/page/security-guard-or-private-investigator-licence-individuals] / Title: [Security guard or private investigator licence (individuals) | Ontario.ca] [2019-06-16 23:06:41.347 -07:00] [INFO] <9> ### ### [2019-06-16 23:06:41.360 -07:00] [INFO] - [Success] [2019-06-16 23:06:41.361 -07:00] [INFO] <10> Command#10: click("linkText=Apply online") [2019-06-16 23:06:41.486 -07:00] [INFO] - [Success] URL: [https://www.ontario.ca/page/security-guard-or-private-investigator-licence-individuals#section-1] / Title: [Security guard or private investigator licence (individuals) | Ontario.ca] [2019-06-16 23:06:41.487 -07:00] [INFO] <11> ### ### [2019-06-16 23:06:41.502 -07:00] [INFO] - [Success] [2019-06-16 23:06:41.502 -07:00] [INFO] <12> Command#12: click("linkText=new private investigator licence") [2019-06-16 23:06:41.763 -07:00] [INFO] - [Success] [2019-06-16 23:06:41.763 -07:00] [INFO] <13> ### ### [2019-06-16 23:06:41.772 -07:00] [INFO] - [Success] [2019-06-16 23:06:41.772 -07:00] [INFO] <14> Command#14: storeWindowHandle("root") [2019-06-16 23:06:41.785 -07:00] [INFO] - [2147483649] [2019-06-16 23:06:41.786 -07:00] [INFO] <15> ### ### [2019-06-16 23:06:41.799 -07:00] [INFO] - [Success] [2019-06-16 23:06:41.800 -07:00] [INFO] <16> Command#16: selectWindow("handle=${win785}") [2019-06-16 23:06:42.318 -07:00] [INFO] - [Selected window [2147483653] ] URL: [about:blank] / Title: [] [2019-06-16 23:06:42.318 -07:00] [INFO] <17> ### ### [2019-06-16 23:06:42.326 -07:00] [INFO] - [Success] [2019-06-16 23:06:42.326 -07:00] [INFO] <18> Command#18: selectFrame("index=0") [2019-06-16 23:06:42.362 -07:00] [ERROR] Command#18: selectFrame("index=0") => [Failure: org.openqa.selenium.NoSuchFrameException: Unable to locate frame: undefined / Build info: version: '3.141.59', revision: 'unknown', time: 'unknown' / System info: host: 'apm-agent-0011.fyre.ibm.com', ip: '10.21.4.41', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-862.14.4.el7.x86_64', java.version: '1.8.0_191' / Driver info: org.openqa.selenium.firefox.FirefoxDriver / Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 60.7.0, javascriptEnabled: true, moz:accessibilityChecks: false, moz:geckodriverVersion: 0.23.0, moz:headless: false, moz:processID: 10477, moz:profile: /tmp/rust_mozprofile.69b02H..., moz:useNonSpecCompliantPointerOrigin: false, moz:webdriverClick: true, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, platformVersion: 3.10.0-862.14.4.el7.x86_64, rotatable: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}} / Session ID: 30f44109-a0e4-4a42-81d9-e2991b091a46] [2019-06-16 23:06:42.364 -07:00] [INFO] End(9.045sec): TestCase[PSIC-002] (/root/PSIC-for-github.side) [2019-06-16 23:06:42.364 -07:00] [INFO] End(0.000sec): TestSuite[Default Suite] (/root/PSIC-for-github.side) [2019-06-16 23:06:42.364 -07:00] [INFO] End(0.000sec): TestProject[PSIC-002] (/root/PSIC-for-github.side) [2019-06-16 23:06:43.261 -07:00] [INFO] Quit: FirefoxDriver [2019-06-16 23:06:43.261 -07:00] [INFO] Exit code: 3 (FAILURE)

JackJiaJJ commented 5 years ago

I found a workaround: I added a command "pause" before "store window handle":

image

Then the test can work well:

[2019-06-16 23:34:28.686 -07:00] [INFO] Start: Selenese Runner 3.24.0 [2019-06-16 23:34:29.074 -07:00] [INFO] No capabilities. [2019-06-16 23:34:31.847 -07:00] [INFO] Detected dialect: W3C [2019-06-16 23:34:31.861 -07:00] [INFO] Initial window size: system default [2019-06-16 23:34:31.861 -07:00] [INFO] Initialized: FirefoxDriver [2019-06-16 23:34:31.909 -07:00] [INFO] Timeout: 30000 ms [2019-06-16 23:34:31.909 -07:00] [INFO] Max retries: 0 [2019-06-16 23:34:32.275 -07:00] [INFO] Start: TestProject[PSIC-002] (/root/PSIC-for-github.side) [2019-06-16 23:34:32.286 -07:00] [INFO] Existing driver found. [2019-06-16 23:34:32.295 -07:00] [INFO] Current speed: 0 ms/command [2019-06-16 23:34:32.296 -07:00] [INFO] Start: TestSuite[Default Suite] (/root/PSIC-for-github.side) [2019-06-16 23:34:32.299 -07:00] [INFO] Existing driver found. [2019-06-16 23:34:32.307 -07:00] [INFO] Current speed: 0 ms/command [2019-06-16 23:34:32.308 -07:00] [INFO] Start: TestCase[PSIC-002] (/root/PSIC-for-github.side) [2019-06-16 23:34:32.308 -07:00] [INFO] baseURL: https://www.ontario.ca [2019-06-16 23:34:32.319 -07:00] [INFO] <1> ### ### [2019-06-16 23:34:32.341 -07:00] [INFO] - [Success] URL: [about:blank] / Title: [] [2019-06-16 23:34:32.342 -07:00] [INFO] <2> Command#2: open("/page/serviceontario") [2019-06-16 23:34:37.154 -07:00] [INFO] - [Success] URL: [https://www.ontario.ca/page/serviceontario] / Title: [ServiceOntario | Ontario.ca] [2019-06-16 23:34:37.155 -07:00] [INFO] - Cookie: _ga=[GA1.2.1972003038.1560753276] (domain=.ontario.ca, path=/, expire=2021-06-15 23:34:36 -07:00) [2019-06-16 23:34:37.155 -07:00] [INFO] - Cookie: _gat=[1] (domain=.ontario.ca, path=/, expire=2019-06-16 23:35:36 -07:00) [2019-06-16 23:34:37.156 -07:00] [INFO] - Cookie: _gat_ServiceOntario=[1] (domain=.ontario.ca, path=/, expire=2019-06-16 23:35:36 -07:00) [2019-06-16 23:34:37.156 -07:00] [INFO] - Cookie: _gid=[GA1.2.248751127.1560753276] (domain=.ontario.ca, path=/, expire=2019-06-17 23:34:36 -07:00) [2019-06-16 23:34:37.156 -07:00] [INFO] <3> ### ### [2019-06-16 23:34:37.169 -07:00] [INFO] - [Success] [2019-06-16 23:34:37.170 -07:00] [INFO] <4> Command#4: click("linkText=Private security and investigators") [2019-06-16 23:34:37.815 -07:00] [INFO] - [Success] URL: [https://www.ontario.ca/page/security-guards-and-private-investigators] / Title: [Security guards and private investigators | Ontario.ca] [2019-06-16 23:34:37.816 -07:00] [INFO] <5> ### ### [2019-06-16 23:34:37.831 -07:00] [INFO] - [Success] [2019-06-16 23:34:37.831 -07:00] [INFO] <6> Command#6: runScript("window.scrollTo(0,0)") [2019-06-16 23:34:37.852 -07:00] [INFO] - [Success] [2019-06-16 23:34:37.852 -07:00] [INFO] <7> ### ### [2019-06-16 23:34:37.860 -07:00] [INFO] - [Success] [2019-06-16 23:34:37.860 -07:00] [INFO] <8> Command#8: click("linkText=an individual") [2019-06-16 23:34:38.254 -07:00] [INFO] - [Success] URL: [https://www.ontario.ca/page/security-guard-or-private-investigator-licence-individuals] / Title: [Security guard or private investigator licence (individuals) | Ontario.ca] [2019-06-16 23:34:38.254 -07:00] [INFO] <9> ### ### [2019-06-16 23:34:38.264 -07:00] [INFO] - [Success] [2019-06-16 23:34:38.264 -07:00] [INFO] <10> Command#10: click("linkText=Apply online") [2019-06-16 23:34:38.716 -07:00] [INFO] - [Success] URL: [https://www.ontario.ca/page/security-guard-or-private-investigator-licence-individuals#section-1] / Title: [Security guard or private investigator licence (individuals) | Ontario.ca] [2019-06-16 23:34:38.716 -07:00] [INFO] <11> ### ### [2019-06-16 23:34:38.745 -07:00] [INFO] - [Success] [2019-06-16 23:34:38.745 -07:00] [INFO] <12> Command#12: click("linkText=new private investigator licence") [2019-06-16 23:34:39.036 -07:00] [INFO] - [Success] [2019-06-16 23:34:39.036 -07:00] [INFO] <13> ### ### [2019-06-16 23:34:39.044 -07:00] [INFO] - [Success] [2019-06-16 23:34:39.044 -07:00] [INFO] <14> Command#14: pause("5000") [2019-06-16 23:34:44.061 -07:00] [INFO] - [Success] [2019-06-16 23:34:44.062 -07:00] [INFO] <15> ### ### [2019-06-16 23:34:44.075 -07:00] [INFO] - [Success] [2019-06-16 23:34:44.075 -07:00] [INFO] <16> Command#16: storeWindowHandle("root") [2019-06-16 23:34:44.087 -07:00] [INFO] - [2147483649] [2019-06-16 23:34:44.088 -07:00] [INFO] <17> ### ### [2019-06-16 23:34:44.100 -07:00] [INFO] - [Success] [2019-06-16 23:34:44.100 -07:00] [INFO] <18> Command#18: selectWindow("handle=${win785}") [2019-06-16 23:34:44.622 -07:00] [INFO] - [Selected window [2147483653] Government of Ontario - ServiceOntario Account - Login] URL: [https://www.appmybizaccount.gov.on.ca/wps85/portal/osb/!ut/p/z1/hVBNb4JAFPwtHjjCW8Hy0RtQRVotTQlW9mJW2K7b0IUsC8R_X4jpwUbTd3vzZt5MBjDsAQvSc0YUrwWpxj3H9mHnrN23JLHn0ZO7RP469LIVcs1oa8EOPv6j4PGM7oyPRj2-UDZBmqHNYh7F8RLFmeeFr4ut5b3Mfwl_lMG7GVgIRYl5k3Blko8hnbshHRvS6UdFBIOcCkipOIQ-PANmVX289OCLo-UywJJ-Ukml0ckRPinVtI8a0tAwDEYtFJG8NgqioYYwqqGWFp3k6qyzjshSr6XeSN4TRXUuetqqqekRrHhBRTGBJe952ZGqvWV5qlsF-2snaL5XXvz10PTD2arYbPYDLZRmcw!!/dz/d5/L2dBISEvZ0FBIS9nQSEh/] / Title: [Government of Ontario - ServiceOntario Account - Login] [2019-06-16 23:34:44.623 -07:00] [INFO] - Cookie: JSESSIONID=[0000MoSUg_Ydm9Rm33kYX-OXluR:1c1ehpoqh] (domain=www.appmybizaccount.gov.on.ca, path=/, expire=*) [2019-06-16 23:34:44.623 -07:00] [INFO] - Cookie: _ga=[GA1.3.104679881.1560753282] (domain=.gov.on.ca, path=/, expire=2021-06-15 23:34:41 -07:00) [2019-06-16 23:34:44.623 -07:00] [INFO] - Cookie: _gat=[1] (domain=.gov.on.ca, path=/, expire=2019-06-16 23:35:42 -07:00) [2019-06-16 23:34:44.623 -07:00] [INFO] - Cookie: _gid=[GA1.3.1444351133.1560753282] (domain=.gov.on.ca, path=/, expire=2019-06-17 23:34:41 -07:00) [2019-06-16 23:34:44.623 -07:00] [INFO] - Cookie: os_return_url=[/wps85/mypoc/osb?uri=pagelink:osb.portal.public.myaccount.topsol.launcher&act=getServiceUrl&serviceCode=orRegisterPrivateInvestigatorIndividual&lang=en] (domain=www.appmybizaccount.gov.on.ca, path=/, expire=2019-06-17 23:34:39 -07:00) [2019-06-16 23:34:44.623 -07:00] [INFO] <19> ### ### [2019-06-16 23:34:44.634 -07:00] [INFO] - [Success] [2019-06-16 23:34:44.634 -07:00] [INFO] <20> Command#20: selectFrame("index=0") [2019-06-16 23:34:44.660 -07:00] [INFO] - [Success] [2019-06-16 23:34:44.660 -07:00] [INFO] <21> ### ### [2019-06-16 23:34:44.669 -07:00] [INFO] - [Success] [2019-06-16 23:34:44.669 -07:00] [INFO] <22> Command#22: click("id=ldap_user") [2019-06-16 23:34:44.942 -07:00] [INFO] - [Success] [2019-06-16 23:34:44.943 -07:00] [INFO] End(12.635sec): TestCase[PSIC-002] (/root/PSIC-for-github.side) [2019-06-16 23:34:44.944 -07:00] [INFO] End(0.000sec): TestSuite[Default Suite] (/root/PSIC-for-github.side) [2019-06-16 23:34:44.944 -07:00] [INFO] End(0.000sec): TestProject[PSIC-002] (/root/PSIC-for-github.side) [2019-06-16 23:34:45.808 -07:00] [INFO] Quit: FirefoxDriver [2019-06-16 23:34:45.809 -07:00] [INFO] Exit code: 0 (SUCCESS)

JackJiaJJ commented 5 years ago

@vmi , please help to check it, thanks !

JackJiaJJ commented 5 years ago

@vmi , any idea about it ? thanks !

vmi commented 5 years ago

Hi,

I re-fixed this problem and released 3.24.1. Please test it.

JackJiaJJ commented 5 years ago

I verify it with 3.24.1, it can work well now, thanks a lot !