Selenium Tutorial
Wir begrüßen Sie in unserer Selenium Tutorial Sammlung. Hier finden Sie Selenium Webdriver Tutorials und Tipps zu Selenium von der Testing-Board-Redaktion und auf vielen weiteren externen Artikeln aus dem Web.
Es folgen gute Anlaufstellen und eine Lister stets aktueller Artikel von Selenium Tutorials.
Selenium Tutorial Deutsch und Englisch
Testing-Board.com Selenium Tutorials und Artikel
Selenium Webdriver Tutorial 1: Grundlagen Testautomatisierung WordPress und Basis Testframework
Dieses Selenium Tutorial soll Grundlagen in der Testautomatisierung mit Selenium am Beispiel unserer Testing-Board WordPress Website vermitteln. Dazu brauchen wir automatisierte Testskripte in Selenium und ein paar Testing-Tools drum herum. Wir nutzen Selenium Webdriver, dies wird auch Selenium 2 genannt. Endziel: Ein Hybrides Selenium Testframework, Data-Driven und Keyword-driven Neben den Grundlagen wollen wir nach und nach vermitteln, wie wir ein …Read More »Selenium Webdriver Tutorial 2: WordPress Testautomatisierung, Optimierung zum Testframework
Da wir in diesem zweiten Tutorial viel über Verbesserungen und Veränderungen unserer Testautomatisierung schreiben, ist es sinnvoll für Sie als Leser, dass vorhergehende Tutorial „Selenium Webdriver Tutorial 1“ zu kennen und den Stand des dort angelegten Selenium-Java-Projekts bis zum Ende ausprobiert zu haben. ToDo Optimierungen des Selenium Codes Eine Basis für strukturierten und wartbaren Code haben wir zum Teil in …Read More »
Externe Selenium Artikel
WWW – Externe Selenium Tutorial
- What To Learn After Selenium – What Skills has to be added for...von Mukesh Otwani am Dezember 29, 2020 um 3:00 pm
If you are someone who has learned Selenium and all other tools like maven, git, Github, Jenkins, etc then you must have questions or doubts in your mind that what should be next tool/area which you have to focus. In this post, I will guide you on what to learn after selenium and how to The post What To Learn After Selenium – What Skills has to be added for QA Career appeared first on […]
- How to Scroll into view in Selenium Webdrivervon Mukesh Otwani am November 10, 2020 um 11:01 am
A few days back when I was automating my application I got one scenario where I had so many scroll bars into the single page itself and I had to scroll all bar one by one to get specific text which I had to validate. It was a little challenging to scroll for each element. The post How to Scroll into view in Selenium Webdriver appeared first on Automation .
- How To Read And Write Excel Files In Python Using Openpyxlvon Mukesh Otwani am Oktober 28, 2020 um 1:49 pm
Reading and writing to excel files in Test Automation is very common and thanks to python which has a wide variety of libraries which allow us to do the same. These are a few of the libraries which you can use like openpyxl, pandas,xlsxwriter,pyxlsb,xlrd,xlwt, etc. In this article, I will guide you to read and The post How To Read And Write Excel Files In Python Using Openpyxl appeared first on […]
- How to handle calendar in Selenium Webdriver and web tablevon Mukesh Otwani am Oktober 28, 2020 um 11:00 am
In my recent projects, I have handled a web table and calendar multiple times and in this article, I will show you how you can handle the calendar in Selenium Webdriver using the table approach. I will use JQuery Date picker for example but you can take any example because the approach will remain the The post How to handle calendar in Selenium Webdriver and web table appeared first on […]
- How to Handle Bootstrap Dropdown in Selenium WebDrivervon Mukesh Otwani am Oktober 25, 2020 um 11:00 am
Have u ever heard about handle Bootstrap dropdown in Selenium? If no, then today you will learn 2 new things today. First one – What is bootstrap dropdown The second one- How to Select values from the bootstrap dropdown. We already have discussed how to work with traditional dropdowns and we have also explored The post How to Handle Bootstrap Dropdown in Selenium WebDriver appeared first on […]
- Handle Multiple Windows in Selenium Webdriver in Simple waysvon Mukesh Otwani am Oktober 24, 2020 um 10:00 pm
We can handle multiple windows in selenium webdriver using Switch To methods which will allow us to switch control from one window to another window. If you are working with web applications then you must have faced this scenario where you have to deal with multiple windows. If you have to switch between tabs then The post Handle Multiple Windows in Selenium Webdriver in Simple ways appeared […]
WWW – Externe Selenium Blogs und Selenium Tutorial
- 10 Good Practices in Selenium C# Automationvon Andreea Draniceanu am Januar 7, 2021 um 6:11 am
I wanted to share with you some of the good practices I learned along the way, that I wish I knew when I first started my automation testing journey. While what we call “best practice” may not apply to all projects or all people, please read on to find advice on how you can improve... The post 10 Good Practices in Selenium C# Automation appeared first on TestProject.
- Test Automation Framework Benefits – POM, Selenium Locators,...von Rex Jones II am Januar 6, 2021 um 5:44 am
In this series, we are going to dive into some benefits and examples of a Test Automation Framework. A framework is an architecture of integrated parts. Some of those integrated parts are libraries, test data, and Page Object Model (POM). For Selenium, Data-Driven and Hybrid are two popular Test Automation Frameworks: Data-Driven Framework – read values... The post Test Automation Framework […]
- Reduce Your Test Automation Costs Significantly with Open Source...von Sumon Dey am Januar 6, 2021 um 4:11 am
The COVID pandemic has not only altered the lives of millions of software professionals around the world, but it also has made many software companies think about various ways they can reduce costs and risks to preserve their production and exist in this highly competitive software industry. It is a fact that now many companies... The post Reduce Your Test Automation Costs Significantly with Open […]
- 2020 Firstsam Dezember 30, 2020 um 12:00 am
Although we aren’t sad to see 2020 go (seriously, 2020, don’t let the door hit you on the way out), we do want to acknowledge a few good things that happened this year. Specifically, we celebrated some momentous firsts that seemed worth mentioning as we look back on a year unlike any other.
- Design Patterns for High-Quality Automated Tests: Singletonvon Anton S. Angelov am Dezember 29, 2020 um 3:27 am
In the previous article from the series we discussed the Fluent Interface design pattern and achieve maximum API usability. It is implemented through method chaining (method cascading). In the current publication, I am going to share with you how to create only once your page object models and afterwards reuse them. To do that we are... The post Design Patterns for High-Quality Automated Tests: […]
- 10 Common Selenium Exceptions in C# and How to Fix Themvon Andreea Draniceanu am Dezember 28, 2020 um 6:13 am
As you start writing more and more automated tests with Selenium WebDriver, you will start encountering various exceptions. I’ll guide you through the most common Selenium exceptions and help you solve them so your C# automation framework is more reliable. Table of Contents – 10 Common Selenium Exceptions in C# and How to Fix Them... The post 10 Common Selenium Exceptions in C# and How to Fix […]
- Your Testing Journey to Skyrocket 2021 – Live Sessionsvon Meital Matsafi am Dezember 27, 2020 um 6:20 am
Start your journey to test automation success before everyone else, and make 2021 your best year ever 🚀 Whether you’re just getting started or already a testing expert, you definitely want to take part in our end of year adventure! So go ahead & save your seat for any/all of the sessions below – all... The post Your Testing Journey to Skyrocket 2021 – Live Sessions appeared first on […]
WWW – Neuste Selenium Themen auf Stackoverflow
- Unable to start e2e tesing in angular projectvon HelloWorld am Januar 8, 2021 um 11:42 am
Running e2e testing on my angular project throws. My chrome version : Version 87.0.4280.141 (Official Build) (x86_64) I have enabled auto-update in my chrome browser. Seems like the issue occurs after the browser update. ng e2eBuild info: […]
- Selenium Webdriver with Python - NoSuchWindowException after...von Adam am Januar 8, 2021 um 10:02 am
I'm trying to work with Selenium Webdriver with Python, automating the Chrome browser. In re-optimising my code, I'm trying to get rid of any time.sleep() commands and using implicit and explicit waits when possible. The part I'm stuck on is an […]
- I have 2 image upload options on web page with same xpaths how i...von nilima patil am Januar 8, 2021 um 9:54 am
I have written a script for the image upload option, On-webpage there are 2 options for image upload one is for cover image photo and the other is for profile image. I found the same XPath (//input[@type='file']) for those 2 different options. Need […]
- Problem with running automated test cases in Opera, MSEdge...von Yaryna Hapych am Januar 8, 2021 um 9:32 am
I have a problem creating automated test cases using Selenium webdriver in JS language. I cannot call the Opera and edge browsers for testing, while everything works on the Chrome and Firefox browsers. And the path to the Opera and edge web drivers […]
WWW – Letzte Selenium Changes im Trunk Branch
- Fix Flake 8 Errorsvon AutomatedTester am Januar 8, 2021 um 11:31 am
Fix Flake 8 Errors
- Documenting use of WebDriverDecorator (and simplifying...von barancev am Januar 8, 2021 um 11:08 am
Documenting use of WebDriverDecorator (and simplifying API a bit)
- Disable Bidi tests for Firefox until it reaches a release...von AutomatedTester am Januar 8, 2021 um 10:30 am
Disable Bidi tests for Firefox until it reaches a release branch
- Remove unneeded Firefox specific testsvon AutomatedTester am Januar 8, 2021 um 10:21 am
Remove unneeded Firefox specific tests
Ich habe das Tutorial „Selenium Webdriver Tutorial 1: Grundlagen Testautomatisierung WordPress und Basis Testframework“bearbeitet. Zu diesem Zweck habe ich den ChromeDriver in der Version 2.20 installiert:
String pathToChromeDriver = „.//ChromeDriver//chromedriver.exe“;
System.setProperty(„webdriver.chrome.driver“, pathToChromeDriver);
Dann rufe ich folgende URL auf:
String URL = „http://myusername:mypassword@www.testinst.testing-board.com/“;
System.out.println(URL);
Chrom1.get(URL);
Es erscheint der Login-Dialog
Hallo Christoph,
scheint doch auf einem guten Weg bei dir zu sein, schön dass dir unser Selenium Tutorial Nutzen bringt. So direkt finde ich auch gar keine Frage in deinem Kommentar, denn alles was du machst, ist ja korrekt. Ich denke mal du wunderst dich über die Abfrage mit dem Username/Passwort Dialog im Browser-Popup. Dazu erkläre ich einfach mal ein bisschen.
Also du befindest dich anscheinend gerade in folgendem Teil des Selenium Tutorials:
Exkurs: Selenium und Webserver Authentication/ HTTP-Authentifizierung / Basic Authentication
Denn du gehst auf unsere Testinstanz (erkennst du an deiner genutzt URL, dort ist „testinst.“ als Subdomain eingetragen) und du hast vorne weg in der Url Username und Passort eingetragen:
String URL = „http://myusername:mypassword@www.testinst.testing-board.com/“;
Mit der URL (www.testinst.testing-board.com) landest du somit auf unserer Testinstanz, eine Subdomain, die nicht öffentlich zugänglich ist.
Die Daten für das HTTP Basic Auth, hast du nicht, deswegen kommst du an dem Dialog nicht vorbei.
Deine Testing-Board-Login Daten kannst du an der Stelle nicht verwenden, falls du dies versucht hast, denn die HTTP Authentifizierung hat mit unserem Login auf der Webseite nicht zu tun.
Falls du HTTP Basic Auth nicht kennst, einfach mal nach „HTTP Authentifizierung“ googlen. Kurz zur Erklärung: Unsere Testinstanz soll nicht öffentlich erreichbar sein, deswegen ist sozusagen direkt beim Webserver eine Authentifizierung vorgeschaltet. Das Tutorial zeigt an der Stelle korrekt, wie man an solch einer Webserver HTTP Authentifizierung vorbei kommen würde, aber ausprobieren kannst du es leider nicht, da du die korrekten Authentifizierungs-Daten nicht hast. Um an dem Dialog vorbei zu kommen, müsstest du in deinem Selenium-Skript „myusername:mypassword“ durch korrekte Daten für unsere HTTP Basic Auth eintragen.
Was kannst du tun:
– Die Stelle in unserem Selenium Tutorial überspringen, denn alles läuft korrekt und mit korrekten Daten würdest du auch weiter kommen. Die weiteren Beispiele im Tutorial sind dann ohne HTTP Auth und sollten funktionieren.
– Unser Beispiel auf eine andere Webseite deiner Wahl übertragen, ggf. hast du eine eigene, bei der auch solch eine HTTP Basic Authentication vorgeschaltet ist. Mit dem gleichen Prinzip solltest du dort weiter kommen und kannst mal ein bisschen ausprobieren.
Viel Erfolg weiterhin!
P.S.: Du kannst auch direkt in dem betreffenden Artikel einen Kommentar hinterlassen, wenn mal Fragen dazu aufkommen. Über einen Social-Share, wenn der Artikel dir hilft, freuen sich die Autoren immer sehr.
Edit:
– Als schnelle Lösung kannst du natürlich auch „http://myusername:mypassword@www.testinst.testing-board.com/“ einfach durch „http://www.testing-board.com/“ ersetzen.
^^Edit:
– Als schnelle Lösung kannst du natürlich auch „http://myusername:mypassword@www.testinst.testing-board.com/“ einfach durch „http://www.testing-board.com/“ ersetzen.
Hallo Sebastian!
hier mein Source Code
String pathToChromeDriver = „.//ChromeDriver//chromedriver.exe“;
System.setProperty(„webdriver.chrome.driver“, pathToChromeDriver);
ChromeDriver Chrom1 = new ChromeDriver();
Chrom1.manage().window().maximize();
// Chrom1.get(„http://www.testinst.testing-board.com/“);
//WebElement user_ele = Chrom1.findElement(By.id(„user_login“));
//WebElement pass_ele = Chrom1.findElement(By.id(„user_pass“));
//WebElement login_button = Chrom1.findElement(By.id(„wp-submit“));
//user_ele.sendKeys(„Christoph-Droege“);
//pass_ele.sendKeys(„mypassword“);
//login_button.click();
Es tritt ein Fehler bei //WebElement user_ele = Chrom1.findElement(By.id(„user_login“));
auf.
user_login und user_pass habe ich von der Login / Register page. Ebenso der Login Button.
Was ist falsch? Key „mypassword“ ist natürlich der Platzhalter für mein richtiges Password.
Hi Christoph,
ein paar Rückfragen:
Du bist weiter auf der Testinstanz unterwegs, wo du ja am HTTP Auth nicht vorbei kommst, ist das gewollt?
// Chrom1.get(„http://www.testinst.testing-board.com/“);
-> Was genau ist deine Erwartungshaltung bzw. was versuchst du da genau?
-> Was soll passieren und wie genau ist die Fehlermeldung?
Mir fehlen mehr Informationen um zu verstehen, was du da überhaupt vor hast.
Kurzes Feedback: Dass du unter der URL nicht weiter kommst, wundert mich nicht, denn ich erklärte ja, dass du da wegen dem HTTP Basic Auth nicht weiter kommen wirst.
Schreibe am besten mal bisschen ausführlicher, was genau du ausprobieren magst, was du alles schon probiert hast und eben die genaue Fehlermeldungen. Du solltest natürlich erst mal ein wenig ausprobieren es selbst zu lösen, also schreibe auch gerne mal was du versucht hast den Fehler zu beheben, dann verstehe ich auch noch besser was du vor hast.
Hallo Sebastian,
ich möchte mich auf der Seite „Login/Register“ über Java-Source Code einloggen. Wenn ich auf der Seite „Login/Register“ bin, kann ich mich mit user und passwort einloggen. Oben rechts erscheint dann mein Name.
Dieses Verhalten möchte ich auch für die Java-Scripte (*.java) erreichen.
Wenn ich den Java-Code starte, erscheint das Login-Fenster. Dort kann ich user und password angeben, nach dem Anmelden erscheint dann das Login-Fenster erneut.
So 100% sicher bin ich mir mit folgenden Lösungsvorschlag nicht, aber ich versuche gerne mal:
Chrom1.get(„http://www.testinst.testing-board.com/“);
… ersetzen durch…
Chrom1.get(„http://www.testing-board.com/“);
Falls das die Lösung ist, schau dir auch nochmal meinen ersten Kommentar oben an, um die Lösung zu verstehen. Denn dann ist das mit der HTTP-Auth geschützten Subdomain noch unklar. Ich denke zumindest, es macht Sinn das zu verstehen. Mit „Login-Fenster“ meinst du dann wahrscheinlich dann das Browser-pop-up des HTTP Auth. Sorry falls ich falsch liege, dann habe ich es komplett falsch verstanden.
Weiterhin sehe ich in deinem Code Ausschnitt oben aber auch nicht, dass du zur Login Seite gehst. Du rufst die Hauptdomain auf …
// Chrom1.get(„http://www.testinst.testing-board.com/“);
… und wenn ich es richtig sehe, suchst du dann direkt die Elemente zum Login
//WebElement user_ele = Chrom1.findElement(By.id(„user_login“));
Da fehlt dann noch das Aufrufen der Login-Seite dazwischen.
Du musst dir vorstellen, dass Selenium deinen Browser steuert. Alles was du im Browser ansteuern kannst, mit deiner Maus und Tastatur, kann Selenium machen. Sobald du Sachen versuchst zu klicken oder zu finden, die du gar nicht siehst, geht es nicht.
Gegebenenfalls liege ich aber falsch und du beherzigst das schon alles und hast das schon in deinem aktuellen Selenium Skript korrigiert. Sprich, falls du das alles schon korrekt bei dir hast und unsere „Login-Register“ Page kommt nach erfolgreichen Login nochmal, sag mir mal, ob du das auch nachstellen kannst, wenn du deinen normalen Browser ohne Selenium nutzt. Also sprich, ob du auch manchmal Login-Probleme auf der Login-Register-Page hast, wenn du dich ganz normal einloggst. Theoretisch könnte auch was mit dem WordPress Login schief laufen.
Nebenbei: Hast du das Selenium Tutorial 1 schon mal so wie es ist durch gemacht und haben die Code-Auszüge funktioniert? Da ist ja auch ein kompletter Login Ablauf ganz am Ende. Trotzdem ist wichtig die einzelnen Abschnitte zu verstehen.
Sag gerne ob du damit nun weiter kommst. Viel Spaß!