2016-09-12 9 views
0

私はキュウリを使ってテストフレームワークを開発しましたが、WebDriverのActionsクラスを使用してマウスを動かしたりクリックしたりしています。 )、それは期待どおりに動作し、同じ私もジェンキンスで仕事を作成し、私は私の仕事を実行すると、この機能は期待どおりに動作しません。 、RemoteWebdriverを使用してアクションクラスが動作しません

@FindBy(how = How.CSS, using = ".poster>img") 
    public static WebElement image; 

public void Trailor() throws InterruptedException{ 
     Actions action=new Actions(driver); 
     action.moveToElement(image).perform(); 
     Thread.sleep(2000); 

Jenkins Exception:- 

    T E S T S 
------------------------------------------------------- 

Feature: Test PVRCinemas.com NOW SHOWING Functionality 
Running Scenario: NOW SHOWING Flow 

Sep 13, 2016 12:04:02 PM org.bridj.BridJ log 
INFO: Registering type org.sikuli.util.SysJNA$WinKernel32 
Sep 13, 2016 12:04:02 PM org.bridj.BridJ log 
INFO: Registering type org.bridj.TimeT 
Sep 13, 2016 12:04:03 PM org.bridj.BridJ log 
INFO: Registering type org.bridj.TimeT$timeval_customizer 
Sep 13, 2016 12:04:03 PM org.bridj.BridJ log 
INFO: Registering type org.bridj.StructIO$DefaultCustomizer 
Sep 13, 2016 12:04:03 PM org.bridj.BridJ log 
INFO: Registering type org.bridj.TimeT$timeval 
Sep 13, 2016 12:04:03 PM org.bridj.BridJ log 
INFO: Registering type org.bridj.StructObject 
Sep 13, 2016 12:04:03 PM org.bridj.BridJ log 
INFO: Registering type org.bridj.NativeObject 
Sep 13, 2016 12:04:03 PM org.bridj.BridJ log 
INFO: Registering type org.bridj.AbstractIntegral 
Sep 13, 2016 12:04:03 PM org.bridj.BridJ log 
INFO: Registering type java.lang.Number 
[error] Location: outside any screen (26136544, 0) - subsequent actions might not work as expected 
[error] Location: outside any screen (26136768, 0) - subsequent actions might not work as expected 

[error] Location: outside any screen (26136768, 0) - subsequent actions might not work as expected 
[error] Location: outside any screen (26136384, 0) - subsequent actions might not work as expected 
[error] RobotDesktop: checkMousePosition: should be L(26136768,0) 
but after move is L(26136384,0) 
Possible cause in case you did not touch the mouse while script was running: 
Mouse actions are blocked generally or by the frontmost application. 
You might try to run the SikuliX stuff as admin. 

share location browser pop up not found 

click on Now Showing tab 

    Background:           [90m# J_NowShowing.feature:3[0m 
    [32mWhen [0m[32mNavigate to PVRCinemas.com and share location[0m [90m# Cinemas.navigate_to_PVRCinemas_com_and_share_location()[0m 
    [32mThen [0m[32mclick on Now Showing tab[0m      [90m# NowShowing.click_on_Now_Showing_tab()[0m 

Get all the movie count of movies which are visible 
prior displayed false 
prior enabled true 

after displayed false 
after enabled true 

Tests run: 4, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 149.629 sec <<< FAILURE! - in Scenario: NOW SHOWING Flow 
Then Click on Trailor of movie(Scenario: NOW SHOWING Flow) Time elapsed: 0.043 sec <<< ERROR! 
org.openqa.selenium.ElementNotVisibleException: 
Element is not currently visible and so may not be interacted with 
Command duration or timeout: 20.15 seconds 
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46' 
System info: host: 'HT', ip: '192.168.56.1', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.7.0_55' 
Session ID: 3c8dbc9c-514d-4da8-8616-bd61431b6fbb 
Driver info: org.openqa.selenium.firefox.FirefoxDriver 
Capabilities [{platform=WINDOWS, acceptSslCerts=true, javascriptEnabled=true, cssSelectorsEnabled=true, databaseEnabled=true, browserName=firefox, handlesAlerts=true, nativeEvents=false, webStorageEnabled=true, rotatable=false, locationContextEnabled=true, applicationCacheEnabled=true, takesScreenshot=true, version=44.0.2}] 
Caused by: org.openqa.selenium.ElementNotVisibleException: 
Element is not currently visible and so may not be interacted with 
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46' 
System info: host: 'HT', ip: '192.168.56.1', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.7.0_55' 
Driver info: driver.version: unknown 

Running Scenario: NOW SHOWING Flow 
[34mCurrent Page URL is http://www.pvrcinemas.com/[0m 

    Scenario: NOW SHOWING Flow         [90m# J_NowShowing.feature:7[0m 
    [32mGiven [0m[32mGet all the movie count of movies which are visible[0m [90m# NowShowing.get_all_the_movie_count_of_movies_which_are_visible()[0m 
    [31mThen [0m[31mClick on Trailor of movie[0m       [90m# NowShowing.click_on_Trailor_of_movie()[0m 
     [31morg.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with 
     Command duration or timeout: 20.15 seconds 
     Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46' 
     System info: host: 'HT', ip: '192.168.56.1', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.7.0_55' 
     Session ID: 3c8dbc9c-514d-4da8-8616-bd61431b6fbb 
     Driver info: org.openqa.selenium.firefox.FirefoxDriver 
     Capabilities [{platform=WINDOWS, acceptSslCerts=true, javascriptEnabled=true, cssSelectorsEnabled=true, databaseEnabled=true, browserName=firefox, handlesAlerts=true, nativeEvents=false, webStorageEnabled=true, rotatable=false, locationContextEnabled=true, applicationCacheEnabled=true, takesScreenshot=true, version=44.0.2}] 
     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) 
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 
     at java.lang.reflect.Constructor.newInstance(Constructor.java:526) 
     at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206) 
     at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158) 
     at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678) 
     at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:327) 
     at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:85) 
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
     at java.lang.reflect.Method.invoke(Method.java:606) 
     at org.openqa.selenium.support.pagefactory.internal.LocatingElementHandler.invoke(LocatingElementHandler.java:51) 
     at com.sun.proxy.$Proxy21.click(Unknown Source) 
     at pageObject.NowShowingPage.Trailor(NowShowingPage.java:100) 
     at stepdefinitions.NowShowing.click_on_Trailor_of_movie(NowShowing.java:35) 
     at ?.Then Click on Trailor of movie(J_NowShowing.feature:9) 
     Caused by: org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with 
     Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46' 
     System info: host: 'HT', ip: '192.168.56.1', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.7.0_55' 
     Driver info: driver.version: unknown 

助けてください、私はまた、暗黙的および明示的な待機を試してみましたが、同じことはジェンキンスジョブを実行することによって動作しません - :それは以下

が私のコードでエラー「openqa.selenium.ElementNotVisibleException」をスロー上記と同じ例外がスローされます。

+0

要素が隠されているかどうか確認してください –

答えて

0

あなたの問題は、オブジェクトが表示されていないことと、対話できないことです。

理由は言うまでもありません。 Jenkinsがtatホスト上で実行しているのと同じユーザーとしてテストを実行して、トラブルシューティングを開始します。たぶんあなたがそれをするときに明らかなことがあるかもしれません。

関連する問題