wrong timeStamp for rAF in PhantomJS browser - phantomjs

I used phantomJS browser for my test scripts and used requestAnimationFrame(rAF) for animation process. When I start the test script in phantomJS, the timeStamp gets wrong values in rAF. But it works fine in other browsers.
Refer the various timeStamp value as below
phantomJS: 1486032943535.4844
chrome: 3918.8199997879565
firefox: 2997.8451083288005
How to fix this issue in phanthomjs?

Related

Automatically disable browser cache in chrome while running tests using protractor

I am trying to run tests using protractor but i need to disable the browser cache in order to test some things. I do not want chrome to load the resources from browser cache instead i want it it to send the requests to server and download them. I have tried the following options as part of protractor capabilities but nothing seems to be working,
'--disable-cache',
'--disable-application-cache',
'--disable-offline-load-stale-cache',
'--disk-cache-size=0'```
what if you just run the tests in incognito? that shouldn't save nor reuse the cache
you can do it by passing --headless to chrome args

Selenium/Katalon can not get webelement's text when running in jenkins or headless

I have a button's text <span _ngcontent-c4="" class="btn__text">FOO</span>
When running Katalon (6.3.3) test localy everything is ok, but when running in jenkins the text FOO is loaded as empty string.
To capture the FOO text I'm using:
WebUI.verifyElementText(findTestObject('TC01/header/button_FOO'), "FOO")
Even when converting the element to org.openqa.selenium.WebElement and use element.getText(), local run get the text FOO just fine and in jenkins:
ERROR c.k.k.core.keyword.internal.KeywordMain - ? Actual text '' and expected text 'FOO' of test object 'Object Repository/TC01/header/button_FOO' are NOT matched.
Testing page title same way works fine even in jenkins run.
In jenkins image is Google Chrome 79.0.3945.88 and ChromeDriver 79.0.3945.36
In local machine is Chrome 79.0.3945.88 and ChromeDriver 79.0.3945.36
The jenkins image is linux and I'm on Win 10.
After I added argument --headless, problem started to occure on local run as well.
Solved with adding argument --window-size=1920x1080.
Now works fine even in jenkins.

Selenium works in chrome normally but does not work with chrome headless

I have a simple test created from selenium IDE and I have saved it as a .side file
In my cmd i execute the command: selenium-side-runner C:\path\to\file\prueba2.side and the test is successful.
But when I run the test with chrome headless with the command: selenium-side-runner -c "goog:chromeOptions.args=[headless]" C:\path\to\file\prueba2.side it throws the following error:
TimeoutError: Waiting for element to be located By (css selector, div:
nth-child (2)> .rc .LC20lb) Wait timed out after 15163ms
I tried to solve the problem by adding a pause of 5 seconds before the line that generated the problem is executed but it did not work, throws the same problem.
In the following link I found the solution: https://medium.com/#griggheo/running-selenium-webdriver-tests-using-firefox-headless-mode-on-ubuntu-d32500bb6af2
When we use the browser headless mode we must change the instruction find_element_by_id for find_element_by_xpath because the browser in headless mode sometimes does not find the element by id but by XPath
You could try adding the --nogpu argument to your chromeOptions. I've had to use that before to get headless working properly.
selenium-side-runner -c "goog:chromeOptions.args=[--headless,--nogpu]" C:\path\to\file\prueba2.side
I know I am a little late, but ...
For me it works if I specify the browserName like this:
selenium-side-runner -c "broswserName=chrome goog:chromeOptions.args=[-headless]" C:\path\to\file\prueba2.side
Normally you do not have to say that you use chrome, because it is the default, but the moment I started using the "-c" flag, I had to specify the name.

Selenium Test Results are empty [duplicate]

I'm trying to run an HTML testSuite with Selenium RC. The browser starts, the first test runs, and it stops. It doesn't continue to the second test case. I named both the test cases with .html extension. I am using Firefox.
If I run them manually, individually from the selenium RC test runner window they run ok. What am I missing, this seems pretty simple but yet I'm not able to get this working.
I am using Selenium RC 1.0.3
java -jar selenium-server.jar
-firefoxProfileTemplate"C:\Users\sicky\AppData\Roaming\Mozilla\Firefox\Profiles\zvt0jj7c.default"
-htmlsuite "*firefox" "https://4.17.8.9/" "C:\Users\sicky\Documents\selenium scripts\suite.html"
"C:\Users\sicky\Documents\selenium scripts\results.html"
What am I missing?
ok I figured this out. What I was doing was , I was converting the existing scripts into HTML. Apparently it doesnt work that way. It looks like I have to name them with html extension when I make those test cases itself, then the whole suite will run –
Actually I had the same behaviour and my test scripts were in fact created in Selenium IDE and had the proper .html extension.
However! The test suite itself didn't have the .html extension. I just added it and it started working properly.

selenium RC doesnt run the whole test suite

I'm trying to run an HTML testSuite with Selenium RC. The browser starts, the first test runs, and it stops. It doesn't continue to the second test case. I named both the test cases with .html extension. I am using Firefox.
If I run them manually, individually from the selenium RC test runner window they run ok. What am I missing, this seems pretty simple but yet I'm not able to get this working.
I am using Selenium RC 1.0.3
java -jar selenium-server.jar
-firefoxProfileTemplate"C:\Users\sicky\AppData\Roaming\Mozilla\Firefox\Profiles\zvt0jj7c.default"
-htmlsuite "*firefox" "https://4.17.8.9/" "C:\Users\sicky\Documents\selenium scripts\suite.html"
"C:\Users\sicky\Documents\selenium scripts\results.html"
What am I missing?
ok I figured this out. What I was doing was , I was converting the existing scripts into HTML. Apparently it doesnt work that way. It looks like I have to name them with html extension when I make those test cases itself, then the whole suite will run –
Actually I had the same behaviour and my test scripts were in fact created in Selenium IDE and had the proper .html extension.
However! The test suite itself didn't have the .html extension. I just added it and it started working properly.