I am using selenium-cucumber-js library
i have following issues
want to check local-Storage in test how Can I do that?
Am I able to access the window object?
How can run this with Headless?
Thanks
1 & 2) This can be done using pure javascript as far as I know. There is a query and it has been responded in the repo here.
3) You can replace start-maximized with --headless in this line.
Related
Error description -
java.lang.IllegalArgumentException: The class org.openqa.selenium.remote.RemoteWebDriver of the given context doesn't implement io.appium.java_client.FindsByIosNSPredicate nor io.appium.java_client.FindsByFluentSelector. Sorry. It is impossible to find something
Please help me if someone have any idea about it.
will add more details, if someone wants.
Looks like the element locator strategy FindsByIosNSPredicate and FindsByFluentSelector is not being captured by the default appium version. Can you try explicitly mentioning the appium version capability and pass the same as passed while executing your tests locally on a real device. You may refer to this: https://www.browserstack.com/automate/capabilities or https://www.browserstack.com/app-automate/capabilities ( for App )
I am using `TestCafe` to test our Electron app and need a way to know when the last test in a fixture has been executed BUT before `TestCafe` shuts our app down.
The standard hooks *(fixture.after, fixture.afterEach)* won't work. In particular, fixture.after won't work as it is called BETWEEN test runs (the test app will have been shutdown) and I need my app to still be around.
If I can get the number of tests active for this test run in the fixture I can count the runs myself and then call my custom code on the last test. If there is another way to do this that would be appreciated as well.
Any insights appreciated,
m
You can create a special 'teardown' fixture, place all necessary code into it, and pass it at the end of the test file list:
testcafe chrome tests/* teardown.js
Take a look at the testcafe-once-hook module which allows you to execute test actions once per fixture. Here is an example how to use it: https://github.com/AlexKamaev/testcafe-once-hook-example.
I have a jenkins job that makes an XML request and returns an answer. From this answer I have a string I need on nightwatch to start the tests.
Does anyone know how I can send this string to nightwatch? Maybe via a command line argument? But how to read it next?
Since you're using a NodeJS-based framework, why not make use of a process.env variable?
Suppose you need to tell your script what environment you want to run your checks agains. Let's call our system variable ENV. Your command will become:
ENV=prod nightwatch nightwatch.conf.js --yourOtherSwitches
In your page-objects/feature-files, you call the variable using process.env.ENV.
js.executeScript("document.querySelector('input[name='password']');");
This line is throwing the following Exception in thread:
"main" org.openqa.selenium.WebDriverException: missing ) after argument list
Try the following code.
js.executeScript("document.querySelector('input[name=\'password\']')");
Try
js.executeScript("document.querySelector('input[name='password']')");
Let me know if this Answers your Question.
You can try one of the following
js.executeScript("document.querySelector(\'input[name=\'password\']\');");
js.executeScript("document.querySelector(\"input[name='password']\");");
Although in your comments you added this line
js.executeScript("document.querySelector('input[name=\'password\']').value='gamb'");
Which wouldn't work because if you look at .value you'll need to escape your .value setting as well more than likely.
Given that I don't have access to your site or your code, I would suggest that you test to make sure your javascript is valid for your page. One way to do so would be to take the javascript itself (everything insdie the .executeScript) and run it through your browsers dev tools console or script execution window.
If the value sets using the browsers dev tools, great...issue is with selenium. If the value does not set using browser dev tools...you'll need to refactor your javascript as the problem is likely not with selenium, rather your JS selector more than likely.
Although, the following, from your comment, works...you may not need to execute it via javascript.
driver.findElement(By.cssSelector("input[name='password']")).sendKeys("gamb");
How can I get start it? Is it possible? Can you give me some simple example?
For example i use following command to launch defined tagged tests:
parallel_cucumber features/ -p [#critical]
And all tests are launched after that, including untagged.
The solution was found :
parallel_cucumber features --test-options '--tags #critical' .
Only features with tags #critical will be launched in this case.