https://cypress.io logo
searchbox
# i-need-help
a
I want to automate to get the searchbox and type tv https://www.netonnet.se/ It should be this?
Copy code
let searchproduct = "tv";
describe('NetOnNet Suite', function(){

    this.beforeEach(function(){
        cy.visit('www.netonnet.se');
    });
    if('Get Method', function(){
        cy.get('#search-form').type(searchproduct)
        cy.get('#searchSubmit').click();
});
e
if
needs to
it
and you are missing closing brackets for your test function. If you need guidance on how to get started with Cypress I'd recommend https://docs.cypress.io/guides/end-to-end-testing/writing-your-first-end-to-end-test Additionally, there's a ton of resources from the community if you need further help on how to get started.
Copy code
let searchproduct = 'tv'
describe('NetOnNet Suite', function () {
    beforeEach(function () {
        cy.visit('www.netonnet.se')
    })

    it('Get Method', function () {
        cy.get('#search-form').type(searchproduct)
        cy.get('#searchSubmit').click()
    })
})
a
I dont get any error with my brackets in studio code and Im new to Cypress. Its much harder than Selenium. It seems also Firefox get a aceptcookie-window
I have python selenium code on the automation. Is that an easy way to convert selenium to cypress?
e
From python, selenium to javascript, cypress? No there's no easy migration tool. Selenium and Cypress are pretty significantly different tools and you will likely need to rewrite tests in Cypress from scratch. Regarding "harder to use", there's a ton of online resources and I hope that as you get more exposure with Cypress you will come to appreciate all the improvements and features it has over Selenium. The Cypress documentation, for one, is a great place to start to understand the differences between the two.
3 Views