scriptotek / alma-slipsomat

Tool for syncing Alma letters XSL files with a local folder
MIT License
15 stars 10 forks source link

push goes kaboom: unable to locate element #28

Closed th122 closed 7 years ago

th122 commented 7 years ago

Both in production and sandbox, push complains about not finding element: [id="#ROW_ACTION_fileList_65_c.ui.table.btn.edit input"]. Similarily named items exist, but without "input" denominator (from page source, assuming I hit the right one):

<input class="jsCloseableContainerOpener" type="submit" name="All" id="input_fileList_65" value="Actions" onclick="return closeAllActions(this,'fileList',65)"/> </span>
    <ul id="ROW_ACTION_fileList_65" class="comboActions underButton hide  jsCloseableContainer" >

        <li class="clearfix" id="ROW_ACTION_fileList_65_c.ui.table.btn.edit">
            <input title="" name="pageBean.pageInfoFinal.sectionses[2].sections[1].sectionLists[0].parameters.rowAction.linkActionFields[0].submitOperations[65].submitFlag"  onclick="storeSelectedRowId(this);this.form.target='_self';return loadPage(this);" type="submit" class="submitAsLink " value="Edit" /></li>
        <li class="clearfix" id="ROW_ACTION_fileList_65_c.ui.table.btn.restore">
            <input title="" name="pageBean.pageInfoFinal.sectionses[2].sections[1].sectionLists[0].parameters.rowAction.linkActionFields[4].submitOperations[65].submitFlag"  onclick="storeSelectedRowId(this);this.form.target='_self';return loadPage(this);" type="submit" class="submitAsLink " value="Restore" /></li>
        <li class="clearfix" id="ROW_ACTION_fileList_65_c.ui.table.btn.view_default">
            <input title="" name="pageBean.pageInfoFinal.sectionses[2].sections[1].sectionLists[0].parameters.rowAction.linkActionFields[5].submitOperations[65].submitFlag"  onclick="storeSelectedRowId(this);this.form.target='_self';return loadPage(this);" type="submit" class="submitAsLink " value="View&#x20;Default" /></li>
                                                </ul>                                           

The error in all its glory:

slipsomat> push
Reading table... DONE
The following 2 file(s) contains local modifications.
 - xsl/letters/FulTransitSlipLetter.xsl
 - xsl/letters/FulReasourceRequestSlipLetter.xsl
Push updates to Alma?  (y/N) y
- FulTransitSlipLetter.xsl                                    
Exception: Message: Unable to locate element: [id="#ROW_ACTION_fileList_65_c\.ui\.table\.btn\.edit input"]

Traceback (most recent call last):
  File "/Volumes/Users/theuser/.pyenv/versions/3.5.1/lib/python3.5/site-packages/slipsomat/slipsomat.py", line 808, in execute
    function(self.browser, *args)
  File "/Volumes/Users/theuser/.pyenv/versions/3.5.1/lib/python3.5/site-packages/slipsomat/slipsomat.py", line 667, in push
    if letter.push():
  File "/Volumes/Users/theuser/.pyenv/versions/3.5.1/lib/python3.5/site-packages/slipsomat/slipsomat.py", line 531, in push
    txtarea = self.edit()
  File "/Volumes/Users/theuser/.pyenv/versions/3.5.1/lib/python3.5/site-packages/slipsomat/slipsomat.py", line 389, in edit
    self.scroll_into_view_and_click(editBtnSelector)
  File "/Volumes/Users/theuser/.pyenv/versions/3.5.1/lib/python3.5/site-packages/slipsomat/slipsomat.py", line 325, in scroll_into_view_and_click
    element = self.table.browser.driver.find_element(by, value)
  File "/Volumes/Users/theuser/.pyenv/versions/3.5.1/lib/python3.5/site-packages/selenium-3.4.1-py3.5.egg/selenium/webdriver/remote/webdriver.py", line 787, in find_element
    'value': value})['value']
  File "/Volumes/Users/theuser/.pyenv/versions/3.5.1/lib/python3.5/site-packages/selenium-3.4.1-py3.5.egg/selenium/webdriver/remote/webdriver.py", line 252, in execute
    self.error_handler.check_response(response)
  File "/Volumes/Users/theuser/.pyenv/versions/3.5.1/lib/python3.5/site-packages/selenium-3.4.1-py3.5.egg/selenium/webdriver/remote/errorhandler.py", line 194, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: [id="#ROW_ACTION_fileList_65_c\.ui\.table\.btn\.edit input"]

[?] Now what?: 
 > Restart browser
danmichaelo commented 7 years ago

7004433 should fix that one I think. But in a few weeks we have the new Alma UI.. 😱

th122 commented 7 years ago

I've just uploaded my pending changes successfully (after patching the login process to handle our shibboleth page) - thanks a million! Incidentially, somewhen around February we've had the new Alma UI, and much to my surprise, all the hooks for slipsomat seemed to be present. We've been changed back after half a day of experimenting around, so I won't know until it happens if anything breaks when the new UI goes live.

danmichaelo commented 7 years ago

Hm, that's interesting