← Back to team overview

sikuli-driver team mailing list archive

[Question #665575]: Unable to load the Selenium jar file in the common file

 

New question #665575 on Sikuli:
https://answers.launchpad.net/sikuli/+question/665575

I am working on automating one of the web module of windows based Application. 
Windows client has automaleted scripts in the sikuli ide. There is a common file which has all the functions which are called quite often by various modules(Web and win). 
I have been able to import the selenium jar file and automate a few web modules. In each folder of the webmodule test case I have to add the selenium .jar file , which isn't very efficient way of doing things.And  also there is  a lot of redundant code in the  files e.g the following lines have to be added in all the web module test cases :
l
load("selenium-server-standalone-3.0.1.jar")
import org.openqa.selenium.chrome.ChromeDriver as CD
import org.openqa.selenium.chrome.ChromeOptions as CO
import org.openqa.selenium.chrome.ChromeDriverService as CS
import org.openqa.selenium.remote.DesiredCapabilities as DC
import org.openqa.selenium.By as By
import org.openqa.selenium.interactions 
import org.openqa.selenium.support.ui.Select as Select
import org.openqa.selenium.support
import org.openqa.selenium.WebDriver as WD
import org.openqa.selenium.WebElement
import java.util.concurrent.TimeUnit as TimeUnit
import java.util.Arrays as Arrays
import java.lang
import java.lang.System as System

options = CO()
capability=DC.chrome()
System.setProperty('webdriver.chrome.driver', 'Chromedriver.exe')
capability.setCapability('chrome.switches', Arrays.asList('–disable-extensions'))
capability.setCapability('chrome.binary', 'C:/Users/user_name/AppData/Local/Google/Chrome/Application/chrome.exe')
options.addArguments('user-data-dir=C:/Users/user_name/AppData/Local/Google/Chrome/User Data/Default')
options.addArguments('--auth-server-whitelist=*wfmrc1*')
driver = CD(capability)
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS)


I wanted to move the above code into the common file.
Unfortunately I cant do that without moving the selenium  jar file in the common folder as well.Not only that I have to move the Selenium jar file in all the modules' folders which are using the common file regardless of them being web based or windows based.and we have 100's of folders with the sikuli script. It wouldn't be wise to move the selenium. jar to all of those folders. 

I wonder why does it have to be this way? Is this a bug related to sikuli ? Or was it by design :D 

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.