selenium-tests + Sauce OnDemand

17 views
Skip to first unread message

Kohsuke Kawaguchi

unread,
Nov 13, 2012, 10:16:28 PM11/13/12
to Jenkins Dev

This is mostly to Tyler.

I got Sauce OnDemand support added to selenium-tests, but it's not
working as expected.

I get to the code that tries to install a plugin, which is in
pluginmanager.rb,

> find(:xpath,"//input[starts-with(@name,'plugin.#{name}.')]").click()

and the above code does find the right element (can be verified by
looking at its name attribute), and click() call doesn't fail, but the
checkbox doesn't actually get checked.

I've used pry to poke around a bit, and when I "find" different
elements, I can see that the browser scrolls in Sauce, but it's not
showing the right element in the screen.

I wonder if somehow we need to make sure that the element in question is
placed in the middle of the page before it's clicked.

The same test works fine locally with Firefox.

--
Kohsuke Kawaguchi http://kohsuke.org/

Kohsuke Kawaguchi

unread,
Nov 13, 2012, 10:39:20 PM11/13/12
to Jenkins Dev
I tried all sorts of things but still failing. Including:

- using newer Firefox 16
- hide the floating breadcrumb via execute_script and set it to display:none
- window.scrollBy(0,-50) for a similar reason

What gives?

2012/11/13 Kohsuke Kawaguchi <k...@kohsuke.org>:
--
Kohsuke Kawaguchi

R. Tyler Croy

unread,
Nov 14, 2012, 11:28:49 AM11/14/12
to jenkin...@googlegroups.com

On Tue, 13 Nov 2012, Kohsuke Kawaguchi wrote:

> I tried all sorts of things but still failing. Including:
>
> - using newer Firefox 16
> - hide the floating breadcrumb via execute_script and set it to display:none
> - window.scrollBy(0,-50) for a similar reason
>
> What gives?


By default Sauce Labs defaults to using a pretty old-ass version of Selenium,
so regardless of the version of browser you use, you'll be using an old as dirt
version of Selenium.


Sauce.config do |c|
c['selenium-version'] = '2.18.0'
end


Should bring you up to the version of Selenium we use at Lookout, you can also
try 2.19, or other versions: <https://saucelabs.com/docs/additional-config#selenium-version>

- R. Tyler Croy
--------------------------------------
Code: https://github.com/rtyler
Chatter: https://twitter.com/agentdero
signature.asc

Kohsuke Kawaguchi

unread,
Nov 14, 2012, 12:33:30 PM11/14/12
to jenkin...@googlegroups.com, R. Tyler Croy

According to their documentation, that was their default version [1].
Bumping up to a newer version to 2.25.0 (which is what I was using
locally) didn't help.

In the end I did a brute force workaround of scrolling 50 pixels up to
put it firmly in the visible region. IOW, I didn't get to the bottom of
the issue, but I'll leave it at this.


[1] https://saucelabs.com/docs/additional-config#selenium-version
Reply all
Reply to author
Forward
0 new messages