I wane step by step testcase nname in terminal - iframe

describe('open popup', ()=>{
it('click minimize button',()=>{
cy.visit('url')
cy.get('minimized-button').click() //it is minimize tab click
var iframesrc=cy.get('#modal-iframe').invoke('attr','src')
cy.get('email').type('jhdsj#gamil.com') //here I want it block
for confirmation of
entering email
})
})
when I am trying to enter in Iframe,not able to locate any element even i use wrap also...what i want is entering in loop then want step by step it block with testcase name that confirm in terminal that which step is passed in popup and which one is fail.

Related

iOS_Appium_Java-Element is present but click operation is not interactable

We're trying to automate one of our Test cases on iOS (iPad) with appium-java client 8.
The test step is like below:
Fetch element from TextField
Click on that textField
Clear the existing value and enter the new value
Test Result:
We're able to fetch the value from the TextField
Click action is successful but the actual interaction is not working. Due to which the sendkeys also not working
Note: The above scenario was working fine with approach 1 with TestProject. Now we've migrated the framework to appium. After that only it's failing few scenarios
Please review the attached DOMAppium Inspector- Actual Element
Tried Approaches
1. Approach 1
{
element.getAttribute("value");
element.click();
element.sendkeys("newvalue");
}
->
Test Result:
We're able to fetch the value from the TextField
Click action is successful but the actual interaction is not working. Due to which the sendkeys also not working
2. Actions Class
{
Actions action = new Actions(appiumDriver);
WebElement element = appiumDriver.findElement(byLocator);
element.getAttribute("value");
action.moveToElement(element).click().perform();
action.moveToElement(element).sendKeys(Keys.chord(Keys.CONTROL, "a")).perform();
element.clear();
element.sendKeys(""+text);
appiumDriver.hideKeyboard();
}
Test Result:
We're able to fetch the value from the TextField
Click action is successful but the actual interaction is not working. Due to which the sendkeys also not working
3. With W3C action
{
PointerInput FINGER = new PointerInput(PointerInput.Kind.TOUCH, "finger");
Sequence tap = new Sequence(FINGER, 1)
.addAction(FINGER.createPointerMove(Duration.ofMillis(0),PointerInput.Origin.viewport(), (element.getRect().x + (element.getSize().width/2)), element.getRect().y))
.addAction(FINGER.createPointerDown(0))
.addAction(new Pause(FINGER, Duration.ofMillis(200)))
.addAction(FINGER.createPointerUp(0));
appiumDriver.perform(Arrays.asList(tap));
}
Test Result:
We're able to fetch the value from the TextField
Click action is working fine. However it's clicking on different location. Same thing happening when we try to find element in appium inspector. The locator is correct but still the coordinates are different one.
Find element with xpath-Highlighing coordinates

How do I get input from the console in Nim?

I'm new to Nim, but it appears that there is no way to get input from the console in a similar way to input() in python or Console.ReadLine() in dotnet.
I want execution of my code to pause, wait for input, then on pressing enter to continue (just like input in other langs).
Oh no never mind found it:
var consoleInput = readLine(stdin);

python script more than one function

If your python script contains two or more functionalities, how can you run the script continuously to allow the user to select any one of these functionalities without restarting your program in a new IDLE console?
You could ask the user for input with the input prompt and decide what to do based on the input like this:
response = input("Please enter your name: ")
if (response == "John"):
fun_1(something)
else:
fun_2(something_else)
The input prompt will wait for user input and record every input up to a carriage return (ENTER).

Select window created using JavaScript

In My Robot Script , After clicking on Edit Description link a window get opens (i.e. Java Script Window) Images here
Image 1::
Image 2:: Window image Along with Page Source
What i need is a. Select the window (java script)
b. Enter text into Text Area and click Ok.
I tried to use Select Window new/ Select window Description But control is waiting infinite # Select Window key word its not moving forward. I have to kill Control forcefully.
*** Settings ***
Documentation Suite description
Library Selenium2Library run_on_failure=Nothing
Library Collections
*** Test Cases ***
Log into Command center
[Tags] DEBUG
open browser http://11.8.180.***/BCC ie
input text xpath=//*[#id='LoginName'] User
input password Password Pwd#123
click element LoginBtn
wait until keyword succeeds 30 sec 5 sec page should contain element AppTitle
sleep 3s
${Title} Get Page Title
log ${Title}
Navigation to Usrs
Click on Window popup and enter text
CloseBrowser
close all browsers
*** Keywords ***
Click on Window popup and enter text
Click Link //*[#id="aspnetForm"]/table/tbody/tr[1]/td[2]/a
Sleep 5s
Select Window By Unique Identifier Element With Delay //*[#id="descript"]
Select Window By Unique Identifier Element With Delay
[Arguments] ${element} ${delay_time}=10
sleep ${delay_time}
#{wins}= Get Window Handles
Log ${wins}<--these are window names console=true
:FOR  ${windowName}  IN  #{wins}
\   Log ${windowName} console=true
\ run keyword and ignore error Select Window  ${windowName}
\   ${found_flag}= run keyword and return status page should contain  ${element}
\   Run keyword if ${found_flag} input text ${element} this is text
\   exit for loop if ${found_flag}
Get Page Title
Log Control came to GET PAGE TITLE
run keyword and return Get Title
Navigation to Usrs
Go to http://11.8.180.***/BCC/role.aspx
Any Idea how to select new window? and enter text hit okay.
A.Get Window Identifiers --> Jus hangs it neither moves nor throw any error
B. Get Window Names gives this error {URLError: <urlopen error [Errno 10061] No connection could be made because the target machine actively refused it>..}.
C. Get Window Handles returns this { [u'b0ce0f28-f6d4-4943-93f7-f65fd5f1de2a', u'c0442110-4ea9-40a4-b126-eee09d9f3eb0']}
I am not sure how to identify which window have these id's
Thanks in Advance
It should be recognized as new window in your browser, so you can use:
Select Window Description

Open print dialog for report from code

I am attempting to force open the print dialog so that all the user has to do is set the email address and press ok. I've found multiple tutorials on how to print a report to file or a printer without the print dialog, but that's not what I'm looking for.
Typically to email a report, the user displays the report, clicks the print icon in the tool bar, and then chooses email and sends it. I want to cut out the first two steps automatically.
This is one of my many attempts at doing this so far, but to no avail.
void emailInvoice()
{
Args args;
ReportRun rr;
Report rb;
PrintJobSettings pjs;
CustInvoiceJour record;
;
select record where record.RecId == 5637175089;
args = new Args("SalesInvoice");
args.record(record);
args.parmEnum(PrintCopyOriginal::OriginalPrint);
// Set report run properties
rr = new ReportRun(args,'');
rr.suppressReportIsEmptyMessage(true);
rr.query().interactive(false);
// set report properties
rb = rr.report();
rb.interactive(true);
// set print job settings
pjs = rr.printJobSettings();
pjs.fileName(strfmt("C:\\Users\\gbonzo\\Desktop\\%1.pdf", record.SalesId));
pjs.fitToPage(true);
// break the report info pages using the height of the current printer's paper
pjs.virtualPageHeight(-1);
// force PDF printing
pjs.format(PrintFormat::PDF);
pjs.setTarget(PrintMedium::Mail);
pjs.viewerType(ReportOutputUserType::PDF);
// lock the print job settings so can't be changed
// X++ code int the report may try to change the destination
// to the screen for example but this does not make
// sense when running a report here
pjs.lockDestinationProperties(true);
// Initialize the report
rr.init();
rr.run();
}
Thanks in advance for your help!
Have you tried to develop a RunBase standard dialog class (RunBaseBatchPrintable if you need to select the printer) that get all the dialog fields you need and from there, programatically run the report passing all the desired parameters? I'm prety sure it will work, and probably will left a cleaner code separating the report of the logic needed to the user interaction.
Read an example here:
http://waikeatng.blogspot.com.es/2010/10/using-runbasebatchprintable-class.html
You have to call the prompt() method of the ReportRun class before calling the run() method.
if (rr.prompt())
{
rr.run();
}
The prompt() method will show the print dialog. If you want it easier for your users you could use the SysMailer class, take a look to the quickSend() method.

Resources