
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

Real-time applications come with real challenges—persistent connections, multi-server deployment, and strict performance requirements are...
New

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

Consider this Erlang code:
Rectangle = {rectangle, 20, 10}.
{rectangle, Width, Height} = Rectangle.
> Width.
20
> Height.
10
When...
New

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

Does anybody have good learning resources with regards to going into Event Driven Design, Architecture or Sourcing?
I got recommended Er...
New

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

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

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

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

Leverage Elixir and the Nx ecosystem to build intelligent applications that solve real-world problems in computer vision, natural languag...
New
Other popular topics

Which, if any, games do you play? On what platform?
I just bought (and completed) Minecraft Dungeons for my Nintendo Switch. Other than ...
New

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

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

“A Mystical Experience” Hero’s Journey with Paolo Perrotta @nusco
Ever wonder how authoring books compares to writing articles?...
New

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

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

Author Spotlight
Rebecca Skinner
@RebeccaSkinner
Welcome to our latest author spotlight, where we sit down with Rebecca Skinner, auth...
New

If you want a quick and easy way to block any website on your Mac using Little Snitch simply…
File > New Rule:
And select Deny, O...
New

Author Spotlight:
Tammy Coron
@Paradox927
Gaming, and writing games in particular, is about passion, vision, experience, and immersio...
New

This is cool!
DEEPSEEK-V3 ON M4 MAC: BLAZING FAST INFERENCE ON APPLE SILICON
We just witnessed something incredible: the largest open-s...
New
Latest in Backend
Latest (all)
Categories:
Popular Portals
- /elixir
- /opensuse
- /rust
- /kotlin
- /ruby
- /erlang
- /python
- /clojure
- /react
- /quarkus
- /go
- /react-native
- /vapor
- /v
- /wasm
- /django
- /security
- /nodejs
- /centos
- /rails
- /haskell
- /fable
- /swift
- /gleam
- /deno
- /js
- /tailwind
- /laravel
- /assemblyscript
- /symfony
- /phoenix
- /crystal
- /typescript
- /debian
- /adonisjs
- /julia
- /arch-linux
- /svelte
- /spring
- /c-plus-plus
- /preact
- /flutter
- /actix
- /java
- /angular
- /ocaml
- /kubuntu
- /zig
- /scala
- /zotonic
- /vim
- /rocky
- /lisp
- /html
- /keyboards
- /emacs
- /nim
- /vuejs
- /nerves
- /elm