#selenium

/

      • stryx` joined the channel
      • kpschmidt joined the channel
      • dude-x
        i don't know the difference. i would probably use the official selenium project javascript binding of webdriver
      • duderono_ joined the channel
      • kpschmidt has quit
      • duderonomy has quit
      • titusfortner-sl joined the channel
      • titusfortner-sl
        Sauce Labs tends to recommend WebDriverIO since it is easier for testers to use out of the box and has a more synchronous approach to writing tests.
      • ElectrumGuy has quit
      • dude-x
        titusfortner-sl who writes webdriverIO
      • titusfortner-sl
        @christian-bromann (who also works at Sauce Labs)
      • dude-x
        so it's not an official selenium binding?
      • titusfortner-sl
        no, it isn't maintained inside the official selenium repo
      • dude-x
        thanks for clarifying
      • titusfortner-sl
        though it has been around about as long
      • Ilayaraja joined the channel
      • jtrip has quit
      • Ilayaraja
        am looking for an information on the possible option to connect to citrix and automation applications in Citrix with Selenium
      • energizer joined the channel
      • can anyone share any possible ideas please
      • jtrip joined the channel
      • energizer
        In selenium, I want to click to open a menu, and then click a button in the menu to run some javascript. browser.implicitly_wait(10) isnt working. why wouldnt implicitly_wait work for this?
      • Is there another way to wait until the JS object exists and then run it?
      • titusfortner-sl
        typically you want to use an explicit wait strategy instead of an implicit wait strategy since it is more flexible.
      • I'm not sure what the syntax looks like in javascript
      • Ilayaraja has quit
      • kpschmidt joined the channel
      • kpschmidt has quit
      • https_GK1wmSU joined the channel
      • jakehm joined the channel
      • https_GK1wmSU has left the channel
      • kpschmidt joined the channel
      • kpschmidt has quit
      • tilerendering has quit
      • tilerendering joined the channel
      • titusfortner-sl has quit
      • selbot2_ has quit
      • selbot2 joined the channel
      • Lord_Drake1 joined the channel
      • Lord_Drake has quit
      • czart__ joined the channel
      • czart_ has quit
      • energizer
        titusfortner-sl: im using python. Trying it with explicit waits I get a timeout on browser.get https://dpaste.de/gp5X
      • GodFather has quit
      • zavelevsky joined the channel
      • dude-x
        that's a weird thing to do
      • the tag html will never go stale, so to speak
      • zavelevsky has quit
      • energizer okay so each URL has a thing you want to download?
      • or save
      • but each page looks the same more or less
      • mydog2 has quit
      • energizer
        dude-x: yes
      • mydog2 joined the channel
      • dude-x
        that context manager kind of makes sense what you did there.
      • energizer
      • dude-x
        energizer do you have full urls? like it starts with http(s)://
      • you shouldn't get a timeout with driver.get
      • energizer
        yeah http
      • dude-x
        are you getting a Timeout error on waiting for staleness?
      • energizer
        dude-x: yeah, watching the browser it never goes to the next page
      • dude-x
        does it at least open the first page?
      • energizer
        ya
      • dude-x
        show me the stacktrace
      • energizer
      • dude-x
        your code should work in theory
      • so it loads the first page, clicks save, and then goes on to the next URL where it times out?
      • energizer ^
      • energizer
        dude-x: ya never leaves that page
      • after saving
      • dude-x
        so the click succeeds the first time?
      • can i see the two of the real URLs?
      • are you sure it's a brand new web page?
      • energizer
        i cant share the urls, but they are different
      • dude-x
      • and the blah's differ?
      • energizer
      • and the 123s differ
      • the pages are all exactly the same tho, just with different file in the download
      • i wonder if i could use `is` instead of `==`
      • dude-x
        for?
      • it's quite possible that the page isn't changing itself because it's cached but it's only changing the resource
      • so in that case
      • I wouldn't use that context manager per se
      • energizer
        (nm re `==`, that was from an earlier version before i had staleness_of)
      • dude-x
        you can wait for url to equal the new url
      • driver.current_url == 'image_page_url' or <url snippet> in driver.current_url
      • energizer
        instead of staleness_of, right?
      • dude-x
        yeah
      • i suspect the page itself is not updating due to caching
      • smccarth_ joined the channel
      • energizer
        so probably i want browser.current_url != old_page.url
      • dude-x
        there's an image site i look at that has the latest memes or whatever; if i hit refresh and there's no new content. nothing gets reloaded
      • and when there is new content, i only see a partial update of the page
      • energizer
        times out on browser.get again https://dpaste.de/1m3M
      • dude-x:
      • stryx` joined the channel
      • dude-x
        line 6 should be lambda b: b.current_url != old_url
      • energizer
        wouldnt think that'd make a difference, its the same object, no?
      • ya no difference
      • dude-x
        well let's try the simplest case
      • don't use the context manager
      • add a time.sleep(2) before a browser.get
      • energizer
        i can replace the context manager with time.sleep(3) and it works fine
      • dude-x
        okay.
      • don't know why html is not going stale ...
      • energizer
        ill try running it manually in ipython
      • dude-x
        or why current url doesn't change.
      • kggr joined the channel
      • do you see the URL changing?
      • sometimes sites rewrite the URL
      • duderono_ has quit
      • energizer
      • that `==` is False
      • when i run it manually, one line at a time
      • dude-x
        oh that makes sense.
      • you want it to be equal to true.
      • browser.current_url != old_url
      • but isn't that what you had last time?
      • oh
      • so the current url and the so called old url don't match?
      • energizer
        this result is inconsistent with the failure from before
      • right
      • dude-x
        so they should be the same URL?
      • energizer
        after the page changes, which it does when using time.sleep or manual stepping, the url changes too
      • dude-x
        so the initial url you go to, changes again anyway?
      • energizer
        well the string old_url doesnt change once assigned
      • dude-x
        so another technique is to tag a page
      • energizer
        whats that
      • dude-x
        using execute_script(), you set an attribute to HTML
      • energizer
        and then hopefully it'll go away
      • but i dont see how it would if inside the program html isnt changing and current_url isnt changing,
      • dude-x
        then wait for that element to go away like WebDriverWait(browser, timeout).until(element_disappears('css selector', 'html[mytag]')
      • then tag the image itself if the page is remaining constnat
      • energizer
        i dont know how to get the image
      • the download button runs js
      • dude-x
        you can still inspect the lement and look for an img tag
      • energizer
        not there
      • dude-x
        just add an attribute to the image tag
      • oh rght javascript is obscuring it
      • is there some thing on the page that gets updated and it's not obscured by javascript
      • energizer
        i dont think so
      • browser.execute_script(f"arguments[0].setAttribute('tag', {uuid.uuid()}", html_element)
      • dude-x: like that?
      • dude-x
        i guess that works
      • yeah
      • it doesn't have to be a uuid
      • duderonomy joined the channel
      • energizer
        browser.execute_script( f"arguments[0].setAttribute('tag', {uuid.uuid1()}", html_element
      • )