#Read SeleniumGrid-Docker.docx present in this folder for more details.
To Run the sript on Linux
#!/bin/bash
Build_pid=$(sudo netstat -tpln|grep :8000|awk -F ' ' '{print
if [ -z "$Build_pid" ];then build_maven_fn else sudo kill -9 $Build_pid build_maven_fn fi
#Things to Know To find the list of all elements @FindAll(@FindBy(how = How.CSS, using = "span.ppm_read_only_value")) private List build_version;
ITestContext
To store object and retrieve in other class (itestcontext is active through out the session)
https://automationtalks.com/2017/07/06/what-is-itestcontext-in-testng-seleniu/
SimpleDateFormat String sLatestRun = nikuhomepage.getTablerows().get(1).findElements(By.tagName("td")).get(10).getText(); Date dLatestRun = new SimpleDateFormat("MM/dd/yy hh:mm a").parse(sLastRun);
TestNG @Test(dependsOnMethods = { "ValidateAboutDialog" }, priority = 4)
Extent Reports
Headless
WebDriverManager.chromedriver().setup(); ChromeOptions options= new ChromeOptions(); options.addArguments("headless"); driver = new ChromeDriver(options);
To wait for the elements that are loaded at runtime
AjaxElementLocatorFactory factory= new AjaxElementLocatorFactory(driver, 10); PageFactory.initElements(factory, this);
for /f "tokens=5" %%a in ('netstat -aon ^| findstr ":4444"') do taskkill /F /PID %%a
for /f "tokens=5" %%a in ('netstat -aon ^| findstr ":4442"') do taskkill /F /PID %%a
for /f "tokens=5" %%a in ('netstat -aon ^| findstr ":5556"') do taskkill /F /PID %%a
for /f "tokens=5" %%a in ('netstat -aon ^| findstr ":5559"') do taskkill /F /PID %%a
powershell -command "Stop-Process -name 'cmd,'conhost' -Force"