The post Webdriver | Launch Edge Browser Using Testmate | VBScript appeared first on TestMate.
]]>'Intialize edge Options
wd.InitializeEdgeOptions()
'Initialize edge Driver
wd.InitializeEdgeDriver("C:\Users\...\EdgeDriverPath")
'Navigate the URL
wd.NavigateToUrl("https://www.facebook.com/")
'Highlight the control
wd.Highlight("id::email")
'Send Keys in Email textbox
Call wd.SendKeys("id::email","abc")
'Send keys in Password
Call wd.SendKeys("id::pass","hello")
The post Webdriver | Launch Edge Browser Using Testmate | VBScript appeared first on TestMate.
]]>The post Webdriver | Execute JavaScript Using Testmate appeared first on TestMate.
]]>'Initialize the driver
Call wd.InitializeFireFoxDriver("C:\Users\Desktop\selenium")
'Navigate to the desired URL
Call wd.NavigateToUrl("https://www.google.com/")
'Execute javascript
Call wd.ExecuteScript("name::q","arguments[0].style.border='3px solid red'")
'Return page title using java script
Msgbox wd.ExecuteScript("return document.title")
The post Webdriver | Execute JavaScript Using Testmate appeared first on TestMate.
]]>The post Webdriver | Work With Multiple Browsers | Driver Parking appeared first on TestMate.
]]>''Park upto 5 instances of driver''
'Initialize the driver
Call wd.InitializeFireFoxDriver("C:\Users\jaska\Desktop\selenium")
'Navigate to the desired URL
Call wd.NavigateToUrl("https://www.google.com/")
'Park the current object instance in the reserved space - so that a new driver object can be created without loosing the old one
'FF driver - Parking Space 1
Call wd.ParkDriver1()
'Initialize IE Driver
Call wd.InitializeInternetExplorerDriver("C:\Users\jaska\Desktop\selenium")
'Navigate to the desired URL
Call wd.NavigateToUrl("https://www.google.com/")
'Park the current object instance in the reserved space - so that a new driver object can be created without loosing the old one
'IE driver - Parking Space 2
Call wd.ParkDriver2()
'Initialize Chrome Driver
Call wd.InitializeChromeDriver("C:\Users\jaska\Desktop\selenium")
'Navigate to the desired URL
Call wd.NavigateToUrl("https://www.google.com/")
'Type in Chrome
Call wd.SendKeys("name::q","This is Chrome")
'Switch Back to Internet Explorer
Call wd.UnParkDriver2()
'Type in IE
Call wd.SendKeys("name::q","This is IE")
'Switch Back to FireFox
Call wd.UnParkDriver1()
'Type in FireFOX
Call wd.SendKeys("name::q","This is Firefox")
The post Webdriver | Work With Multiple Browsers | Driver Parking appeared first on TestMate.
]]>The post Webdriver | Launch Headless Browser Using Testmate | PhantomJS appeared first on TestMate.
]]>'Initialize the driver
wd.PJSInitializeDriver("C:\Users\...\Driverpath")
'wd.NavigateToUrl("www.google.com")
Call wd.NavigateToUrl("https://jqueryui.com/droppable/")
'Switch to the frame using xpath as identifier
Call wd.SwitchToFrame("xpath::.//*[@id='content']/iframe")
'Initialize Action object
Call wd.ActionInitialize()
'Add an action to the initialized action object
Call wd.ActionDragAndDrop("id::draggable","id::droppable")
'Perform the action
Call wd.ActionPerform()
'Report the step
Logger.Pass "Step 1", wd.GetTitle(), True
'Quit The driver
Call wd.Quit()
The post Webdriver | Launch Headless Browser Using Testmate | PhantomJS appeared first on TestMate.
]]>The post Webdriver | Drag And Drop Using Testmate | Action appeared first on TestMate.
]]>'Initialize the driver
Call wd.InitializeFireFoxDriver("C:\Users\jaska\Desktop\selenium")
'Navigate to the requireed URL
Call wd.NavigateToUrl("https://jqueryui.com/droppable/")
'Switch to the frame using xpath as identifier
Call wd.SwitchToFrame("xpath::.//*[@id='content']/iframe")
'Initialize Action object
Call wd.InitializeAction()
'Add an action to the initialized action object
Call wd.DragAndDrop_Action("id::draggable","id::droppable")
'Performa the action
Call wd.BuildAndPerform_Action()
'Quit The driver
Call wd.Quit()
The post Webdriver | Drag And Drop Using Testmate | Action appeared first on TestMate.
]]>The post Webdriver | Selenium Grid | Remote Driver appeared first on TestMate.
]]>We must start a hub and register nodes on it to trigger executions:
Use the following command-line code to start a hub
java -jar selenium-server-standalone-3.11.0.jar -role hub
Use the following command-line code to register a node
java -jar selenium-server-standalone-3.11.0.jar -role node -hub http://192.168.2.1:4444/grid/register/ (Sample)
Remote driver for Chrome
'Directing the driver to use remote options for chrome
Call wd.UseChrome_RemoteOptions()
'Adding some remote options
Call wd.BrowserVersion_RemoteOptions("79.0.3945.88")
'Launch remote driver
Call wd.InitializeRemoteDriver("http://192.168.50.1:4444/wd/hub")
'Navigating to the URL
Call wd.NavigateToUrl("http://www.google.com")
Remote driver for IE
Call wd.UseInternetExplorer_RemoteOptions()
Call wd.InitializeRemoteDriver("http://192.168.50.1:4444/wd/hub")
Call wd.NavigateToUrl("http://www.google.com")
Remote driver for Firefox
Call wd.UseFirefox_RemoteOptions()
Call wd.InitializeRemoteDriver("http://192.168.50.1:4444/wd/hub")
Call wd.NavigateToUrl("http://www.google.com")
Similarly, it can be coded for other remote drivers like Safari, Android, iOS, etc.
The post Webdriver | Selenium Grid | Remote Driver appeared first on TestMate.
]]>The post Webdriver | Launch Chrome Browser Using Testmate | Proxy | Arguments appeared first on TestMate.
]]>InitializeChromeDriver method takes the path of chromedriver.exe as a parameter.
'Initialize the Chrome driver
Call wd.InitializeChromeDriver("C:\Users\jaska\Desktop\selenium")
'Maximize the window
wd.MaximizeWindow()
'Navigate to the URL and search
wd.NavigateToUrl("https://www.google.com/")
Call wd.SendKeys("name::q","Hello World")
Call wd.Click("name::btnK")
Add Arguments
'Initialize the Chrome driver
Call wd.InitializeChromeOptions()
Call wd.AddArgument_ChromeOptions("disable-infobars")
Call wd.InitializeChromeDriver("C:\Users\jaska\Desktop\selenium")
Proxy & Arguments
'Reinitialize the options
wd.InitializeChromeOptions()
'To Reinitialize Proxy - Just in case Host proxy object is already assigned some values(This is Optional)
Call wd.InitializeProxy()
'Set HTTP Proxy value in the proxy object
Call wd.SetHTTP_Proxy("localhost:8888")
'Set proxy in chrome options
Call wd.SetProxy_ChromeOptions()
'Initialize driver
Call wd.InitializeChromeDriver("C:\Users\jaska\Desktop\selenium")
'Maximize window
wd.MaximizeWindow()
'Navigate to URls
wd.NavigateToUrl("https://www.facebook.com/")
The post Webdriver | Launch Chrome Browser Using Testmate | Proxy | Arguments appeared first on TestMate.
]]>The post Webdriver | Launch Internet Explorer Using Testmate | VBScript appeared first on TestMate.
]]>Vbscript
'Initialize the options (Optional but recommended)
Call wd.InitializeInternetExplorerOptions()
'Set IE options for Initial URL (Optional)
Call wd.InitialBrowserUrl_InternetExplorerOptions("https://www.google.com/")
'Initialize IE driver
Call wd.InitializeInternetExplorerDriver("C:\Users\jaska\Desktop\selenium")
'Send Keys in the search field
Call wd.SendKeys("name::q","Hello World")
'Navigate to the other URL's
wd.NavigateToUrl("https://www.facebook.com/")
The post Webdriver | Launch Internet Explorer Using Testmate | VBScript appeared first on TestMate.
]]>