Arquillian Garphene, page loaded but unable to launch javascript - java

I'm using Arquillian Graphene with Selenium 2.
The trouble is coming from the Graphene.guardNoRequest(); method.
The error thrown is :
java.lang.RuntimeException: org.openqa.selenium.WebDriverException:
Can't execute JavaScript before a page has been loaded!
Build info: version: '2.25.0', revision: '17482', time: '2012-07-18 22:18:01'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_43'
I've also tried to get elements to assert that they exist, i've catched the page source and everything seems to be ok. I've tried to put a wait like
wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("selector here")));
Someone has/had the same struggle?
UPDATE : Problem solved
I've solved this problem, but i need some time to make a clear explain about what happens and what's my solution

Related

Unable to create driver instance for Edge driver

Code is working fine for chrome but for Edge I'm facing issue
I have set below properties in application.properties file
driver.name=edgeDriver
webdriver.edge.driver = drivers/msedgedriver.exe
I have also downloaded edgedriver.exe as per current version of my edge browser
Edge Version : Version 89.0.774.63
When I am trying to execute the test I am seeing below messages in console log
Unable to get class
com.qmetry.qaf.automation.step.client.TestStepExporter from jar
/C:/Users/piyush/.m2/repository/com/qmetry/qaf/3.0.0/qaf-3.0.0.jar
[QAFTestBase] - Initializing
Driver...browser_str:edgeDriver,base_url:https://qmetry.github.io/qaf/,sel_server:localhost,port:4444
[UiDriverFactory] - Driver: edgeDriver Mar 26, 2021 3:25:36 PM
org.openqa.selenium.remote.DesiredCapabilities edge INFO: Using new EdgeOptions() is preferred to DesiredCapabilities.edge()
Unable to create driver instance in 1st attempt with retry timeout of
30 seconds. You can check/set value of 'driver.init.retry.timeout'
appropriately to set retry timeout on driver initialization
failure.Unable to Create Driver Instance for edge:
java.lang.NoSuchMethodException:
org.openqa.selenium.edge.EdgeDriver.(java.net.URL,
org.openqa.selenium.Capabilities)
Build info: version: '3.141.59', revision: 'e82be7d358', time:
'2018-11-14T08:17:03'
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version:
'10.0', java.version: '11.0.10'
Driver info: driver.version: unknown
Referred to how to use edgeDriver with qaf
it seems the property webdriver.edge.driver should be appended with "system" prefix. That means:
system.webdriver.edge.driver = drivers/msedgedriver.exe
After this, Page launched successfully

how to fix 'java.net.SocketTimeoutException: Read timed out" issue when jenkins job is building

I have a Jenkins job which runs daily automation suite which takes nearly 3.5 hours .But I'm facing a sporadic issue which occurs time to time but not regularly as mentioned below. When this error occurred my job is hanging for several hours and tests are failing. so I would like to know the reason for this and please help me if there's a solution for this.
Error:
DEBUG 2019-05-15 20:45:36,121 [main] com.wso2telco.tests.apimanager.base.BasicTestObject - Exception While Initializing browser 'openBrowser()'java.net.SocketTimeoutException: Read timed out
Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T15:28:36.4Z'
System info: host: 'ip-10-0-0-145', ip: '10.0.0.145', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-1072-aws', java.version: '1.8.0_111'
Driver info: driver.version: FirefoxDriver

org.openqa.selenium.ElementNotVisibleException: element not interactable

Not able to click on any button in the application.
Error stack trace:
org.openqa.selenium.ElementNotVisibleException: element not interactable
(Session info: chrome=73.0.3683.103)
(Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: '3.10.0', revision: '176b4a9', time: '2018-03-02T19:03:16.397Z'
System info: host: 'SHIPAWAR-54Q9D', ip: '10.65.75.122', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_60'
Driver info: org.openqa.selenium.chrome.ChromeDriver
I tried java script executor, actions class but none of them worked
public void clickHERE(String deal) throws Throwable{
javaScriptClick(driver, HERE);
driver.findElement(By.xpath(enterDeal)).sendKeys(deal);
Thread.sleep(5000);
int ok_size=driver.findElements(By.cssSelector("[name=SearchDeal]")).size();
System.out.println("the search button size:" +ok_size);
driver.findElement(By.xpath(enterDeal)).sendKeys(Keys.ENTER);
Thread.sleep(5000);
scrollToElement(driver, nextTabDealInfo);
driver.findElement(By.xpath(nextTabDealInfo)).click(); // this button in not working
}
should be able to click the button.
nextTabDealInfo is the xpath:
//*[#type='button' and contains(#value,'Next Tab')]
HTML for button:
<input type="button" name="fromOptyInfoTab" value="Next Tab >" onclick="return switchTabs('nonStandardInfo.do');" class="buttonNextTab">
This error message...
org.openqa.selenium.ElementNotVisibleException: element not interactable
.
System info: host: 'SHIPAWAR-54Q9D', ip: '10.65.75.122', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_60'
...implies that the ChromeDriver was unable to communicate with the Chrome Browser session.
Your main issue is the incompatibility between the version of the binaries you are using as follows:
Your Selenium Client version is 3.10.0 of 2018-03-02T19:03:16.397Z which is almost an year older.
Your JDK version is 1.8.0_60 which is pretty old and ancient.
So there is a clear mismatch between the JDK v8u60 , Selenium Client v3.10.0
Solution
Upgrade JDK to recent levels JDK 8u202.
Upgrade Selenium to current levels Version 3.141.59.

Getting "Aw! Snap" issue in Execution of Selenium Automation Suite in Chrome

I am using google chrome driver to automate using selenium. Chrome window always gets crashed in middle of execution when I try to navigate to some other URL. Please note that I get this error only when I try to navigate to same url for the 15th times i.e it works fine till 14th. I am done with upgrading/degrading chrome web driver.
Details:
os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_171'
ChromeDriver 2.38.552522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb) on port 9319
Update: Guys, I do not get same issue when I create separate instance of chrome driver for each time when I navigate to URL.

How to run selenium test scripts in android browser

How to run selenium test scripts in android browser
I am getting an error message stating
org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. Build info: version: '2.32.0', revision: '6c40c18', time: '2013-04-09 17:22:56'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_07'
as a prerequisites, I have successfully installed webDriver APK
adb -s 4df7e035582e21e3 forward tcp:8080 tcp:8080
but while running my test scripts it throws the above mentioned error "Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure"
Can any one help me out
Please
Thanks

Categories