jeya

jeya

Pytest: test fails while getting URL

Dear Geeks
I am new to pytest. I am following a youtube channel. I am writing the same code.
learning to test login functionality of an ecommerce application
i have written testcase file. please have a look at it. while running the testcase i am getting error in the line self.driver.get(self.baseURL)
error messaeg
test_login.py:10 (Test_001_Login.test_homePageTitle)
self = <testCases.test_login.Test_001_Login object at 0x000001CC152D38E0>

def test_homePageTitle(self):
    self.driver=webdriver.Chrome()
self.driver.get(self.baseURL)

it is blocking to move further learning as it is the first test
The original code ::
import pytest
from selenium import webdriver
from pageObjects.LoginPage import LoginPage

class Test_001_Login:
baseURL = “Your store. Login
username="admin@yourstore.com"
password=“admin”

def test_homePageTitle(self):
    self.driver=webdriver.Chrome()
    self.driver.get(self.baseURL)
    actual_title=self.driver.title
    if actual_title=="Your store. Login":
        assert True
        self.driver.close()
    else:
        assert False
        self.driver.close()

def test_Login(self):
    self.driver=webdriver.Chrome()
    self.driver.get(self.baseURL)
    self.lp=LoginPage(self.driver)
    self.lp.setUserName(self.username)
    self.lp.setPassword(self.password)
    self.lp.clickLogin()
    actual_title=self.driver.title
    if actual_title == "Dashboard / nopCommerce administration":
        assert True
        self.driver.close()
    else:
        assert False
        self.driver.close()

Thank you

Popular Backend topics Top

PragmaticBookshelf
Real-time applications come with real challenges—persistent connections, multi-server deployment, and strict performance requirements are...
New
PragmaticBookshelf
Ruby, Io, Prolog, Scala, Erlang, Clojure, Haskell. With Seven Languages in Seven Weeks, by Bruce A. Tate, you’ll go beyond the syntax—and...
New
AstonJ
Consider this Erlang code: Rectangle = {rectangle, 20, 10}. {rectangle, Width, Height} = Rectangle. &gt; Width. 20 &gt; Height. 10 When...
New
Kurisu
Hello and happy new year! I would like to buy a Ruby On Rails ebook for learning purpose. What would be the ROR equivalent of “Programm...
New
ohm
Does anybody have good learning resources with regards to going into Event Driven Design, Architecture or Sourcing? I got recommended Er...
New
GermaVinsmoke
Reading Programming Elixir 1.6 book, I’ve completed part 1 of the book. Now I’m thinking of reading Elixir in Action. What do you all sug...
New
OvermindDL1
Woooooooo! This is such a huge release for it, and 2 years incoming! In short, the library is now using an updated hyper backend (not j...
New
mafinar
I did not add this to a “this weekend I’ll learn” like my few other journals as I am decided on using this in the long term. Last I work...
New
JimmyCarterSon
I am following this tutorial . I have followed carefully correcting errors as I go. The app allows you to create a blog post and add comm...
New
PragmaticBookshelf
Leverage Elixir and the Nx ecosystem to build intelligent applications that solve real-world problems in computer vision, natural languag...
New

Other popular topics Top

ohm
Which, if any, games do you play? On what platform? I just bought (and completed) Minecraft Dungeons for my Nintendo Switch. Other than ...
New
AstonJ
Just done a fresh install of macOS Big Sur and on installing Erlang I am getting: asdf install erlang 23.1.2 Configure failed. checking ...
New
AstonJ
I ended up cancelling my Moonlander order as I think it’s just going to be a bit too bulky for me. I think the Planck and the Preonic (o...
New
PragmaticBookshelf
“A Mystical Experience” Hero’s Journey with Paolo Perrotta @nusco Ever wonder how authoring books compares to writing articles?...
New
AstonJ
We’ve talked about his book briefly here but it is quickly becoming obsolete - so he’s decided to create a series of 7 podcasts, the firs...
New
AstonJ
Was just curious to see if any were around, found this one: I got 51/100: Not sure if it was meant to buy I am sure at times the b...
New
PragmaticBookshelf
Author Spotlight Rebecca Skinner @RebeccaSkinner Welcome to our latest author spotlight, where we sit down with Rebecca Skinner, auth...
New
AstonJ
If you want a quick and easy way to block any website on your Mac using Little Snitch simply… File &gt; New Rule: And select Deny, O...
New
PragmaticBookshelf
Author Spotlight: Tammy Coron @Paradox927 Gaming, and writing games in particular, is about passion, vision, experience, and immersio...
New
AstonJ
This is cool! DEEPSEEK-V3 ON M4 MAC: BLAZING FAST INFERENCE ON APPLE SILICON We just witnessed something incredible: the largest open-s...
New