Selenium IDE : I am trying to open a link in new tab using controlkey or contextmenu and both commands did not work.
USING CONTROLKEY : 1). verify element present 2)controlkeydown() 3) click link 4) controlkeyup(). when executed, it displays the error unknown command (control key().
USING CONETXTMENU : 1 ) Verify element present 2) contextmenu target link=linkname 3) click target = link
How about extracting href attribute from link and using it to open a new window with separate command?
|storeAttribute | SOME_LOCATOR#href | mylink |
|openWindow | ${mylink} | |
EDIT: more specific example
|open | http://twitter.com | |
|storeAttribute | link=About#href | mylink |
|openWindow | ${mylink} | |
This opens Twitter's About page in new window.
My advise to you will be to not test this. Both of the items you are trying to test are features of the browser itself and not of the web application. So if your aim is to test the web application, you are not adding any value by testing the browser.
Related
Is it possible to generate dynamically test scenarios for each element in array?
I've got two arrays with elements (each for an environment against which I run test suite), like that:
devEnv = ['link1', 'link2', 'link3', 'link4']
testEnv = ['link1', 'link2', 'link3']
In dev env there are 4 link available, in test env only 3.
In protractor + jasmine you can get its in a loop like that: https://stackoverflow.com/a/35114139/6331748
I'm using protractor + cucumber.
When I hardcode in feature file date like that:
Scenario Outline:
Given I am on main page
When I click "<linkToGo>" link
Then I should be on "<linkToGo>" page
Examples:
|linkToGo |
|link1 |
|link2 |
|link3 |
|link4 |
The tests will pass for dev env - all 4 links will be clicked, but on test env there's not link4.
Any ideas how to solve case like that?
I suggest to create 2 different scenario with different Tags
#Dev
Scenario Outline: To test Dev Enmv
Given I am on main page
When I click "" link
Then I should be on "" page
Examples:
|linkToGo |
|link1 |
|link2 |
|link3 |
|link4 |
#Test
Scenario Outline: To test Test envmt
Given I am on main page
When I click "" link
Then I should be on "" page
Examples:
|linkToGo |
|link1 |
|link2 |
|link3 |
Same Gherkin line is used with same SD.
Now depends on your need, pass the tag to Configuration file
Hope this will solve your problem.
I want to implement the Invite User actions located in the Calendar>Events to Project.
I've tried searching in the Workflows and other settings but I couldn't find where is the actions located.
Invtite Users does not have any UI for configuration. you have to modify the following files for your customization.
modules/Events/models/Module.php | function -> saveRecord | Between lines -> 28-40
modules/Events/models/Record.php | function -> getInviteUserMailData| Between lines -> 136-189
modules/Calendar/CalendarCommon.php | function -> sendInvitation| Between lines -> 150-181
I am using the AzureAd Powershell module for user management. However it does not have all the functionality that I need, specifically, I can't assign Application Extension values to objects, (although I can create delete and remove application extensions themselves via [Get/New/Remove]-AzureADApplicationExtensionProperty).
I know from watching the API calls with Fiddler that the graph calls are using bearer tokens, and I've called the graph API directly from Postman manually so I know how to use the Bearer token if I could get it. How do I get it?
To get the token simply use:
$token = [Microsoft.Open.Azure.AD.CommonLibrary.AzureSession]::AccessTokens['AccessToken']
But how could one come to this conclusion?
First look for where the module is located:
(Get-Module AzureAd).Path
C:\Program Files\WindowsPowerShell\Modules\AzureAD\2.0.1.3\Microsoft.Open.AzureAD16.Graph.PowerShell.dll
Now lets just make 2 assumptions. First that the token is stored in a static member of a static class, and second that it might not be stored in that dll, but any of the DLLs in the folder.
$fileInfo = New-Object 'IO.FileInfo' (Get-Module AzureAd).Path
$moduleFolder = $fileInfo.Directory.FullName
$assemblies = [AppDomain]::CurrentDomain.GetAssemblies() | where { $_.Location -ne $null -and $_.Location.StartsWith($moduleFolder)}
$assemblies | select -expandproperty ExportedTypes | Where { $_.IsSealed -and $_.IsAbstract } | Select Name, FullName
That last line btw is because of the weird way static types are noted in IL.
Which outputs a very small list:
Name FullName
---- --------
RestSharpExtensionMethods Microsoft.Open.Azure.AD.CommonLibrary.RestSharpExtensionMethods
AzureSession Microsoft.Open.Azure.AD.CommonLibrary.AzureSession
DictionaryExtensions Microsoft.Open.Azure.AD.CommonLibrary.DictionaryExtensions
Logger Microsoft.Open.Azure.AD.CommonLibrary.Logger
ImageUtils Microsoft.Open.Azure.AD.CommonLibrary.Utilities.ImageUtils
SecureStringExtension Microsoft.Open.Azure.AD.CommonLibrary.Extensions.SecureStringExtension
AzureEnvironmentConstants Microsoft.Open.Azure.AD.CommonLibrary.AzureEnvironment+AzureEnvironmentConstants
TypeToOdataTypeMapping Microsoft.Open.AzureAD16.Client.TypeToOdataTypeMapping
JsonConvert Newtonsoft.Json.JsonConvert
Extensions Newtonsoft.Json.Linq.Extensions
Extensions Newtonsoft.Json.Schema.Extensions
TypeToOdataTypeMapping Microsoft.Open.MSGraphV10.Client.TypeToOdataTypeMapping
AdalError Microsoft.IdentityModel.Clients.ActiveDirectory.AdalError
AuthenticationContextIntegratedAuthExtensions Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContextIntegratedAuthExtensions
AdalOption Microsoft.IdentityModel.Clients.ActiveDirectory.AdalOption
MiscExtensions RestSharp.Extensions.MiscExtensions
ReflectionExtensions RestSharp.Extensions.ReflectionExtensions
ResponseExtensions RestSharp.Extensions.ResponseExtensions
ResponseStatusExtensions RestSharp.Extensions.ResponseStatusExtensions
StringExtensions RestSharp.Extensions.StringExtensions
XmlExtensions RestSharp.Extensions.XmlExtensions
RestClientExtensions RestSharp.RestClientExtensions
SimpleJson RestSharp.SimpleJson
We could pipe through Out-Gridview if the list was longer, but my attention was immediatly drawn to AzureSession. After that a little PowerShell autocomplete, and I found my way to [Microsoft.Open.Azure.AD.CommonLibrary.AzureSession]::AccessTokens['AccessToken']
Test env: Capybara,poltergeist, phantomjs.
A new window opens up when I click a link in my test case. I was able to switch to the new window and verify text using selenium driver. However, I am unable to switch to the new window with poltergeist. I tried the following method to switch to the new window and none of them worked.
I wanted to see if a new browser is getting open at all and looks like it is.
main = page.driver.browser.window_handles.first
puts main (gives 0)
popup = page.driver.browser.window_handles.last
puts popup (gives 1)
1. within_window(->{ page.title == '2015-11-5.pdf' }) { assert_text(facility_name) }
2. page.switch_to_window(window=popup)
3. page.switch_to_window(page.driver.browser.window_handles.last)
4. page.driver.browser.switch_to().window(page.driver.browser.window_handles.last)
Could someone provide any inputs here? Thanks!
I used the following and the popup is getting generated and the control switches to it.
page.switch_to_window(page.window_opened_by{click_link('Generate Report')})
The new window has a pdf embedded in it.I was able to read and verify the contents of the document when I use selenium driver. With poltergeist, I am unable to read the pdf. Could you give me some pointers on how to proceed?
Capybara has a number of cross driver methods for dealing with this without having to go to driver specific methods.
popup = page.window_opened_by {
click_link('whatever link opens the new window')
}
within_window(popup) do
# perform actions in the new window
end
We are upgrading from 3.9 to 4.5.
In Some 3.9 Orbeon forms, We use customized submit button for save.
This is not working in 4.5 Orbeon forms. When I click on "Submit", Its not saving the form to orbeon_form_data table.
Below is the source code section for the "submit",
<xhtml:head>
<xforms:bind id="eoisave-btn-bind" ref="eoisave-btn" name="eoisave-btn" type="xforms:string"
relevant="$Bidlist_IsBidding != ''"/>
</xhtml:head>
<xhtml:body>
<fr:button id="eoisave-btn-control" bind="eoisave-btn-bind">
<xforms:label ref="$form-resources/eoisave-btn/label"/>
<xforms:hint ref="$form-resources/eoisave-btn/hint"/>
<xforms:alert ref="$fr-resources/detail/labels/alert"/>
</fr:button>
<xforms:action ev:event="DOMActivate" ev:observer="eoisave-btn-control">
<xforms:setvalue if="xxforms:instance('fr-error-summary-instance')/valid = 'true'"
ref="./EOISaved"
value="1"/>
<xforms:setvalue ref="./user-action">submit eoi</xforms:setvalue>
<xforms:dispatch name="fr-save-action" target="fr-persistence-model">
<xxforms:context name="fr:check-data-valid" select="true()"/>
</xforms:dispatch>
</xforms:action>
</xhtml:body>
And In the orbeon log, I can find the following.
+----------------------------------------------------------------------------------------------------------------------+
|An Error has Occurred |
|----------------------------------------------------------------------------------------------------------------------|
|Cannot compare xs:boolean to xs:string |
|----------------------------------------------------------------------------------------------------------------------|
|Application Call Stack |
|----------------------------------------------------------------------------------------------------------------------|
|----------------------------------------------------------------------------------------------------------------------|
|Exception: org.orbeon.saxon.trans.XPathException |
|----------------------------------------------------------------------------------------------------------------------|
Orbeon Forms 4.5 has simple processes which you can associate with buttons. See Form Runner: Buttons and Processes. The benefit of using those is that you don't rely on internals of Form Runner as you did with 3.9. Now I am not sure processes allow you to do everything you want to do at the moment, such as setting values, but I thought I would mention them.
This said, as a first step, try changing:
xxforms:instance('fr-error-summary-instance')/valid = 'true'
to:
xxforms:instance('fr-error-summary-instance')/valid = true()
Second, the fr-save-action is gone. This was an internal Form Runner event. Try instead:
<xf:action type="xpath" xmlns:process="java:org.orbeon.oxf.fr.process.SimpleProcess">
process:runProcessByName('oxf.fr.detail.process', 'save-final')
</xf:action>
Note that I haven't tested this.